Skip to content

Commit b565366

Browse files
committed
Minor clean up from #125
1 parent 62ac2e4 commit b565366

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

jr-annotation-support/src/main/java/com/fasterxml/jackson/jr/annotationsupport/AnnotationBasedIntrospector.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,9 @@ private static Set<String> _collectAliases(APropAccessor<?> acc, Set<String> col
664664
if (ann != null) {
665665
final String[] names = ann.value();
666666
if (collectedAliases == null) {
667-
collectedAliases = new HashSet<String>();
668-
}
669-
for (String alias : names) {
670-
collectedAliases.add(alias);
667+
collectedAliases = new HashSet<>();
671668
}
669+
collectedAliases.addAll(Arrays.asList(names));
672670
}
673671
}
674672
}

jr-objects/src/main/java/com/fasterxml/jackson/jr/type/TypeBindings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public final class TypeBindings
1414

1515
private final static String[] NO_STRINGS = new String[0];
1616

17-
private final static ResolvedType[] NO_TYPES = new ResolvedType[0];
17+
private final static ResolvedType[] NO_TYPES = ResolvedType.NO_TYPES;
1818

1919
private final static TypeBindings EMPTY = new TypeBindings(NO_STRINGS, NO_TYPES, null);
2020

jr-objects/src/main/java/com/fasterxml/jackson/jr/type/TypeResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class TypeResolver implements Serializable
2121
{
2222
private static final long serialVersionUID = 1L;
2323

24-
private final static ResolvedType[] NO_TYPES = new ResolvedType[0];
24+
private final static ResolvedType[] NO_TYPES = ResolvedType.NO_TYPES;
2525

2626
// // Pre-created instances
2727

jr-stree/src/main/java/com/fasterxml/jackson/jr/stree/JrsNumber.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ public BigDecimal asBigDecimal() throws IOException {
102102
return new BigDecimal((BigInteger) _value);
103103
}
104104
if ((_value instanceof Double) || (_value instanceof Float)) {
105-
return new BigDecimal(_value.doubleValue());
105+
return BigDecimal.valueOf(_value.doubleValue());
106106
}
107-
return new BigDecimal(_value.longValue());
107+
return BigDecimal.valueOf(_value.longValue());
108108
}
109109

110110
/*

jr-stree/src/main/java/com/fasterxml/jackson/jr/stree/JrsObject.java

-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ protected JrsValue _at(JsonPointer ptr) {
8787
*/
8888

8989
public Iterator<Map.Entry<String, JrsValue>> fields() {
90-
if (_values.isEmpty()) {
91-
return _values.entrySet().iterator();
92-
}
9390
return _values.entrySet().iterator();
9491
}
9592

0 commit comments

Comments
 (0)