Skip to content

Commit

Permalink
Javadoc issue fixes for 2.18 (partial)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 10, 2024
1 parent 9ab0c70 commit a0f55c9
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 9 deletions.
12 changes: 11 additions & 1 deletion src/main/java/com/fasterxml/jackson/core/JsonGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ protected JsonGenerator() { }
/**
* Get the constraints to apply when performing streaming writes.
*
* @return StreamWriteConstraints used by this generator
*
* @since 2.16
*/
public StreamWriteConstraints streamWriteConstraints() {
Expand Down Expand Up @@ -2717,11 +2719,13 @@ protected void _copyCurrentContents(JsonParser p) throws IOException
* {@link JsonParser#getNumberType()} for declared type and uses matching
* accessors: this may cause inexact conversion for some textual formats
* (depending on settings). If this is problematic, use
* {@lnik #_copyCurrentFloatValueExact} instead (note that doing so may add
* {@link #_copyCurrentFloatValueExact} instead (note that doing so may add
* overhead).
*
* @param p Parser that points to the value to copy
*
* @throws IOException exception thrown by write method called to copy value, if any
*
* @since 2.15
*/
protected void _copyCurrentFloatValue(JsonParser p) throws IOException
Expand All @@ -2748,6 +2752,8 @@ protected void _copyCurrentFloatValue(JsonParser p) throws IOException
*
* @param p Parser that points to the value to copy
*
* @throws IOException exception thrown by write method called to copy value, if any
*
* @since 2.15
*/
protected void _copyCurrentFloatValueExact(JsonParser p) throws IOException
Expand All @@ -2768,6 +2774,8 @@ protected void _copyCurrentFloatValueExact(JsonParser p) throws IOException
*
* @param p Parser that points to the value to copy
*
* @throws IOException exception thrown by write method called to copy value, if any
*
* @since 2.15
*/
protected void _copyCurrentIntValue(JsonParser p) throws IOException
Expand All @@ -2788,6 +2796,8 @@ protected void _copyCurrentIntValue(JsonParser p) throws IOException
*
* @param p Parser that points to the value to copy
*
* @throws IOException exception thrown by write method called to copy value, if any
*
* @since 2.15
*/
protected void _copyCurrentStringValue(JsonParser p) throws IOException
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,8 @@ protected BigInteger _convertBigDecimalToBigInteger(BigDecimal bigDec) throws IO
*
* @return {@link BigInteger} value of the current token
*
* @throws JsonParseException If parsing fails
*
* @since 2.14
*/
protected BigInteger _getBigInteger() throws JsonParseException {
Expand All @@ -1277,6 +1279,8 @@ protected BigInteger _getBigInteger() throws JsonParseException {
*
* @return {@link BigDecimal} value of the current token
*
* @throws JsonParseException If parsing fails
*
* @since 2.14
*/
protected BigDecimal _getBigDecimal() throws JsonParseException {
Expand All @@ -1303,6 +1307,8 @@ protected BigDecimal _getBigDecimal() throws JsonParseException {
*
* @return {@code double} value of the current token
*
* @throws JsonParseException If parsing fails
*
* @since 2.15
*/
protected double _getNumberDouble() throws JsonParseException {
Expand All @@ -1324,6 +1330,8 @@ protected double _getNumberDouble() throws JsonParseException {
*
* @return {@code float} value of the current token
*
* @throws JsonParseException If parsing fails
*
* @since 2.15
*/
protected float _getNumberFloat() throws JsonParseException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,12 @@ protected void _reportUnexpectedChar(int ch, String comment) throws JsonParseExc
*
* @param ch Character that was unexpected
* @param comment Additional failure comment to add, if any
* @param <T> Nominal type for bogus return value
*
* @throws JsonParseException
* @return Nothing, just declared to let caller use {@code return} when
* calling this method, to keep compiler happy.
*
* @throws JsonParseException constructed with {@link #_constructReadException(String, JsonLocation)}
*/
protected <T> T _reportUnexpectedNumberChar(int ch, String comment) throws JsonParseException {
String msg = String.format("Unexpected character (%s) in numeric value", _getCharDesc(ch));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public JsonPointerBasedFilter(JsonPointer pathToMatch, boolean includeAllElement
* @param includeAllElements Whether to just include all array elements
* of matching Array-valued path automatically
*
* @return Constructed filter
*
* @since 2.16
*/
protected JsonPointerBasedFilter construct(JsonPointer pathToMatch, boolean includeAllElements) {
Expand Down
17 changes: 11 additions & 6 deletions src/main/java/com/fasterxml/jackson/core/io/ContentReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ public class ContentReference
*/

/**
* @param isContentTextual Whether content is textual (not binary)
* @param rawContent Contents being referenced
*
* @deprecated Since 2.16. Use {@link #ContentReference(boolean, Object, ErrorReportConfiguration)} instead.
*/
@Deprecated
Expand All @@ -104,6 +107,11 @@ protected ContentReference(boolean isContentTextual, Object rawContent) {
}

/**
* @param isContentTextual Whether content is textual (not binary)
* @param rawContent Contents being referenced
* @param offset Offset of content within {@code rawContent}
* @param length Length of content within {@code rawContent}
*
* @deprecated Since 2.16. Use {@link #ContentReference(boolean, Object, int, int, ErrorReportConfiguration)} instead.
*/
@Deprecated
Expand All @@ -113,17 +121,14 @@ protected ContentReference(boolean isContentTextual, Object rawContent,
this(isContentTextual, rawContent, offset, length, ErrorReportConfiguration.defaults());
}

/**
* @since 2.16
*/

// @since 2.16
protected ContentReference(boolean isContentTextual, Object rawContent, ErrorReportConfiguration errorReportConfiguration)
{
this(isContentTextual, rawContent, -1, -1, errorReportConfiguration);
}

/**
* @since 2.16
*/
// @since 2.16
protected ContentReference(boolean isContentTextual, Object rawContent,
int offset, int length, ErrorReportConfiguration errorReportConfiguration)
{
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/fasterxml/jackson/core/io/IOContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ public IOContext(BufferRecycler br, Object rawContent, boolean managedResource)
* {@link #close()}: called when {@link #_bufferRecycler} life-cycle is
* externally managed.
*
* @return This context instance, for call chaining
*
* @since 2.17
*/
public IOContext markBufferRecyclerReleased() {
Expand All @@ -223,7 +225,7 @@ public IOContext markBufferRecyclerReleased() {
*/

/**
* @return constraints for streaming reads
* @return Constraints to use for streaming reads
* @since 2.15
*/
public StreamReadConstraints streamReadConstraints() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ public byte[] toByteArray()
* clear state; returns buffer(s) to {@link BufferRecycler} configured,
* if any, and returns output to caller.
*
* @return Content in byte array
*
* @since 2.17
*/
public byte[] getClearAndRelease()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void sourceReference() throws Exception
*/

@Test
@Deprecated
void recyclerPools() throws Exception
{
// First: shared/global pools that will always remain/become globally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void parserWithDequeuPool() throws Exception {
}

@Test
@Deprecated
void parserWithLockFreePool() throws Exception {
_testParser(JsonRecyclerPools.newLockFreePool(), 0, 1);
_testParser(JsonRecyclerPools.sharedLockFreePool(), null, null);
Expand Down Expand Up @@ -91,6 +92,7 @@ void generatorWithDequeuPool() throws Exception {
}

@Test
@Deprecated
void generatorWithLockFreePool() throws Exception {
_testGenerator(JsonRecyclerPools.newLockFreePool(), 0, 1);
_testGenerator(JsonRecyclerPools.sharedLockFreePool(), null, null);
Expand Down Expand Up @@ -149,6 +151,7 @@ void copyWithDequeuPool() throws Exception {
}

@Test
@Deprecated
void copyWithLockFreePool() throws Exception {
_testCopy(JsonRecyclerPools.newLockFreePool());
_testCopy(JsonRecyclerPools.sharedLockFreePool());
Expand Down
1 change: 1 addition & 0 deletions src/test/java/perf/RecyclerPoolTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private void _testWrite(JsonFactory jsonF) throws Exception
g.close();
}

@SuppressWarnings("deprecation")
public static void main(String[] args) throws Exception
{
RecyclerPoolTest test = new RecyclerPoolTest(THREAD_COUNT);
Expand Down

0 comments on commit a0f55c9

Please sign in to comment.