Skip to content

Commit

Permalink
Code cleanup and dependency version bump (#551)
Browse files Browse the repository at this point in the history
Code cleanup and dependency version bump

Signed-off-by: David Kral <david.k.kral@oracle.com>
  • Loading branch information
Verdent committed Apr 28, 2022
1 parent 58b2d1e commit 0d907eb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 35 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/maven.yml
Expand Up @@ -44,9 +44,10 @@ jobs:
- name: Copyright
run: bash etc/copyright.sh
- name: Checkstyle
run: mvn -B -Pstaging checkstyle:checkstyle
run: mvn -B checkstyle:checkstyle
- name: Yasson install
run: mvn -U -C -Pstaging clean install -DskipTests
# run: mvn -U -C -Pstaging clean install -DskipTests
run: mvn -U -C clean install -DskipTests
- name: Set up JDK for tests
uses: actions/setup-java@v2
with:
Expand Down
39 changes: 29 additions & 10 deletions pom.xml
Expand Up @@ -36,11 +36,36 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jakarta.json.version>2.1.0</jakarta.json.version>
<parson.version>2.1.0</parson.version>
<jakarta.json.bind.version>3.0.0-RC1</jakarta.json.bind.version>
<jakarta.enterprise.cdi-api.version>4.0.0-RC2</jakarta.enterprise.cdi-api.version>
<jakarta.json.bind.version>3.0.0</jakarta.json.bind.version>
<jakarta.enterprise.cdi-api.version>4.0.0</jakarta.enterprise.cdi-api.version>
<netbeans.hint.jdkPlatform>JDK_9</netbeans.hint.jdkPlatform>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${jakarta.enterprise.cdi-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>5.0.0-RC1</version>
</dependency>
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Compile dependencies -->
<dependency>
Expand All @@ -62,21 +87,14 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${jakarta.enterprise.cdi-api.version}</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>5.0.0.Beta1</version>
<version>5.0.0.CR2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -94,6 +112,7 @@
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
21 changes: 0 additions & 21 deletions src/main/java/org/eclipse/yasson/YassonConfig.java
Expand Up @@ -52,11 +52,6 @@ public class YassonConfig extends JsonbConfig {
*/
public static final String FORCE_MAP_ARRAY_SERIALIZER_FOR_NULL_KEYS = "yasson.force-map-array-serializer-for-null-keys";

/**
* @see #withJsonbParametersRequired(boolean)
*/
public static final String JSONB_CREATOR_PARAMETERS_REQUIRED = "yasson.jsonb-creator-parameters-required";

/**
* @see #withTimeInMillisAsAString(boolean)
*/
Expand Down Expand Up @@ -132,22 +127,6 @@ public YassonConfig withForceMapArraySerializerForNullKeys(boolean value) {
return this;
}


/**
* {@link jakarta.json.bind.annotation.JsonbCreator} parameters are required to be optional since the spec 3.0.0.
* However, if it is needed to revert functionality as it used to be before, it is possible to use this switch
* which globally turns the requirement of the {@link jakarta.json.bind.annotation.JsonbCreator} parameters
* to be required.
*
* @param value whether to treat {@link jakarta.json.bind.annotation.JsonbCreator} parameters
* as required. Default value is {@code false}.
* @return This YassonConfig instance
*/
public YassonConfig withJsonbParametersRequired(boolean value) {
setProperty(JSONB_CREATOR_PARAMETERS_REQUIRED, value);
return this;
}

/**
* It is required to handle time millisecond format as a number. See
* {@link jakarta.json.bind.annotation.JsonbDateFormat#TIME_IN_MILLIS}. It is possible to override this and force
Expand Down
Expand Up @@ -189,9 +189,9 @@ private boolean initConfigFailOnUnknownProperties() {

private boolean initRequiredCreatorParameters() {
if (System.getProperty(JsonbConfig.CREATOR_PARAMETERS_REQUIRED) != null) {
return Boolean.parseBoolean(System.getProperty(YassonConfig.CREATOR_PARAMETERS_REQUIRED));
return Boolean.parseBoolean(System.getProperty(JsonbConfig.CREATOR_PARAMETERS_REQUIRED));
}
return getConfigProperty(YassonConfig.CREATOR_PARAMETERS_REQUIRED, Boolean.class, false);
return getConfigProperty(JsonbConfig.CREATOR_PARAMETERS_REQUIRED, Boolean.class, false);
}

private boolean initDateInMillisecondsAsString() {
Expand Down

0 comments on commit 0d907eb

Please sign in to comment.