@@ -84,7 +84,7 @@ public IntMap(int initialCapacity, float loadFactor) {
8484 public IntMap <T > clone (){
8585 try {
8686 IntMap <T > clone = (IntMap <T >) super .clone ();
87- Entry [] newTable = new Entry [ table .length ] ;
87+ Entry < T > [] newTable = newTable ( table .length ) ;
8888 for (int i = table .length - 1 ; i >= 0 ; i --){
8989 if (table [i ] != null )
9090 newTable [i ] = table [i ].clone ();
@@ -138,7 +138,6 @@ public boolean containsKey(int key) {
138138 return false ;
139139 }
140140
141- @ SuppressWarnings ("unchecked" )
142141 public T get (int key ) {
143142 int index = key & mask ;
144143 for (Entry <T > e = table [index ]; e != null ; e = e .next ){
@@ -149,7 +148,6 @@ public T get(int key) {
149148 return null ;
150149 }
151150
152- @ SuppressWarnings ("unchecked" )
153151 public T put (int key , T value ) {
154152 int index = key & mask ;
155153 // Check if key already exists.
@@ -161,7 +159,7 @@ public T put(int key, T value) {
161159 e .value = value ;
162160 return oldValue ;
163161 }
164- table [index ] = new Entry (key , value , table [index ]);
162+ table [index ] = new Entry <> (key , value , table [index ]);
165163 if (size ++ >= threshold ){
166164 // Rehash.
167165 int newCapacity = 2 * capacity ;
@@ -189,7 +187,6 @@ public T put(int key, T value) {
189187 return null ;
190188 }
191189
192- @ SuppressWarnings ("unchecked" )
193190 public T remove (int key ) {
194191 int index = key & mask ;
195192 Entry <T > prev = table [index ];
@@ -297,9 +294,9 @@ public void remove() {
297294 }
298295 }
299296
297+ @ SuppressWarnings ("unchecked" )
300298 private static <T > Entry <T >[] newTable (int size ) {
301- Entry <T >[] table = (Entry <T >[]) new Entry <?>[size ];
302- return table ;
299+ return (Entry <T >[]) new Entry <?>[size ];
303300 }
304301
305302 public static final class Entry <T > implements Cloneable , JmeCloneable {
0 commit comments