commit b23232bd44c82defee92cbe1d697cafb7862205a
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Thu Dec 14 10:13:11 2017 +0100
Exclude lastModifiedMillis in index.json.
Fixes #24621.
---
CHANGELOG.md | 6 ++++++
src/main/java/org/torproject/collector/index/CreateIndexJson.java | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c924f5e..2f4cd21 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+# Changes in version 1.?.? - 201?-??-??
+
+ * Minor changes
+ - Exclude lastModifiedMillis in index.json.
+
+
# Changes in version 1.4.1 - 2017-10-26
* Medium changes
diff --git a/src/main/java/org/torproject/collector/index/CreateIndexJson.java b/src/main/java/org/torproject/collector/index/CreateIndexJson.java
index 5c4daf9..c4399b8 100644
--- a/src/main/java/org/torproject/collector/index/CreateIndexJson.java
+++ b/src/main/java/org/torproject/collector/index/CreateIndexJson.java
@@ -163,7 +163,8 @@ public class CreateIndexJson extends CollecTorMain {
private void writeIndex(IndexNode indexNode) throws Exception {
indexJsonFile.getParentFile().mkdirs();
- Gson gson = new GsonBuilder().create();
+ Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation()
+ .create();
String indexNodeString = gson.toJson(indexNode);
for (String filename : new String[] {indexJsonFile.toString(),
indexJsonFile + ".gz", indexJsonFile + ".xz", indexJsonFile + ".bz2"}) {