common: Add external annotations for Map.get()/.remove()
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 19 May 2015 00:33:29 +0000 (20:33 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Wed, 28 Oct 2015 23:01:32 +0000 (19:01 -0400)
Even if one declares a Map<Object, @NonNull Object>, Map.get()
can return a null to indicate "there is no value for this key".
Same applies to .remove() too.

Since the base methods are not annotated, we either have to
supply our own annotation, or make sure to always use @Nullable
keys. The former is less error-prone, so let's do that.

See http://stackoverflow.com/a/25371836/4227853 .

Change-Id: I3bb7395d7dca053d354f2f418d8529696edd0346
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/57249
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
common/org.eclipse.tracecompass.common.core/annotations/java/util/Map.eea [new file with mode: 0644]
common/org.eclipse.tracecompass.common.core/annotations/java/util/TreeMap.eea [new file with mode: 0644]

diff --git a/common/org.eclipse.tracecompass.common.core/annotations/java/util/Map.eea b/common/org.eclipse.tracecompass.common.core/annotations/java/util/Map.eea
new file mode 100644 (file)
index 0000000..97ab712
--- /dev/null
@@ -0,0 +1,7 @@
+class java/util/Map
+get
+ (Ljava/lang/Object;)TV;
+ (Ljava/lang/Object;)T0V;
+remove
+ (Ljava/lang/Object;)TV;
+ (Ljava/lang/Object;)T0V;
diff --git a/common/org.eclipse.tracecompass.common.core/annotations/java/util/TreeMap.eea b/common/org.eclipse.tracecompass.common.core/annotations/java/util/TreeMap.eea
new file mode 100644 (file)
index 0000000..4111a71
--- /dev/null
@@ -0,0 +1,4 @@
+class java/util/TreeMap
+get
+ (Ljava/lang/Object;)TV;
+ (Ljava/lang/Object;)T0V;
This page took 0.025825 seconds and 5 git commands to generate.