FasterXML / jackson-core

Compare a20040d ... +5 ... 11e3b21

Coverage Reach
json/UTF8StreamJsonParser.java json/async/NonBlockingUtf8JsonParserBase.java json/async/NonBlockingJsonParserBase.java json/async/NonBlockingByteBufferJsonParser.java json/async/NonBlockingByteArrayJsonParser.java json/ReaderBasedJsonParser.java json/UTF8DataInputJsonParser.java json/WriterBasedJsonGenerator.java json/UTF8JsonGenerator.java json/ByteSourceJsonBootstrapper.java json/JsonParserBase.java json/JsonFactory.java json/JsonWriteContext.java json/JsonFactoryBuilder.java json/JsonReadContext.java json/JsonGeneratorBase.java json/DupDetector.java json/JsonReadFeature.java json/JsonWriteFeature.java io/schubfach/DoubleToDecimal.java io/schubfach/FloatToDecimal.java io/schubfach/MathUtils.java io/NumberOutput.java io/JsonStringEncoder.java io/UTF8Writer.java io/NumberInput.java io/CharTypes.java io/ContentReference.java io/UTF32Reader.java io/BigDecimalParser.java io/SerializedString.java io/IOContext.java io/MergedStream.java io/SegmentedStringWriter.java io/BigIntegerParser.java io/DataOutputAsStream.java io/CharacterEscapes.java io/InputDecorator.java io/OutputDecorator.java sym/ByteQuadsCanonicalizer.java sym/BinaryNameMatcher.java sym/CharsToNameCanonicalizer.java sym/HashedMatcherBase.java sym/SimpleNameMatcher.java sym/PropertyNameMatcher.java util/TextBuffer.java util/JsonGeneratorDelegate.java util/DefaultPrettyPrinter.java util/ByteArrayBuilder.java util/JsonParserDelegate.java util/JsonParserSequence.java util/SimpleStreamWriteContext.java util/SimpleStreamReadContext.java util/DefaultIndenter.java util/BufferRecycler.java util/MinimalPrettyPrinter.java util/VersionUtil.java util/ThreadLocalBufferManager.java util/JacksonFeatureSet.java util/BufferRecyclers.java util/Separators.java util/InternCache.java util/JsonpCharacterEscapes.java util/Named.java util/Snapshottable.java filter/FilteringParserDelegate.java filter/FilteringGeneratorDelegate.java filter/TokenFilterContext.java filter/TokenFilter.java filter/JsonPointerBasedFilter.java base/ParserBase.java base/ParserMinimalBase.java base/GeneratorBase.java base/TextualTSFactory.java base/DecorableTSFactory.java base/BinaryTSFactory.java JsonPointer.java Base64Variant.java JsonGenerator.java TokenStreamFactory.java JsonLocation.java TSFBuilder.java exc/StreamReadException.java exc/StreamWriteException.java exc/WrappedIOException.java exc/InputCoercionException.java exc/UnexpectedEndOfInputException.java TokenStreamContext.java Version.java JsonToken.java JsonParser.java JacksonException.java StreamReadConstraints.java type/WritableTypeId.java type/TypeReference.java type/ResolvedType.java Base64Variants.java ObjectReadContext.java ObjectWriteContext.java StreamWriteFeature.java StreamReadFeature.java JsonEncoding.java StreamReadCapability.java StreamWriteCapability.java PrettyPrinter.java

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 84 of 205 files from the diff.
Other files ignored by Codecov
pom.xml has changed.

@@ -214,7 +214,7 @@
Loading
214 214
            ++_index;
215 215
            return (ix < 0) ? STATUS_OK_AS_IS : STATUS_OK_AFTER_COMMA;
216 216
        }
217 -
        
217 +
218 218
        // Nope, root context
219 219
        // No commas within root context, but need space
220 220
        ++_index;

@@ -22,8 +22,6 @@
Loading
22 22
23 23
package tools.jackson.core.io.schubfach;
24 24
25 -
import java.io.IOException;
26 -
27 25
import static tools.jackson.core.io.schubfach.MathUtils.flog10pow2;
28 26
import static tools.jackson.core.io.schubfach.MathUtils.flog10threeQuartersPow2;
29 27
import static tools.jackson.core.io.schubfach.MathUtils.flog2pow10;
@@ -107,10 +105,6 @@
Loading
107 105
    private static final int MINUS_INF = 4;
108 106
    private static final int NAN = 5;
109 107
110 -
    // For thread-safety, each thread gets its own instance of this class.
111 -
    private static final ThreadLocal<FloatToDecimal> threadLocal =
112 -
            ThreadLocal.withInitial(FloatToDecimal::new);
113 -
114 108
    /*
115 109
    Room for the longer of the forms
116 110
        -ddddd.dddd         H + 2 characters
@@ -123,9 +117,6 @@
Loading
123 117
    // Numerical results are created here...
124 118
    private final byte[] bytes = new byte[MAX_CHARS];
125 119
126 -
    // ... and copied here in appendTo()
127 -
    private final char[] chars = new char[MAX_CHARS];
128 -
129 120
    // Index into buf of rightmost valid character.
130 121
    private int index;
131 122
@@ -246,27 +237,7 @@
Loading
246 237
     * @return a string rendering of the argument.
247 238
     */
248 239
    public static String toString(float v) {
249 -
        return threadLocalInstance().toDecimalString(v);
250 -
    }
