garydgregory commented on code in PR #1131:
URL: https://github.com/apache/commons-lang/pull/1131#discussion_r1398043845
##########
src/test/java/org/apache/commons/lang3/EnumUtilsTest.java:
##########
@@ -354,8 +360,21 @@ public void test_getEnumMap() {
@Test
public void test_getEnumMap_keyFunction() {
final Map<Integer, Month> test = EnumUtils.getEnumMap(Month.class,
Month::getId);
- assertEquals("{1=JAN, 2=FEB, 3=MAR, 4=APR, 5=MAY, 6=JUN, 7=JUL, 8=AUG,
9=SEP, 10=OCT, 11=NOV, 12=DEC}", test.toString(),
- "getEnumMap not created correctly");
+ final Map<Integer, Month> expected = new HashMap() {{
+ put(1, Month.JAN);
Review Comment:
Use normal code, please. This notation will generate compiler warnings since
the diamond notation can't be used.
```
final Map<Integer, Month> expected = new HashMap<>();
expected.put(1, Month.JAN);
...
```
##########
src/test/java/org/apache/commons/lang3/EnumUtilsTest.java:
##########
@@ -29,6 +29,7 @@
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
+import java.util.HashMap;
Review Comment:
Please run `mvn` locally before pushing to catch build errors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]