Browse Source

Warning fixes

Change-Id: Id774609449508bf01e53791c21de8c5d7c8f277c
Reviewed-on: http://gerrit.dmdirc.com/1871
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.7rc1
Chris Smith 13 years ago
parent
commit
fccaa6a54f
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/com/dmdirc/util/DoubleMap.java

+ 5
- 1
src/com/dmdirc/util/DoubleMap.java View File

33
 /**
33
 /**
34
  * An object that maps keys to values, and values back to keys. Currently
34
  * An object that maps keys to values, and values back to keys. Currently
35
  * does no checking for duplicates. Does not allow null values.
35
  * does no checking for duplicates. Does not allow null values.
36
+ * <p>Note that this implementation is NOT thread safe.
36
  *
37
  *
37
  * @param <A> The first type of data to be mapped
38
  * @param <A> The first type of data to be mapped
38
  * @param <B> The second type of data to be mapped
39
  * @param <B> The second type of data to be mapped
103
 
104
 
104
     /** {@inheritDoc} */
105
     /** {@inheritDoc} */
105
     @Override
106
     @Override
107
+    @SuppressWarnings("unchecked")
106
     public boolean containsKey(final Object key) {
108
     public boolean containsKey(final Object key) {
107
         return keys.contains((A) key);
109
         return keys.contains((A) key);
108
     }
110
     }
109
 
111
 
110
     /** {@inheritDoc} */
112
     /** {@inheritDoc} */
111
     @Override
113
     @Override
114
+    @SuppressWarnings("unchecked")
112
     public boolean containsValue(final Object value) {
115
     public boolean containsValue(final Object value) {
113
         return values.contains((B) value);
116
         return values.contains((B) value);
114
     }
117
     }
115
 
118
 
116
     /** {@inheritDoc} */
119
     /** {@inheritDoc} */
117
     @Override
120
     @Override
121
+    @SuppressWarnings("unchecked")
118
     public B get(final Object key) {
122
     public B get(final Object key) {
119
         return getValue((A) key);
123
         return getValue((A) key);
120
     }
124
     }
156
     public Set<Entry<A, B>> entrySet() {
160
     public Set<Entry<A, B>> entrySet() {
157
         final HashSet<Entry<A, B>> set = new HashSet<Entry<A, B>>();
161
         final HashSet<Entry<A, B>> set = new HashSet<Entry<A, B>>();
158
         for (A key : keys) {
162
         for (A key : keys) {
159
-            set.add(new SimpleEntry(key, getValue(key)));
163
+            set.add(new SimpleEntry<A, B>(key, getValue(key)));
160
         }
164
         }
161
         return set;
165
         return set;
162
     }
166
     }

Loading…
Cancel
Save