From d812a4291c0ae61b407aab705a26e9f14eb55a75 Mon Sep 17 00:00:00 2001 From: Zachary Hensley Date: Fri, 22 Feb 2019 10:55:20 -0600 Subject: [PATCH] Handle review comments --- Lib/java/std_list.i | 2 +- Lib/java/std_map.i | 9 +++------ Lib/java/std_set.i | 10 +++++----- Lib/java/std_unordered_map.i | 6 +++--- Lib/java/std_unordered_set.i | 10 +++++----- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Lib/java/std_list.i b/Lib/java/std_list.i index 3ad6511ce..82ccde38b 100644 --- a/Lib/java/std_list.i +++ b/Lib/java/std_list.i @@ -43,7 +43,7 @@ namespace std { this(); java.util.ListIterator<$typemap(jboxtype, T)> it = listIterator(0); // Special case the "copy constructor" here to avoid lots of cross-language calls - for (Object o : c) { + for (java.lang.Object o : c) { it.add(($typemap(jboxtype, T))o); } } diff --git a/Lib/java/std_map.i b/Lib/java/std_map.i index a7202bc06..6d5ca1aac 100644 --- a/Lib/java/std_map.i +++ b/Lib/java/std_map.i @@ -51,16 +51,13 @@ template > class map { %typemap(javabase) std::map< K, T, C > "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" -%typemap(javaimports) std::map< K, T, C > - "import java.lang.Object;" - %proxycode %{ public int size() { return sizeImpl(); } - public boolean containsKey(Object key) { + public boolean containsKey(java.lang.Object key) { if (!(key instanceof $typemap(jboxtype, K))) { return false; } @@ -68,7 +65,7 @@ template > class map { return containsImpl(($typemap(jboxtype, K))key); } - public $typemap(jboxtype, T) get(Object key) { + public $typemap(jboxtype, T) get(java.lang.Object key) { if (!(key instanceof $typemap(jboxtype, K))) { return null; } @@ -93,7 +90,7 @@ template > class map { } } - public $typemap(jboxtype, T) remove(Object key) { + public $typemap(jboxtype, T) remove(java.lang.Object key) { if (!(key instanceof $typemap(jboxtype, K))) { return null; } diff --git a/Lib/java/std_set.i b/Lib/java/std_set.i index 06c5a63e7..086d10c8a 100644 --- a/Lib/java/std_set.i +++ b/Lib/java/std_set.i @@ -59,7 +59,7 @@ class set { public boolean addAll(java.util.Collection collection) { boolean didAddElement = false; - for (Object object : collection) { + for (java.lang.Object object : collection) { didAddElement |= add(($typemap(jboxtype, T))object); } @@ -96,7 +96,7 @@ class set { } public boolean containsAll(java.util.Collection collection) { - for (Object object : collection) { + for (java.lang.Object object : collection) { if (!contains(object)) { return false; } @@ -105,7 +105,7 @@ class set { return true; } - public boolean contains(Object object) { + public boolean contains(java.lang.Object object) { if (!(object instanceof $typemap(jboxtype, T))) { return false; } @@ -115,14 +115,14 @@ class set { public boolean removeAll(java.util.Collection collection) { boolean didRemoveElement = false; - for (Object object : collection) { + for (java.lang.Object object : collection) { didRemoveElement |= remove(object); } return didRemoveElement; } - public boolean remove(Object object) { + public boolean remove(java.lang.Object object) { if (!(object instanceof $typemap(jboxtype, T))) { return false; } diff --git a/Lib/java/std_unordered_map.i b/Lib/java/std_unordered_map.i index 8f62d7290..283a9b464 100644 --- a/Lib/java/std_unordered_map.i +++ b/Lib/java/std_unordered_map.i @@ -57,7 +57,7 @@ template class unordered_map { return sizeImpl(); } - public boolean containsKey(Object key) { + public boolean containsKey(java.lang.Object key) { if (!(key instanceof $typemap(jboxtype, K))) { return false; } @@ -65,7 +65,7 @@ template class unordered_map { return containsImpl(($typemap(jboxtype, K))key); } - public $typemap(jboxtype, T) get(Object key) { + public $typemap(jboxtype, T) get(java.lang.Object key) { if (!(key instanceof $typemap(jboxtype, K))) { return null; } @@ -90,7 +90,7 @@ template class unordered_map { } } - public $typemap(jboxtype, T) remove(Object key) { + public $typemap(jboxtype, T) remove(java.lang.Object key) { if (!(key instanceof $typemap(jboxtype, K))) { return null; } diff --git a/Lib/java/std_unordered_set.i b/Lib/java/std_unordered_set.i index cdc116e49..1a7b03688 100644 --- a/Lib/java/std_unordered_set.i +++ b/Lib/java/std_unordered_set.i @@ -59,7 +59,7 @@ class unordered_set { public boolean addAll(java.util.Collection collection) { boolean didAddElement = false; - for (Object object : collection) { + for (java.lang.Object object : collection) { didAddElement |= add(($typemap(jboxtype, T))object); } @@ -96,7 +96,7 @@ class unordered_set { } public boolean containsAll(java.util.Collection collection) { - for (Object object : collection) { + for (java.lang.Object object : collection) { if (!contains(object)) { return false; } @@ -105,7 +105,7 @@ class unordered_set { return true; } - public boolean contains(Object object) { + public boolean contains(java.lang.Object object) { if (!(object instanceof $typemap(jboxtype, T))) { return false; } @@ -115,14 +115,14 @@ class unordered_set { public boolean removeAll(java.util.Collection collection) { boolean didRemoveElement = false; - for (Object object : collection) { + for (java.lang.Object object : collection) { didRemoveElement |= remove(object); } return didRemoveElement; } - public boolean remove(Object object) { + public boolean remove(java.lang.Object object) { if (!(object instanceof $typemap(jboxtype, T))) { return false; }