Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-02-19 06:57:06 +0000
committerEike Stepper2015-02-19 10:17:30 +0000
commit0f40832d925f63a5b4699f7753b4661d45f83b2c (patch)
tree792ef8ab3af6980e3714fa93ab8b185bca70ebd3 /plugins/org.eclipse.net4j.util
parent07baeaed2889056219bbe981d4aeab430bd9455a (diff)
downloadcdo-0f40832d925f63a5b4699f7753b4661d45f83b2c.tar.gz
cdo-0f40832d925f63a5b4699f7753b4661d45f83b2c.tar.xz
cdo-0f40832d925f63a5b4699f7753b4661d45f83b2c.zip
[458349] Consolidate UI
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins/org.eclipse.net4j.util')
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/AdapterUtil.java8
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java8
2 files changed, 12 insertions, 4 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/AdapterUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/AdapterUtil.java
index 8a6636d088..363d7a2be8 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/AdapterUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/AdapterUtil.java
@@ -22,6 +22,14 @@ public final class AdapterUtil
{
}
+ /**
+ * @since 3.5
+ */
+ public static <TYPE> boolean adapts(Object object, Class<TYPE> type)
+ {
+ return adapt(object, type, true) != null;
+ }
+
public static <TYPE> TYPE adapt(Object object, Class<TYPE> type)
{
return adapt(object, type, true);
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java
index 87e15147e7..77f23f1b33 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java
@@ -21,7 +21,7 @@ import java.util.Set;
*/
public final class HashBag<T> implements Set<T>
{
- private Map<T, HashBag.Counter> map;
+ private Map<T, Counter> map;
public HashBag()
{
@@ -38,7 +38,7 @@ public final class HashBag<T> implements Set<T>
map = new HashMap<T, Counter>(initialCapacity);
}
- public HashBag(Map<? extends T, ? extends HashBag.Counter> m)
+ public HashBag(Map<? extends T, ? extends Counter> m)
{
map = new HashMap<T, Counter>(m);
}
@@ -67,7 +67,7 @@ public final class HashBag<T> implements Set<T>
*/
public boolean add(T o, int count)
{
- HashBag.Counter counter = map.get(o);
+ Counter counter = map.get(o);
if (counter == null)
{
counter = new Counter(count);
@@ -124,7 +124,7 @@ public final class HashBag<T> implements Set<T>
*/
public boolean remove(Object o, int count)
{
- HashBag.Counter counter = map.get(o);
+ Counter counter = map.get(o);
if (counter == null)
{
return false;

Back to the top