Skip to content

Commit aa8b4e0

Browse files
committed
Fix idea warnings.
1 parent b44dbe6 commit aa8b4e0

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

src/main/java/com/github/underscore/lodash/Base32.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
public final class Base32 {
3131

3232
private static final Charset UTF_8 = Charset.forName("UTF-8");
33-
private static final Base32 INSTANCE = new Base32("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef");
33+
private static final Base32 INSTANCE = new Base32();
3434

3535
private final char[] digits;
3636
private final int mask;
3737
private final int shift;
3838
private final Map<Character, Integer> charMap;
3939

40-
private Base32(final String alphabet) {
41-
digits = alphabet.toCharArray();
40+
private Base32() {
41+
digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef".toCharArray();
4242
mask = digits.length - 1;
4343
shift = Integer.numberOfTrailingZeros(digits.length);
4444
charMap = new HashMap<Character, Integer>();

src/main/java/com/github/underscore/lodash/U.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,15 +2117,15 @@ public static String formatXml(String xml) {
21172117
@SuppressWarnings("unchecked")
21182118
public static Map<String, Object> removeMinusesAndConvertNumbers(Map<String, Object> map) {
21192119
Map<String, Object> outMap = newLinkedHashMap();
2120-
for (String key : map.keySet()) {
2120+
for (Map.Entry<String, Object> entry : map.entrySet()) {
21212121
final String newKey;
2122-
if (key.startsWith("-")) {
2123-
newKey = key.substring(1);
2122+
if (entry.getKey().startsWith("-")) {
2123+
newKey = entry.getKey().substring(1);
21242124
} else {
2125-
newKey = key;
2125+
newKey = entry.getKey();
21262126
}
2127-
if (!key.equals("-self-closing") && !key.equals("#omit-xml-declaration")) {
2128-
outMap.put(newKey, makeObject(map.get(key)));
2127+
if (!entry.getKey().equals("-self-closing") && !entry.getKey().equals("#omit-xml-declaration")) {
2128+
outMap.put(newKey, makeObject(entry.getValue()));
21292129
}
21302130
}
21312131
return outMap;

src/test/java/com/github/underscore/FunctionsTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public Integer apply(final Integer n) {
112112
*/
113113

114114
@Test
115-
public void throttle() throws Exception {
115+
public void throttle() {
116116
final Integer[] counter = new Integer[] {0};
117117
Supplier<Void> incr = new Supplier<Void>() { public Void get() {
118118
counter[0]++; return null; } };
@@ -127,7 +127,7 @@ public Void get() {
127127
}
128128
}, 60);
129129
await().atMost(180, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
130-
public Boolean call() throws Exception {
130+
public Boolean call() {
131131
throttleIncr.get();
132132
return true;
133133
}
@@ -144,7 +144,7 @@ public Boolean call() throws Exception {
144144
*/
145145

146146
@Test
147-
public void debounce() throws Exception {
147+
public void debounce() {
148148
final Integer[] counter = new Integer[] {0};
149149
Supplier<Void> incr = new Supplier<Void>() { public Void get() {
150150
counter[0]++; return null; } };
@@ -159,7 +159,7 @@ public Void get() {
159159
}
160160
}, 60);
161161
await().atMost(120, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
162-
public Boolean call() throws Exception {
162+
public Boolean call() {
163163
return true;
164164
}
165165
});
@@ -170,7 +170,7 @@ public Boolean call() throws Exception {
170170
// Returns from the function before the alert runs.
171171
*/
172172
@Test
173-
public void defer() throws Exception {
173+
public void defer() {
174174
final Integer[] counter = new Integer[] {0};
175175
U.defer(new Supplier<Void>() { public Void get() {
176176
try {
@@ -181,7 +181,7 @@ public void defer() throws Exception {
181181
counter[0]++; return null; } });
182182
assertEquals("incr was debounced", 0, counter[0].intValue());
183183
await().atLeast(60, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
184-
public Boolean call() throws Exception {
184+
public Boolean call() {
185185
assertEquals("incr was debounced", 1, counter[0].intValue());
186186
return true;
187187
}
@@ -195,15 +195,15 @@ public Boolean call() throws Exception {
195195
// Application is only created once.
196196
*/
197197
@Test
198-
public void once() throws Exception {
198+
public void once() {
199199
final Integer[] counter = new Integer[] {0};
200200
Supplier<Integer> incr = new Supplier<Integer>() { public Integer get() {
201201
counter[0]++; return counter[0]; } };
202202
final Supplier<Integer> onceIncr = U.once(incr);
203203
onceIncr.get();
204204
onceIncr.get();
205205
await().atLeast(60, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
206-
public Boolean call() throws Exception {
206+
public Boolean call() {
207207
assertEquals("incr was called only once", 1, counter[0].intValue());
208208
assertEquals("stores a memo to the last value", 1, onceIncr.get().intValue());
209209
return true;
@@ -344,37 +344,37 @@ public void iteratee() {
344344
}
345345

346346
@Test
347-
public void setTimeout() throws Exception {
347+
public void setTimeout() {
348348
final Integer[] counter = new Integer[] {0};
349349
Supplier<Void> incr = new Supplier<Void>() { public Void get() {
350350
counter[0]++; return null; } };
351351
U.setTimeout(incr, 0);
352352
await().atLeast(40, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
353-
public Boolean call() throws Exception {
353+
public Boolean call() {
354354
assertEquals(1, counter[0].intValue());
355355
return true;
356356
}
357357
});
358358
}
359359

360360
@Test
361-
public void clearTimeout() throws Exception {
361+
public void clearTimeout() {
362362
final Integer[] counter = new Integer[] {0};
363363
Supplier<Void> incr = new Supplier<Void>() { public Void get() {
364364
counter[0]++; return null; } };
365365
java.util.concurrent.ScheduledFuture future = U.setTimeout(incr, 20);
366366
U.clearTimeout(future);
367367
U.clearTimeout(null);
368368
await().atLeast(40, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
369-
public Boolean call() throws Exception {
369+
public Boolean call() {
370370
assertEquals(0, counter[0].intValue());
371371
return true;
372372
}
373373
});
374374
}
375375

376376
@Test
377-
public void setInterval() throws Exception {
377+
public void setInterval() {
378378
final Integer[] counter = new Integer[] {0};
379379
Supplier<Void> incr = new Supplier<Void>() { public Void get() {
380380
if (counter[0] < 4) {
@@ -383,7 +383,7 @@ public void setInterval() throws Exception {
383383
return null; } };
384384
U.setInterval(incr, 10);
385385
await().atLeast(45, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
386-
public Boolean call() throws Exception {
386+
public Boolean call() {
387387
assertTrue("Counter is not in range [0, 4] " + counter[0],
388388
asList(0, 4).contains(counter[0]));
389389
return true;
@@ -392,15 +392,15 @@ public Boolean call() throws Exception {
392392
}
393393

394394
@Test
395-
public void clearInterval() throws Exception {
395+
public void clearInterval() {
396396
final Integer[] counter = new Integer[] {0};
397397
Supplier<Void> incr = new Supplier<Void>() { public Void get() {
398398
counter[0]++; return null; } };
399399
java.util.concurrent.ScheduledFuture future = U.setInterval(incr, 20);
400400
U.clearInterval(future);
401401
U.clearInterval(null);
402402
await().atLeast(40, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
403-
public Boolean call() throws Exception {
403+
public Boolean call() {
404404
assertEquals(0, counter[0].intValue());
405405
return true;
406406
}

src/test/java/com/github/underscore/lodash/StringTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3656,7 +3656,7 @@ public void toJsonJavaString() {
36563656
}
36573657

36583658
@Test
3659-
public void main() throws Exception {
3659+
public void main() {
36603660
U.main(new String[] {});
36613661
new U<String>(new ArrayList<String>());
36623662
new U<String>("");

0 commit comments

Comments
 (0)