Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#617]User defined deserializer always should be used before standard… #619

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
444d929
[#617]User defined deserializer always should be used before standard…
api-from-the-ion Oct 7, 2023
170103e
[#617]Test for enum with registered adapter
api-from-the-ion Oct 8, 2023
8061172
[#616]Suggested solution for recognizing @JsonbProperty annotation on…
api-from-the-ion Oct 8, 2023
429bf76
[#617]Forgot the copyright
api-from-the-ion Oct 8, 2023
97f708f
[#617]Small refactoring of the creators
api-from-the-ion Oct 8, 2023
f0eff31
[#617]Extra copyright changes
api-from-the-ion Oct 12, 2023
819d38f
[#624]Tests for the deserializer as a lambda expression
api-from-the-ion Oct 12, 2023
2261231
[#617]Even more copyright changes
api-from-the-ion Oct 12, 2023
c63bdf6
[#617]Checkstyle chnages
api-from-the-ion Oct 12, 2023
526f98e
Merge branch 'eclipse-ee4j:master' into master
api-from-the-ion Oct 12, 2023
c92319f
[#617]And once again the copyright
api-from-the-ion Oct 12, 2023
efc574e
Revert "[#617]And once again the copyright"
api-from-the-ion Oct 12, 2023
87fce39
[#617]And once again the copyright
api-from-the-ion Oct 12, 2023
4e5a0a1
[#617]Put every call of JsonbBuilder.create in the tests into try-wit…
api-from-the-ion Oct 12, 2023
e5346b3
[#617]Made new tests public
api-from-the-ion Oct 13, 2023
d3e84ec
[#617]Warnings on static inner classes and interfaces removed
api-from-the-ion Oct 14, 2023
d54416c
[#617]Removed som not thrown Exceptions in the tests
api-from-the-ion Oct 14, 2023
9c1a95f
[#617]Less raw usage warnings
api-from-the-ion Oct 14, 2023
2e9bfe2
[#617]Small call and variable optimisation
api-from-the-ion Oct 15, 2023
6fb1442
[#617]Pattern Matching for instanceof removed - not before Java 16
api-from-the-ion Oct 15, 2023
062a161
[#617]Use defaultJsonb where JsonbBuilder.create() without configurat…
api-from-the-ion Oct 15, 2023
5703629
[#617]Pattern Matching for instanceof removed - not before Java 16
api-from-the-ion Oct 15, 2023
38e4808
[#620]Updated some of the Maven plugins and their corresponding confi…
api-from-the-ion Oct 23, 2023
d4c18ee
[#620]Setup and use Maven 3.9.5; maybe this is temporary
api-from-the-ion Oct 24, 2023
7915430
[#620]No need of --add-module for maven-javadoc-plugin:3.6.0
api-from-the-ion Oct 25, 2023
451246a
[#617]StringBuilder.isEmpty() only available since Java 15
api-from-the-ion Oct 25, 2023
d5f3bac
[#620]Corrected the errors because of new version of surefire plugin
api-from-the-ion Oct 27, 2023
ae4663c
[#620]Wrongfully optimised import
api-from-the-ion Oct 27, 2023
a8edee5
[#626]Corrected the tests to respect the current default locale
api-from-the-ion Oct 31, 2023
84f05f1
[#620]Reduced the number of the warning for the raw generic types usa…
api-from-the-ion Oct 31, 2023
f660a9f
[#620]Small Javadoc, type, import corrections. Rewrite one of Collect…
api-from-the-ion Nov 1, 2023
0a24b25
[#620]Used a "new" switch from Java 14 in CollectionsTest, corrected …
api-from-the-ion Nov 1, 2023
0584477
[#620]Stream.toList() only available from Java 16 on, replaced it in …
api-from-the-ion Nov 1, 2023
83af633
[#620]Stream.toList() only available from Java 16 on, replaced it in …
api-from-the-ion Nov 1, 2023
1cfc5b6
[#620]Use more isEmpty() in previous changeset.
api-from-the-ion Nov 1, 2023
57d2a81
[#620]Use try-with-resource in tests on JsoB creation.
api-from-the-ion Nov 1, 2023
c90d1aa
[#625]Wrote the missing methods in JsonStructureToParserAdapter and t…
api-from-the-ion Nov 4, 2023
2efa478
fixup! [#625]Wrote the missing methods in JsonStructureToParserAdapte…
api-from-the-ion Nov 4, 2023
40db71e
[#625]Replaced StreamSupport.stream() with Stream.iterate() in stream…
api-from-the-ion Nov 4, 2023
339043a
[#625]Forward JsonProvider to JsonStructureToParserAdapter so it can …
api-from-the-ion Nov 4, 2023
44c7b73
[#627]Corrected the introspectXXX methods in the ComponentMatcher to …
api-from-the-ion Nov 5, 2023
3c10922
[#627]More functional interfaces, less repeating code
api-from-the-ion Nov 5, 2023
e725088
[#627]First part of reducing "auto-closeable resource" warning during…
api-from-the-ion Nov 7, 2023
d5daea7
[#627]@Serial only available from Java 14 on
api-from-the-ion Nov 7, 2023
0d8db8e
[#627]Second part of reducing "auto-closeable resource" warning durin…
api-from-the-ion Nov 7, 2023
fe4afe0
[#627]Reduced Exception to IOException(which is really thrown here), …
api-from-the-ion Nov 8, 2023
a2966bb
[#627]Created default constructors, so we would have fewer warnings f…
api-from-the-ion Nov 8, 2023
0d25125
[#627]Created better way for Java 16 multi-release
api-from-the-ion Nov 8, 2023
029e5bc
[#627]Add missing serialVersionUID
api-from-the-ion Nov 8, 2023
2d875ef
[#627]SuppressWarnings on checks in Enum tests
api-from-the-ion Nov 8, 2023
ee22e55
[#627]Forgot the copyright
api-from-the-ion Nov 8, 2023
b5be735
[#627]Some missing deprications
api-from-the-ion Nov 8, 2023
795b5db
[#627]Test classes don't need to be public - fewer warnings about mod…
api-from-the-ion Nov 8, 2023
c4cd8d4
[#627]Made jakarta module requires transient, because they are requir…
api-from-the-ion Nov 8, 2023
375eb1f
[#627]Add suppress for fallthrough warning
api-from-the-ion Nov 8, 2023
ac9da78
[#630]Fixed the state and context de-synchronisation in the YassonPar…
api-from-the-ion Nov 13, 2023
ef0ccdd
[#630]Forgot one class
api-from-the-ion Nov 13, 2023
013237c
[#611]Implemented currenEvent() in YassonParser
api-from-the-ion Nov 13, 2023
e836734
[#630] Backport some changes and tests from Parson stream etc. implem…
api-from-the-ion Nov 24, 2023
b080c99
[#630] Correct static error; somehow works with Temurin ¯\_(ツ)_/¯
api-from-the-ion Nov 24, 2023
ef7da0a
[#617] Changed the year to meanwhile 2024; dependecies / plugins upda…
api-from-the-ion Feb 9, 2024
e6054b2
[#617] Refactored repeated code in SerializationModelCreator & Deseri…
api-from-the-ion Feb 12, 2024
fa1f4e1
[#617] Refactored repeated code in SerializationModelCreator & Deseri…
api-from-the-ion Feb 12, 2024
0574ee2
[#617] Refactored code with Optional - use more Optional API
api-from-the-ion Feb 12, 2024
d167fd7
[#617] More use of PropertyCustomization.Builder as builder
api-from-the-ion Feb 12, 2024
ceabcf0
[#617] Less unused code in AnnotationIntrospector & ReflectionUtils
api-from-the-ion Feb 12, 2024
49018c1
[#616] Extract the common part of the Enum De / Serializer and Adapte…
api-from-the-ion Feb 12, 2024
5ad157e
[#617] First corrections after review
api-from-the-ion Feb 13, 2024
d287108
[#617] Higher test coverage for DeserializationModelCreator and Deser…
api-from-the-ion Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2021, 2024 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -24,6 +24,10 @@ jobs:
java_version: [ 11, 17 ]

steps:
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Checkout for build
uses: actions/checkout@v2.3.4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.idea/
.settings/
/.DS_Store
/.sdkmanrc
4 changes: 2 additions & 2 deletions etc/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 2024 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -88,7 +88,7 @@
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="scope" value="protected"/>
<property name="accessModifiers" value="protected"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowMissingParamTags" value="true"/>
</module>
Expand Down
104 changes: 66 additions & 38 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2016, 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2016, 2024 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -34,11 +34,13 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jakarta.json.version>2.1.0</jakarta.json.version>
<jakarta.json.version>2.1.3</jakarta.json.version>
<parson.version>2.1.0</parson.version>
<jakarta.json.bind.version>3.0.0</jakarta.json.bind.version>
<jakarta.enterprise.cdi-api.version>4.0.1</jakarta.enterprise.cdi-api.version>
<netbeans.hint.jdkPlatform>JDK_9</netbeans.hint.jdkPlatform>
<junit.version>5.10.2</junit.version>
<maven.compiler.plugin.version>3.12.1</maven.compiler.plugin.version>
</properties>

<dependencyManagement>
Expand All @@ -51,7 +53,7 @@
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>5.0.0</version>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>jakarta.interceptor</groupId>
Expand All @@ -61,7 +63,7 @@
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand All @@ -81,7 +83,7 @@
<dependency>
<groupId>org.eclipse.parsson</groupId>
<artifactId>parsson</artifactId>
<version>1.1.0</version>
<version>1.1.5</version>
</dependency>
<!-- Test/Provided dependencies -->
<dependency>
Expand All @@ -93,19 +95,19 @@
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>5.0.0.Final</version>
<version>5.1.2.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.8.2</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -118,7 +120,7 @@

<organization>
<name>Oracle Corporation</name>
<url>http://www.oracle.com/</url>
<url>https://www.oracle.com/</url>
</organization>

<issueManagement>
Expand All @@ -139,13 +141,13 @@
<licenses>
<license>
<name>Eclipse Public License v. 2.0</name>
<url>http://www.eclipse.org/legal/epl-v20.html</url>
<url>https://www.eclipse.org/legal/epl-v20.html</url>
<distribution>repo</distribution>
<comments>Standard Eclipse License</comments>
</license>
<license>
<name>Eclipse Distribution License v. 1.0</name>
<url>http://www.eclipse.org/org/documents/edl-v10.php</url>
<url>https://www.eclipse.org/org/documents/edl-v10.php</url>
<distribution>repo</distribution>
<comments>Standard Eclipse Distribution License</comments>
</license>
Expand Down Expand Up @@ -259,19 +261,50 @@
</activation>
<build>
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<!-- execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/src/main/java16</source>
</sources>
</configuration>
</execution -->
Comment on lines +270 to +281
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be removed, if it is not needed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I addressed your approach of making the multi-release JAR, for java pre-16 and above. So the Java 16 sources are now included by plugin and not by manipulation of the compiler plugin configuration. This worked only for test classes but not for main classes; therefore I commended this part out.

The question is: would we like to get the multi-release somehow through some official / right way (there are some now)? Or should we forget it?

I don't think that you got multi-release JAR before, just the compilation and creation of the different JARs for different versions. So maybe this multi-release wasn't a goal anyway? And shouldn't be reached?

As about this comment - I can remove it independently of the decision about the above topic.


<execution>
<id>add-test-source</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/src/test/java</source>
<source>${project.basedir}/src/test/java16</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>${maven.compiler.plugin.version}</version>
<executions>
<execution>
<id>default-testCompile</id>
<configuration>
<release>16</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/test/java</compileSourceRoot>
<compileSourceRoot>${project.basedir}/src/test/java16</compileSourceRoot>
</compileSourceRoots>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -345,7 +378,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
Expand All @@ -364,12 +397,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>${maven.compiler.plugin.version}</version>
<executions>
<execution>
<id>default-compile</id>
Expand Down Expand Up @@ -413,7 +446,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
Expand All @@ -427,7 +460,7 @@
<!-- This plugin generates the buildNumber property used in maven-bundle-plugin -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<version>3.2.0</version>
<configuration>
<format>{0,date,MM/dd/yyyy hh:mm aa}</format>
<items>
Expand All @@ -446,14 +479,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.6.3</version>
<configuration>
<doctitle>Yasson</doctitle>
<sourcepath>${basedir}/src/main/java/org/eclipse/yasson</sourcepath>
<additionalJOptions>
<additionalJOption>--add-modules</additionalJOption>
<additionalJOption>jakarta.json.bind,jakarta.json</additionalJOption>
</additionalJOptions>
<source>11</source>
</configuration>
<executions>
Expand All @@ -468,7 +497,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -481,7 +510,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<version>5.1.9</version>
<executions>
<execution>
<id>osgi-bundle</id>
Expand Down Expand Up @@ -514,7 +543,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.2.5</version>
<executions>
<execution>
<id>default-test</id>
Expand Down Expand Up @@ -549,7 +578,7 @@
<configuration>
<argLine>
<!--java.management is required by Maven's ForkedBooter-->
--limit-modules java.base,java.logging,java.sql,jakarta.json.bind,jakarta.json,java.management,jdk.localedata
--limit-modules java.base,java.logging,java.sql,jakarta.json.bind,jakarta.json,java.management,jdk.localedata,org.eclipse.yasson,org.eclipse.parsson
</argLine>
<includes>
<include>**/JavaxNamingExcludedTest.class</include>
Expand All @@ -562,7 +591,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
Expand All @@ -577,7 +606,7 @@
<version>[11,)</version>
</requireJavaVersion>
<requireMavenVersion>
<version>[3.3.9,)</version>
<version>[3.9.6,)</version>
</requireMavenVersion>
<DependencyConvergence/>
</rules>
Expand All @@ -586,7 +615,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<version>3.5.0</version>
<executions>
<execution>
<id>add-resource</id>
Expand All @@ -612,11 +641,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.1</version>
<configuration>
<configLocation>etc/checkstyle.xml</configLocation>
<suppressionsLocation>etc/checkstyle-suppressions.xml</suppressionsLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
Expand All @@ -625,7 +653,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.29</version>
<version>10.13.0</version>
<exclusions>
<exclusion>
<groupId>com.sun</groupId>
Expand All @@ -638,7 +666,7 @@
<plugin>
<groupId>org.glassfish.copyright</groupId>
<artifactId>glassfish-copyright-maven-plugin</artifactId>
<version>2.3</version>
<version>2.4</version>
<configuration>
<templateFile>etc/copyright.txt</templateFile>
<excludeFile>etc/copyright-exclude.txt</excludeFile>
Expand Down Expand Up @@ -697,7 +725,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</plugin>
</plugins>
</reporting>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -14,8 +14,8 @@
* Eclipse implementation of the JSONB-API.
*/
module org.eclipse.yasson {
requires jakarta.json;
requires jakarta.json.bind;
requires transitive jakarta.json;
requires transitive jakarta.json.bind;
requires java.logging;
requires static java.xml;
requires static java.naming;
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/eclipse/yasson/FieldAccessStrategy.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -28,6 +28,10 @@
* when SecurityManager is turned on.</p>
*/
public class FieldAccessStrategy implements PropertyVisibilityStrategy {

FieldAccessStrategy() {
}

@Override
public boolean isVisible(Field field) {
return true;
Expand Down
Loading