You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@johnzon.apache.org by rm...@apache.org on 2022/11/14 10:23:34 UTC
[johnzon] branch master updated: fixes for Javadoc errors and some warnings (#95)
This is an automated email from the ASF dual-hosted git repository.
rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git
The following commit(s) were added to refs/heads/master by this push:
new e7418157 fixes for Javadoc errors and some warnings (#95)
e7418157 is described below
commit e7418157680f3fbd29fa7a5e79b269565d24f7fc
Author: Samael <si...@hotmail.com>
AuthorDate: Mon Nov 14 10:23:29 2022 +0000
fixes for Javadoc errors and some warnings (#95)
---
.../main/java/org/apache/johnzon/core/BufferStrategyFactory.java | 2 ++
johnzon-core/src/main/java/org/apache/johnzon/core/Buffered.java | 3 ++-
.../main/java/org/apache/johnzon/core/JsonStreamParserImpl.java | 1 +
.../src/main/java/org/apache/johnzon/core/util/ArrayUtil.java | 2 ++
.../src/main/java/org/apache/johnzon/mapper/Adapter.java | 8 +++++++-
.../src/main/java/org/apache/johnzon/mapper/Converter.java | 4 ++--
.../java/org/apache/johnzon/mapper/JohnzonDeduplicateObjects.java | 2 +-
7 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/johnzon-core/src/main/java/org/apache/johnzon/core/BufferStrategyFactory.java b/johnzon-core/src/main/java/org/apache/johnzon/core/BufferStrategyFactory.java
index 62556a57..dd092a53 100644
--- a/johnzon-core/src/main/java/org/apache/johnzon/core/BufferStrategyFactory.java
+++ b/johnzon-core/src/main/java/org/apache/johnzon/core/BufferStrategyFactory.java
@@ -51,6 +51,8 @@ public class BufferStrategyFactory {
*
* You can also pass in a fully qualified class name of a custom {@link BufferStrategy}.
*
+ * @param strategyName one of the supported BufferStrategies as per above
+ * @return an instance of the chosen BufferStrategy
* @throws IllegalArgumentException if the given strategyName does not resolve to a BufferStrategy.
*/
public static BufferStrategy valueOf(String strategyName) {
diff --git a/johnzon-core/src/main/java/org/apache/johnzon/core/Buffered.java b/johnzon-core/src/main/java/org/apache/johnzon/core/Buffered.java
index 40cabfb7..17f29f39 100644
--- a/johnzon-core/src/main/java/org/apache/johnzon/core/Buffered.java
+++ b/johnzon-core/src/main/java/org/apache/johnzon/core/Buffered.java
@@ -17,7 +17,7 @@
package org.apache.johnzon.core;
/**
- * A <tt>Buffered</tt> is a source or destination of data that is buffered
+ * A <code>Buffered</code> is a source or destination of data that is buffered
* before writing or reading. The bufferSize method allows all participants
* in the underlying stream to align on this buffer size for optimization.
*
@@ -31,6 +31,7 @@ public interface Buffered { // https://github.com/apache/johnzon/pull/84#discuss
/**
* The buffer size used by this stream while reading input or before writing
* output to the underlying stream.
+ * @return the size of the buffer
*/
int bufferSize();
}
diff --git a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java
index c511e0d4..c854069d 100644
--- a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java
+++ b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java
@@ -208,6 +208,7 @@ public class JsonStreamParserImpl extends JohnzonJsonParserImpl implements JsonC
}
/**
+ * @param currentLength length of the buffer
* @return the amount of bytes the current buffer should get extended with
*/
protected int getBufferExtends(int currentLength) {
diff --git a/johnzon-core/src/main/java/org/apache/johnzon/core/util/ArrayUtil.java b/johnzon-core/src/main/java/org/apache/johnzon/core/util/ArrayUtil.java
index 22904d31..b1942387 100644
--- a/johnzon-core/src/main/java/org/apache/johnzon/core/util/ArrayUtil.java
+++ b/johnzon-core/src/main/java/org/apache/johnzon/core/util/ArrayUtil.java
@@ -146,6 +146,8 @@ public final class ArrayUtil {
/**
* Take the given array object and fill a fresh Collection with it.
+ * @param array an array that is to be duplicated
+ * @return a new collection of the original array elements
* @throws IllegalArgumentException if the given value this is not an array.
*/
public static Collection<Object> newCollection(Object array) {
diff --git a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Adapter.java b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Adapter.java
index fd635492..abbd25c7 100644
--- a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Adapter.java
+++ b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Adapter.java
@@ -22,13 +22,14 @@ package org.apache.johnzon.mapper;
* An Adapter is similar to a {@link Converter}.
* The main difference is that a Converter always converts from/to a String.
* An adapter might e.g. convert to a Date or any other Object which will
- * then be json-ified.<p>
+ * then be json-ified.
*
* A small example which has a special Java type to internally represent dates.
* Let's call it {@code DateHolder}.
* Our {@code Mapper} should treat it as a {@code java.util.Date}.
* For doing so we create a {@code DateHolderAdapter} like the following example shows:
* <pre>
+ * {@code
* public static class DateHolderAdapter implements Adapter<DateHolder, Date> {
* @Override
* public DateHolder to(Date date) {
@@ -41,6 +42,7 @@ package org.apache.johnzon.mapper;
* return new Date(dateHolder.getDate());
* }
* }
+ * }
* </pre>
*
* Consider a POJO has a DateHolder.
@@ -53,11 +55,15 @@ package org.apache.johnzon.mapper;
public interface Adapter<POJO_TYPE, JSON_TYPE> extends MapperConverter {
/**
* Transfer JSONTYPE_TYPE from JSON to POJO as POJO_TYPE.
+ * @param b the JSON type
+ * @return the equivalent Java type
*/
POJO_TYPE to(JSON_TYPE b);
/**
* Take the POJO_TYPE object A from a POJO an convert it to JSON_TYPE which will be inserted into the JSON output.
+ * @param a the Java type
+ * @return the equivalent JSON type
*/
JSON_TYPE from(POJO_TYPE a);
}
diff --git a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Converter.java b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Converter.java
index 5fb2ef0d..9de6446d 100644
--- a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Converter.java
+++ b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Converter.java
@@ -26,13 +26,13 @@ import java.lang.reflect.Type;
*
* An example would be to convert joda LocalDate into Strings and back.
*
- * @param <T>
+ * @param <T> the Java type that needs to be converted
*/
public interface Converter<T> extends MapperConverter {
String toString(T instance);
T fromString(String text);
- // for generic converters it allows to explicitely provide the converted type (ex: enum converter)
+ // for generic converters it allows to explicitly provide the converted type (ex: enum converter)
// typically useful when generic type get resolved to a TypeVariable
interface TypeAccess {
Type type();
diff --git a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/JohnzonDeduplicateObjects.java b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/JohnzonDeduplicateObjects.java
index cf955965..bf73e9b1 100644
--- a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/JohnzonDeduplicateObjects.java
+++ b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/JohnzonDeduplicateObjects.java
@@ -30,7 +30,7 @@ import java.lang.annotation.Target;
* The feature only gets activated if this annotation is available
* on the root object to be serialised/deserialised.
*
- * @see MapperBuilder#setDeduplicateObjects(boolean)
+ * @see MapperBuilder#setDeduplicateObjects(Boolean)
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})