Skip to content

Commit 17309d5

Browse files
committed
Fix codacy warnings, update copyright years.
1 parent b79e7e7 commit 17309d5

File tree

11 files changed

+43
-20
lines changed

11 files changed

+43
-20
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -491,9 +491,8 @@ public boolean test(String arg) {
491491
}, "b").toString());
492492
assertEquals("[a, aa, cc, ccc]", new U<String>(asList("a", "aa", "cc", "ccc")).replace(
493493
null, "b").toString());
494-
Set<Integer> set = new HashSet<Integer>() { {
495-
addAll(U.range(7));
496-
} };
494+
Set<Integer> set = new HashSet<Integer>();
495+
set.addAll(U.range(7));
497496
assertEquals("[0, 1, 2, 100, 100, 100, 100]", U.chain(set).replace(
498497
new Predicate<Integer>() {
499498
@Override
@@ -529,9 +528,13 @@ public boolean test(int i, String arg) {
529528
}, "f").toString());
530529
assertEquals("[a, aa, cc, ccc]", new U<String>(asList("a", "aa", "cc", "ccc")).replaceIndexed(
531530
null, "b").toString());
532-
List<Integer> list = new ArrayList<Integer>() { {
533-
add(100); add(22); add(88); add(6530); add(-25); add(-1000);
534-
} };
531+
List<Integer> list = new ArrayList<Integer>();
532+
list.add(100);
533+
list.add(22);
534+
list.add(88);
535+
list.add(6530);
536+
list.add(-25);
537+
list.add(-1000);
535538
assertEquals("[100, 0, 88, 6530, 0, -1000]", U.chain(list).replaceIndexed(
536539
new PredicateIndexed<Integer>() {
537540
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright 2015-2018 Valentyn Kolesnikov
4+
* Copyright 2015-2019 Valentyn Kolesnikov
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -57,6 +57,10 @@ public Byte apply(final Byte item) {
5757
});
5858
assertNull(resultFunc2);
5959
assertEquals("2.0", result.toString());
60+
}
61+
62+
@Test
63+
public void average2() {
6064
final Double result2 = U.average(asList((double) 1, (double) 2, (double) 3));
6165
assertEquals("2.0", result2.toString());
6266
final Double result3 = U.average(asList((float) 1, (float) 2, (float) 3));
@@ -73,6 +77,10 @@ public Byte apply(final Byte item) {
7377
assertEquals("2.0", result8.toString());
7478
final Double result9 = U.average(asList((Integer) null));
7579
assertNull(result9);
80+
}
81+
82+
@Test
83+
public void average3() {
7684
final Double result10 = U.average(asList(1, (Integer) null));
7785
assertEquals("0.5", result10.toString());
7886
final Double result11 = U.average(asList((double) 0.2, (double) 0.1, Math.PI));
@@ -94,6 +102,10 @@ public Byte apply(final Byte item) {
94102
final Double result19 = U.average(new BigInteger[] {BigInteger.valueOf(1), BigInteger.valueOf(2),
95103
BigInteger.valueOf(3)});
96104
assertEquals("2.0", result19.toString());
105+
}
106+
107+
@Test
108+
public void average4() {
97109
final Double result20 = U.average(new BigDecimal[] {BigDecimal.valueOf(1), BigDecimal.valueOf(2),
98110
BigDecimal.valueOf(3)});
99111
assertEquals("2.0", result20.toString());
@@ -113,6 +125,10 @@ public Byte apply(final Byte item) {
113125
assertNull(result27);
114126
final Double result28 = U.average(null, (byte) 1);
115127
assertNull(result28);
128+
}
129+
130+
@Test
131+
public void average5() {
116132
final Double result29 = U.average((byte) 2, (byte) 4);
117133
assertEquals("3.0", result29.toString());
118134
final Double result30 = U.average(Double.valueOf(2), null);
@@ -129,6 +145,10 @@ public Byte apply(final Byte item) {
129145
assertEquals("3.0", result35.toString());
130146
final Double result36 = U.average(Integer.valueOf(2), null);
131147
assertNull(result36);
148+
}
149+
150+
@Test
151+
public void average6() {
132152
final Double result37 = U.average(null, Integer.valueOf(2));
133153
assertNull(result37);
134154
final Double result38 = U.average(Integer.valueOf(2), Integer.valueOf(4));
@@ -140,7 +160,7 @@ public Byte apply(final Byte item) {
140160
final Double result41 = U.average(Long.valueOf(2), Long.valueOf(4));
141161
assertEquals("3.0", result41.toString());
142162
final Double result42 = U.average(Long.valueOf(2), Long.valueOf(4));
143-
assertEquals("3.0", result41.toString());
163+
assertEquals("3.0", result42.toString());
144164
final Double result43 = U.average(new Integer[] {(Integer) null});
145165
assertNull(result43);
146166
}
@@ -269,8 +289,8 @@ public void subtract() {
269289
assertEquals("-1", U.subtract(Long.valueOf(1), Long.valueOf(2)).toString());
270290
assertEquals("-1.0", U.subtract(Float.valueOf(1), Float.valueOf(2)).toString());
271291
assertEquals("-1.0", U.subtract(Double.valueOf(1), Double.valueOf(2)).toString());
272-
assertEquals("-1", U.subtract(java.math.BigDecimal.valueOf(1), java.math.BigDecimal.valueOf(2)).toString());
273-
assertEquals("-1", U.subtract(java.math.BigInteger.valueOf(1), java.math.BigInteger.valueOf(2)).toString());
292+
assertEquals("-1", U.subtract(BigDecimal.valueOf(1), BigDecimal.valueOf(2)).toString());
293+
assertEquals("-1", U.subtract(BigInteger.valueOf(1), BigInteger.valueOf(2)).toString());
274294
assertEquals("-1", U.subtract((Number) 1, (Number) 2).toString());
275295
assertEquals("-4", U.subtract((int) 1, (int) 2, (int) 3).toString());
276296
assertEquals("1", U.subtract((int) 1).toString());

0 commit comments

Comments
 (0)