소스 검색

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 년 전
부모
커밋
fccaa6a54f
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5
    1
      src/com/dmdirc/util/DoubleMap.java

+ 5
- 1
src/com/dmdirc/util/DoubleMap.java 파일 보기

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

Loading…
취소
저장