Bug 582814 Remove unneeded synchronized in IntIndexCollector::get
Extra javadoc to note the concurrency semantics.
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=582814
diff --git a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java
index 6aca6a0..728e98b 100644
--- a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java
+++ b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java
@@ -702,6 +702,12 @@
});
}
+ /**
+ * Sets a value in the collector.
+ *
+ * Safe to be called concurrently from multiple threads. Not safe to mix
+ * concurrent get and set calls.
+ */
public void set(int index, int value)
{
ArrayIntCompressed array = getPage(index / pageSize);
@@ -711,6 +717,12 @@
}
}
+ /**
+ * Gets from the collected index.
+ *
+ * Safe to be called concurrently from multiple threads. Not safe to mix
+ * concurrent get and set calls.
+ */
public int get(int index)
{
// set() only happens during parsing stage, get later