251 -
252 -
    /**
253 -
     * Appends the rendering of the {@code v} to {@code app}.
254 -
     *
255 -
     * <p>The outcome is the same as if {@code v} were first
256 -
     * {@link #toString(float) rendered} and the resulting string were then
257 -
     * {@link Appendable#append(CharSequence) appended} to {@code app}.
258 -
     *
259 -
     * @param v the {@code float} whose rendering is appended.
260 -
     * @param app the {@link Appendable} to append to.
261 -
     * @throws IOException If an I/O error occurs
262 -
     */
263 -
    public static Appendable appendTo(float v, Appendable app)
264 -
            throws IOException {
265 -
        return threadLocalInstance().appendDecimalTo(v, app);
266 -
    }
267 -
268 -
    private static FloatToDecimal threadLocalInstance() {
269 -
        return threadLocal.get();
240 +
        return new FloatToDecimal().toDecimalString(v);
270 241
    }
271 242
272 243
    private String toDecimalString(float v) {
@@ -280,31 +251,6 @@
Loading
280 251
        }
281 252
    }
282 253
283 -
    private Appendable appendDecimalTo(float v, Appendable app)
284 -
            throws IOException {
285 -
        switch (toDecimal(v)) {
286 -
            case NON_SPECIAL:
287 -
                for (int i = 0; i <= index; ++i) {
288 -
                    chars[i] = (char) bytes[i];
289 -
                }
290 -
                if (app instanceof StringBuilder) {
291 -
                    return ((StringBuilder) app).append(chars, 0, index + 1);
292 -
                }
293 -
                if (app instanceof StringBuffer) {
294 -
                    return ((StringBuffer) app).append(chars, 0, index + 1);
295 -
                }
296 -
                for (int i = 0; i <= index; ++i) {
297 -
                    app.append(chars[i]);
298 -
                }
299 -
                return app;
300 -
            case PLUS_ZERO: return app.append("0.0");
301 -
            case MINUS_ZERO: return app.append("-0.0");
302 -
            case PLUS_INF: return app.append("Infinity");
303 -
            case MINUS_INF: return app.append("-Infinity");
304 -
            default: return app.append("NaN");
305 -
        }
306 -
    }
307 -
308 254
    /*
309 255
    Returns
310 256
        PLUS_ZERO       iff v is 0.0

@@ -111,7 +111,7 @@
Loading
111 111
    /* Public API, byte buffers
112 112
    /**********************************************************
113 113
     */
114 -
    
114 +
115 115
    /**
116 116
     * @param ix One of <code>READ_IO_BUFFER</code> constants.
117 117
     *
@@ -142,7 +142,7 @@
Loading
142 142
    /* Public API, char buffers
143 143
    /**********************************************************
144 144
     */
145 -
    
145 +
146 146
    public final char[] allocCharBuffer(int ix) {
147 147
        return allocCharBuffer(ix, 0);
148 148
    }

@@ -123,7 +123,7 @@
Loading
123 123
     * Method for accessing simple type description of current context;
124 124
     * either ROOT (for root-level values), OBJECT (for Object property names and
125 125
     * values) or ARRAY (for elements of JSON Arrays)
126 -
     * 
126 +
     *
127 127
     * @return Type description String
128 128
     */
129 129
    public String typeDesc() {
@@ -179,7 +179,7 @@
Loading
179 179
        }
180 180
        return false;
181 181
    }
182 -
    
182 +
183 183
    /**
184 184
     * Method for accessing name associated with the current location.
185 185
     * Non-null for <code>PROPERTY_NAME</code> and value events that directly
@@ -200,7 +200,7 @@
Loading
200 200
     * it is only used by higher-level data-binding functionality.
201 201
     * The reason it is included here is that it can be stored and accessed hierarchically,
202 202
     * and gets passed through data-binding.
203 -
     * 
203 +
     *
204 204
     * @return Currently active value, if one has been assigned.
205 205
     */
206 206
    public Object currentValue() {

@@ -27,7 +27,7 @@
Loading
27 27
    /* Location/state information
28 28
    /**********************************************************************
29 29
     */
30 -
    
30 +
31 31
    /**
32 32
     * Name of the property of which value is to be parsed; only
33 33
     * used for OBJECT contexts
@@ -127,7 +127,7 @@
Loading
127 127
    /* State changes
128 128
    /**********************************************************************
129 129
     */
130 -
    
130 +
131 131
    public TokenFilter setPropertyName(String name) {
132 132
        _currentName = name;
133 133
        _needToHandleName = true;
@@ -274,7 +274,7 @@
Loading
274 274
        }
275 275
        return _parent;
276 276
    }
277 -
    
277 +
278 278
    public void skipParentChecks() {
279 279
        _filter = null;
280 280
        for (TokenFilterContext ctxt = _parent; ctxt != null; ctxt = ctxt._parent) {
@@ -334,7 +334,7 @@
Loading
334 334
        // should never occur but...
335 335
        return null;
336 336
    }
337 -
    
337 +
338 338
    // // // Internally used abstract methods
339 339
340 340
    protected void appendDesc(StringBuilder sb) {

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 2 files with coverage changes found.

Changes in src/main/java/tools/jackson/core/json/WriterBasedJsonGenerator.java
-2
+1
+1
Loading file...
Changes in src/main/java/tools/jackson/core/sym/ByteQuadsCanonicalizer.java
New
Loading file...
Files Complexity Coverage
src/main/java/tools/jackson/core -26.00% 67.12% 0.11% 72.74%
Project Totals (105 files) 67.12% 72.74%
Loading