diff options
author | Tatu Saloranta <tatu.saloranta@iki.fi> | 2020-07-15 20:16:02 -0700 |
---|---|---|
committer | Tatu Saloranta <tatu.saloranta@iki.fi> | 2020-07-15 20:16:02 -0700 |
commit | 3f8af34b296f2894931bbab0f31e890272b6ec29 (patch) | |
tree | 33455936aa70e6046bb7bed294e9cb8db9bd6318 /src | |
parent | 62eac5392daa3dd5ff6d781262e23413801a9d12 (diff) | |
download | jackson-databind-3f8af34b296f2894931bbab0f31e890272b6ec29.tar.gz |
Javadoc/comment improvements
Diffstat (limited to 'src')
3 files changed, 24 insertions, 4 deletions
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java index 2a9308c4f..a3255d3a1 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java @@ -1518,6 +1518,9 @@ inputDesc, _coercedTypeDesc()); /** * Helper method to check whether given text refers to what looks like a clean simple * integer number, consisting of optional sign followed by a sequence of digits. + *<p> + * Note that definition is quite loose as leading zeroes are allowed, in addition + * to plus sign (not just minus). */ protected final boolean _isIntNumber(String text) { @@ -1525,7 +1528,17 @@ inputDesc, _coercedTypeDesc()); if (len > 0) { char c = text.charAt(0); // skip leading sign (plus not allowed for strict JSON numbers but...) - int i = (c == '-' || c == '+') ? 1 : 0; + int i; + + if (c == '-' || c == '+') { + if (len == 1) { + return false; + } + i = 1; + } else { + i = 0; + } + // We will allow leading for (; i < len; ++i) { int ch = text.charAt(i); if (ch > '9' || ch < '0') { diff --git a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java index 0e2ef9ccd..8d8df7588 100644 --- a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java +++ b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java @@ -698,6 +698,14 @@ public class TypeFactory // note: was final in 2.9, removed from 2.10 return _fromAny(null, type, EMPTY_BINDINGS); } + /** + * Method that you very likely should NOT be using -- you need to know a lot + * about internal details of {@link TypeBindings} and even then it will probably + * not do what you want. + * Usually you would instead want to call one of {@code constructXxxType()} + * methods (where {@code Xxx} would be "Array", "Collection[Like]", "Map[Like]" + * or "Parametric"). + */ public JavaType constructType(Type type, TypeBindings bindings) { return _fromAny(null, type, bindings); } diff --git a/src/main/java/com/fasterxml/jackson/databind/util/StdDateFormat.java b/src/main/java/com/fasterxml/jackson/databind/util/StdDateFormat.java index 84a7feee3..3f6577ebe 100644 --- a/src/main/java/com/fasterxml/jackson/databind/util/StdDateFormat.java +++ b/src/main/java/com/fasterxml/jackson/databind/util/StdDateFormat.java @@ -306,9 +306,8 @@ public class StdDateFormat @Override public void setTimeZone(TimeZone tz) { - /* DateFormats are timezone-specific (via Calendar contained), - * so need to reset instances if timezone changes: - */ + // DateFormats are timezone-specific (via Calendar contained), + // so need to reset instances if timezone changes: if (!tz.equals(_timezone)) { _clearFormats(); _timezone = tz; |