[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [collector/release] Exclude lastModifiedMillis in index.json.



commit b23232bd44c82defee92cbe1d697cafb7862205a
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
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"}) {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits