Gehel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406019 )

Change subject: Change should be threadsafe.
......................................................................

Change should be threadsafe.

Changes are processed by an executor service, they should be threadsafe.

Change-Id: Iaddac7894a15c5bd0cec492607b349886e04ba25
---
M tools/src/main/java/org/wikidata/query/rdf/tool/change/Change.java
1 file changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/19/406019/1

diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/change/Change.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/change/Change.java
index ce48b99..5e846ac 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/change/Change.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/change/Change.java
@@ -1,6 +1,7 @@
 package org.wikidata.query.rdf.tool.change;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Collections.unmodifiableCollection;
 
 import java.util.Collection;
 import java.util.Date;
@@ -245,7 +246,7 @@
      * Set statements collection.
      * @return
      */
-    public Collection<Statement> getStatements() {
+    public synchronized Collection<Statement> getStatements() {
         return statements;
     }
 
@@ -253,15 +254,15 @@
      * Return statements collection.
      * @return
      */
-    public void setStatements(Collection<Statement> statements) {
-        this.statements = statements;
+    public synchronized void setStatements(Collection<Statement> statements) {
+        this.statements = unmodifiableCollection(statements);
     }
 
     /**
      * Set cleanup list.
      * @return
      */
-    public Collection<String> getCleanupList() {
+    public synchronized Collection<String> getCleanupList() {
         return cleanupList;
     }
 
@@ -269,7 +270,7 @@
      * Return cleanup list.
      * @param cleanupList
      */
-    public void setCleanupList(Collection<String> cleanupList) {
-        this.cleanupList = cleanupList;
+    public synchronized void setCleanupList(Collection<String> cleanupList) {
+        this.cleanupList = unmodifiableCollection(cleanupList);
     }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/406019
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaddac7894a15c5bd0cec492607b349886e04ba25
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Gehel <guillaume.leder...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to