diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/base/pom.xml b/base/pom.xml index efe3551e..74303391 100644 --- a/base/pom.xml +++ b/base/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-providers - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT jackson-jaxrs-base Jackson-JAXRS-base diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/annotation/JacksonFeatures.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/annotation/JacksonFeatures.java index 4d9d420c..ae0fe3cf 100644 --- a/base/src/main/java/com/fasterxml/jackson/jaxrs/annotation/JacksonFeatures.java +++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/annotation/JacksonFeatures.java @@ -12,7 +12,7 @@ * Annotation that can be used enable and/or disable various * features for ObjectReaders and ObjectWriters. */ -@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.PARAMETER }) @Retention(RetentionPolicy.RUNTIME) @com.fasterxml.jackson.annotation.JacksonAnnotation public @interface JacksonFeatures diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java index 5a111b4c..9907b510 100644 --- a/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java +++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java @@ -60,10 +60,9 @@ public abstract class ProviderBase< // then some primitive types DEFAULT_UNTOUCHABLES.add(new ClassKey(char[].class)); - /* 27-Apr-2012, tatu: Ugh. As per - * [https://github.com/FasterXML/jackson-jaxrs-json-provider/issues/12] - * better revert this back, to make them untouchable again. - */ + // 27-Apr-2012, tatu: Ugh. As per + // [https://github.com/FasterXML/jackson-jaxrs-json-provider/issues/12] + // better revert this back, to make them untouchable again. DEFAULT_UNTOUCHABLES.add(new ClassKey(String.class)); DEFAULT_UNTOUCHABLES.add(new ClassKey(byte[].class)); } @@ -1058,7 +1057,7 @@ private final THIS _this() { */ private static NoContentExceptionSupplier _createNoContentExceptionSupplier() { try { - Class cls = Class.forName(CLASS_NAME_NO_CONTENT_EXCEPTION); + Class cls = Class.forName(CLASS_NAME_NO_CONTENT_EXCEPTION); Constructor ctor = cls.getDeclaredConstructor(String.class); if (ctor != null) { return new JaxRS2NoContentExceptionSupplier(); diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/AnnotationBundleKey.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/AnnotationBundleKey.java index a72d6093..0e0d6a76 100644 --- a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/AnnotationBundleKey.java +++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/AnnotationBundleKey.java @@ -122,10 +122,38 @@ private final boolean _equals(Annotation[] otherAnn) if (otherAnn.length != len) { return false; } - for (int i = 0; i < len; ++i) { - if (_annotations[i] != otherAnn[i]) { + + // 05-May-2019, tatu: If we wanted to true equality of contents we should + // do order-insensitive check; however, our use case is not unifying all + // possible permutations but rather trying to ensure that caching of same + // method signature is likely to match. So false negatives are acceptable + // over having to do order-insensitive comparison. + + switch (len) { + default: + for (int i = 0; i < len; ++i) { + if (!_annotations[i].equals(otherAnn[i])) { + return false; + } + } + return true; + + case 3: + if (!_annotations[2].equals(otherAnn[2])) { + return false; + } + // fall through + case 2: + if (!_annotations[1].equals(otherAnn[1])) { + return false; + } + // fall through + case 1: + if (!_annotations[0].equals(otherAnn[0])) { return false; } + // fall through + case 0: } return true; } diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java index df44a2fc..11375891 100644 --- a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java +++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java @@ -49,11 +49,6 @@ public abstract class EndpointConfigBase> protected EndpointConfigBase(MapperConfig config) { _config = config; } - - @Deprecated // since 2.6 - protected EndpointConfigBase() { - _config = null; - } @SuppressWarnings("unchecked") protected THIS add(Annotation[] annotations, boolean forWriting) diff --git a/base/src/test/java/com/fasterxml/jackson/jaxrs/base/BaseTestBase.java b/base/src/test/java/com/fasterxml/jackson/jaxrs/base/BaseTestBase.java new file mode 100644 index 00000000..27d770f9 --- /dev/null +++ b/base/src/test/java/com/fasterxml/jackson/jaxrs/base/BaseTestBase.java @@ -0,0 +1,7 @@ +package com.fasterxml.jackson.jaxrs.base; + +public abstract class BaseTestBase + extends junit.framework.TestCase +{ + // for now just placeholder +} diff --git a/base/src/test/java/com/fasterxml/jackson/jaxrs/base/cfg/AnnotationBundleKeyTest.java b/base/src/test/java/com/fasterxml/jackson/jaxrs/base/cfg/AnnotationBundleKeyTest.java new file mode 100644 index 00000000..8646d2b8 --- /dev/null +++ b/base/src/test/java/com/fasterxml/jackson/jaxrs/base/cfg/AnnotationBundleKeyTest.java @@ -0,0 +1,109 @@ +package com.fasterxml.jackson.jaxrs.base.cfg; + +import java.lang.annotation.Annotation; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.jaxrs.base.BaseTestBase; +import com.fasterxml.jackson.jaxrs.cfg.AnnotationBundleKey; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertNotEquals; + +// for [jaxrs-providers#111] +public class AnnotationBundleKeyTest + extends BaseTestBase +{ + // let's also test multiple annotation case + @JsonIgnoreProperties + @JsonPropertyOrder({ "a", "b" }) + @JsonSerialize + @JsonDeserialize + static class Helper { + @JsonCreator + public Helper(@JsonProperty("x") int x) { } + + @JsonValue + @JsonView(Object.class) + public int getX() { return 3; } + + // A "copy" of `getX` + @JsonValue + @JsonView(Object.class) + public int altX() { return 3; } + + @JsonPropertyOrder + @JsonView(Object.class) + public int notX() { return 4; } + + public void setX(@JsonProperty("x") int x) { } + } + + public void testWithClassAnnotations() throws Exception + { + _checkWith(Helper.class.getAnnotations(), Helper.class.getAnnotations()); + } + + public void testWithMethodAnnotationEquals() throws Exception + { + // First, same method parameters definitely should match + _checkWith(Helper.class.getDeclaredMethod("getX").getAnnotations(), + Helper.class.getDeclaredMethod("getX").getAnnotations()); + // but so should annotations from different method as long as + // same parameters are in same order + _checkWith(Helper.class.getDeclaredMethod("getX").getAnnotations(), + Helper.class.getDeclaredMethod("altX").getAnnotations()); + } + + public void testWithMethodAnnotationDifferent() throws Exception + { + // However: not so with actually differing annotations + _checkNotEqual(Helper.class.getDeclaredMethod("getX").getAnnotations(), + Helper.class.getDeclaredMethod("notX").getAnnotations()); + } + + public void testWithMethodParameterAnnotation() throws Exception + { + _checkWith(Helper.class.getDeclaredMethod("setX", Integer.TYPE).getParameterAnnotations()[0], + Helper.class.getDeclaredMethod("setX", Integer.TYPE).getParameterAnnotations()[0]); + } + + public void testWithConstructorAnnotation() throws Exception + { + _checkWith(Helper.class.getConstructor(Integer.TYPE).getAnnotations(), + Helper.class.getConstructor(Integer.TYPE).getAnnotations()); + } + + public void testWithConstructorParameterAnnotation() throws Exception + { + _checkWith(Helper.class.getConstructor(Integer.TYPE).getParameterAnnotations()[0], + Helper.class.getConstructor(Integer.TYPE).getParameterAnnotations()[0]); + } + + protected void _checkWith(Annotation[] anns1, Annotation[] anns2) { + // First, sanity check2 to know we passed non-empty annotations, same by equality + if (anns1.length == 0) { + fail("Internal error: empty annotation array"); + } + assertArrayEquals("Internal error: should never differ", anns1, anns2); + + AnnotationBundleKey b1 = new AnnotationBundleKey(anns1, Object.class); + AnnotationBundleKey b2 = new AnnotationBundleKey(anns2, Object.class); + + if (!b1.equals(b2) || !b2.equals(b1)) { + assertEquals(String.format("Implementations over %s backed annotations differ", anns1[0].getClass()), + b1, b2); + } + } + + protected void _checkNotEqual(Annotation[] anns1, Annotation[] anns2) { + AnnotationBundleKey b1 = new AnnotationBundleKey(anns1, Object.class); + AnnotationBundleKey b2 = new AnnotationBundleKey(anns2, Object.class); + + if (b1.equals(b2) || b2.equals(b1)) { + assertNotEquals(String.format("Implementations over %s backed annotations SHOULD differ but won't", anns1[0].getClass()), + b1, b2); + } + } +} diff --git a/cbor/pom.xml b/cbor/pom.xml index a024e797..2d0d1526 100644 --- a/cbor/pom.xml +++ b/cbor/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-providers - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT jackson-jaxrs-cbor-provider Jackson-JAXRS-CBOR diff --git a/datatypes/pom.xml b/datatypes/pom.xml index 00e62cbd..73f5a4a5 100644 --- a/datatypes/pom.xml +++ b/datatypes/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-providers - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT com.fasterxml.jackson.datatype diff --git a/json/pom.xml b/json/pom.xml index 88b8986a..605bae9d 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-providers - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT jackson-jaxrs-json-provider Jackson-JAXRS-JSON diff --git a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java index 95125092..b08f9be5 100644 --- a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java +++ b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java @@ -223,12 +223,4 @@ protected JsonEndpointConfig _configForWriting(ObjectWriter writer, return JsonEndpointConfig.forWriting(writer, annotations, _jsonpFunctionName); } - - /** - * @deprecated Since 2.2 use {@link #hasMatchingMediaType(MediaType)} instead - */ - @Deprecated - protected boolean isJsonType(MediaType mediaType) { - return hasMatchingMediaType(mediaType); - } } diff --git a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java index 6e7c4b5c..b353b46c 100644 --- a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java +++ b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java @@ -58,7 +58,6 @@ public static JsonEndpointConfig forWriting(ObjectWriter writer, /********************************************************** */ - @SuppressWarnings("deprecation") @Override protected void addAnnotation(Class type, Annotation annotation, boolean forWriting) @@ -67,15 +66,6 @@ protected void addAnnotation(Class type, if (forWriting) { _jsonp = new JSONP.Def((JSONP) annotation); } - } else if (type == com.fasterxml.jackson.jaxrs.json.annotation.JacksonFeatures.class) { - com.fasterxml.jackson.jaxrs.json.annotation.JacksonFeatures feats = (com.fasterxml.jackson.jaxrs.json.annotation.JacksonFeatures) annotation; - if (forWriting) { - _serEnable = nullIfEmpty(feats.serializationEnable()); - _serDisable = nullIfEmpty(feats.serializationDisable()); - } else { - _deserEnable = nullIfEmpty(feats.deserializationEnable()); - _deserDisable = nullIfEmpty(feats.deserializationDisable()); - } } else { super.addAnnotation(type, annotation, forWriting); } diff --git a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/annotation/JacksonFeatures.java b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/annotation/JacksonFeatures.java deleted file mode 100644 index f8013970..00000000 --- a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/annotation/JacksonFeatures.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.fasterxml.jackson.jaxrs.json.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * Annotation that can be used enable and/or disable various - * features for ObjectReaders and ObjectWriters. - * - * @deprecated Since 2.2, use shared {@link com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures} instead - */ -@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD }) -@Retention(RetentionPolicy.RUNTIME) -@com.fasterxml.jackson.annotation.JacksonAnnotation -@Deprecated // since 2.2 -public @interface JacksonFeatures -{ - /** - * Deserialization features to enable. - */ - public DeserializationFeature[] deserializationEnable() default { }; - - /** - * Deserialization features to disable. - */ - public DeserializationFeature[] deserializationDisable() default { }; - - /** - * Serialization features to enable. - */ - public SerializationFeature[] serializationEnable() default { }; - - /** - * Serialization features to disable. - */ - public SerializationFeature[] serializationDisable() default { }; -} diff --git a/json/src/test/java/com/fasterxml/jackson/jaxrs/json/util/TestAnnotationBundleKey.java b/json/src/test/java/com/fasterxml/jackson/jaxrs/json/util/TestAnnotationBundleKey.java index 488a6baa..4ed730b3 100644 --- a/json/src/test/java/com/fasterxml/jackson/jaxrs/json/util/TestAnnotationBundleKey.java +++ b/json/src/test/java/com/fasterxml/jackson/jaxrs/json/util/TestAnnotationBundleKey.java @@ -46,12 +46,12 @@ public void testKeys() throws Exception assertEquals(key1immutable, key1immutable); assertEquals(key1.hashCode(), key1dup.hashCode()); - - // then inequality by content (even though both have 1 JSONP annotation) - assertFalse(key1.equals(key2)); - assertFalse(key2.equals(key1)); - // but safe copy ought to be equal + // Fixed with [jaxrs-providers#111]: SHOULD be equal: + assertTrue(key1.equals(key2)); + assertTrue(key2.equals(key1)); + + // and safe copy ought to be equal assertTrue(key1.equals(key1dup)); // from same method assertTrue(key1dup.equals(key1)); assertTrue(key1.equals(key1immutable)); // and immutable variant diff --git a/pom.xml b/pom.xml index 29380ad1..a976c947 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ com.fasterxml.jackson jackson-base - 2.10.0-SNAPSHOT + 2.10.0 com.fasterxml.jackson.jaxrs jackson-jaxrs-providers Jackson JAX-RS - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT pom Parent for Jackson JAX-RS providers @@ -35,7 +35,8 @@ 2.25.1 - 9.4.12.v20180830 + + 9.4.17.v20190418 [2.0,2.2) @@ -44,9 +45,9 @@ - javax.xml.bind - jaxb-api - 2.3.0 + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.2 diff --git a/release-notes/CREDITS b/release-notes/CREDITS index c8393720..7468eb39 100644 --- a/release-notes/CREDITS +++ b/release-notes/CREDITS @@ -1,54 +1,8 @@ Here are people who have contributed to development Jackson JSON process -core component, version 2.x +core component, version 3.x (version numbers in brackets indicate release in which the problem was fixed) -(note: for older credits, check out release notes for 1.x versions) +(note: for older credits, check out release notes for 2.x versions) Tatu Saloranta, tatu.saloranta@iki.fi: author -Bill Burke: - -* Reported #11: ContextResolvers don't work for ObjectMapper due over-aggressive caching - (and provided samples that show how to fix it) - (2.2.2) - -Matt Bishop: - -* Reported #12: Missing OSGi imports - (2.2.2) - -Michael Brackx (brackxm@github.com) - -* Requested #19: Add `InputStream` as unwritable class - (2.2.3) - -Dain Sundstrom: -* Suggested #6: Add `JaxRSFeature.ADD_NO_SNIFF_HEADER` to automatically add - X-Content-Type-Options header (works with IE) - (2.2.3) - -Jonathan Haber (HiJon89@github): -* Contributed #61: Fix disabling of `JaxRSFeature` (was always enabling features) - (2.5.2) -* Reported #60: Problems with serialization of List of non-polymorphic values. - (2.6.0) - -rsprit@github: -* Reported #63, contributed fix: Support JAX-RS 2.0 in OSGi environment for Smile, - CBOR too - (2.5.4) - -M. Tarık Yurt (mtyurt@github) -* Contributed #68: Add YAML provider - (2.6.0) - -Nick Kleinschmidt (kleinsch@github) - -* Reported, contributed fix for #80: Non-JSON providers don't - support custom MIME types with extensions - (2.7.4) - -Tim Ward (timothyjward@github) - -* Contributed #93: Jackson OSGi metadata is incomplete - (2.8.5) diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x new file mode 100644 index 00000000..771f3328 --- /dev/null +++ b/release-notes/CREDITS-2.x @@ -0,0 +1,63 @@ +Here are people who have contributed to development Jackson JSON process +core component, version 2.x +(version numbers in brackets indicate release in which the problem was fixed) + +(note: for older credits, check out release notes for 1.x versions) + +Tatu Saloranta, tatu.saloranta@iki.fi: author + +Bill Burke: + +* Reported #11: ContextResolvers don't work for ObjectMapper due over-aggressive caching + (and provided samples that show how to fix it) + (2.2.2) + +Matt Bishop: + +* Reported #12: Missing OSGi imports + (2.2.2) + +Michael Brackx (brackxm@github.com) + +* Requested #19: Add `InputStream` as unwritable class + (2.2.3) + +Dain Sundstrom: +* Suggested #6: Add `JaxRSFeature.ADD_NO_SNIFF_HEADER` to automatically add + X-Content-Type-Options header (works with IE) + (2.2.3) + +Jonathan Haber (HiJon89@github): +* Contributed #61: Fix disabling of `JaxRSFeature` (was always enabling features) + (2.5.2) +* Reported #60: Problems with serialization of List of non-polymorphic values. + (2.6.0) + +rsprit@github: +* Reported #63, contributed fix: Support JAX-RS 2.0 in OSGi environment for Smile, + CBOR too + (2.5.4) + +M. Tarık Yurt (mtyurt@github) +* Contributed #68: Add YAML provider + (2.6.0) + +Nick Kleinschmidt (kleinsch@github) + +* Reported, contributed fix for #80: Non-JSON providers don't + support custom MIME types with extensions + (2.7.4) + +Tim Ward (timothyjward@github) + +* Contributed #93: Jackson OSGi metadata is incomplete + (2.8.5) + +John McCarthy (jvmccarthy@github) +* Reported #111: AnnotationBundleKey equality fails for Parameter Annotations + (2.10.0) + +Marius Lewerenz (mlewe@github) +* Reported #113: `@JacksonFeature` can't be used for deserialization (not + applicable to parameters) + (2.10.0) diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index f42251c2..997d7185 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -9,10 +9,21 @@ Sub-modules: === Releases === ------------------------------------------------------------------------ -2.10.0 (not yet released) +2.10.0 (26-Sep-2019) +#111: AnnotationBundleKey equality fails for Parameter Annotations + (reported by John M) +#113: `@JacksonFeature` can't be used for deserialization (not applicable to parameters) + (reported by Marius L) - Add JDK9+ `module-info` with Moditect plugin +- Update Woodstox dependency by XML provider +2.9.10 (21-Sep-2019) + +- Align Woodstox version XML provider uses to one used by `jackson-dataformat-xml`, + 5.3.0, with `stax2-api` 4.2 (was issue with 2.9.9) + +2.9.9 (16-May-2019) 2.9.8 (15-Dec-2018) 2.9.7 (19-Sep-2018) 2.9.6 (12-Jun-2018) diff --git a/smile/pom.xml b/smile/pom.xml index 53702800..f666b1ba 100644 --- a/smile/pom.xml +++ b/smile/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-providers - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT jackson-jaxrs-smile-provider Jackson-JAXRS-Smile diff --git a/xml/pom.xml b/xml/pom.xml index d64500c9..0d693d16 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-providers - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT jackson-jaxrs-xml-provider Jackson-JAXRS-XML @@ -50,17 +50,23 @@ stax2-api - - 3.1.4 + + 4.2 - org.codehaus.woodstox - woodstox-core-asl - 4.4.1 + com.fasterxml.woodstox + woodstox-core + 6.0.1 + + + javax.xml.stream + stax-api + + diff --git a/yaml/pom.xml b/yaml/pom.xml index 4f160d47..655ce13f 100644 --- a/yaml/pom.xml +++ b/yaml/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-providers - 2.10.0-SNAPSHOT + 2.10.1-SNAPSHOT jackson-jaxrs-yaml-provider Jackson-JAXRS-YAML diff --git a/yaml/src/test/java/com/fasterxml/jackson/jaxrs/yaml/TestCanSerialize.java b/yaml/src/test/java/com/fasterxml/jackson/jaxrs/yaml/TestCanSerialize.java index ce513000..d4781648 100644 --- a/yaml/src/test/java/com/fasterxml/jackson/jaxrs/yaml/TestCanSerialize.java +++ b/yaml/src/test/java/com/fasterxml/jackson/jaxrs/yaml/TestCanSerialize.java @@ -2,14 +2,12 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import java.io.IOException; import java.util.ArrayList; import java.util.List; -/** - * Unit test to check [JACKSON-540] - */ public class TestCanSerialize extends JaxrsTestBase { static class Simple { @@ -21,7 +19,7 @@ static class Simple { public void testCanSerialize() throws IOException { - ObjectMapper mapper = new ObjectMapper(); + ObjectMapper mapper = new YAMLMapper(); mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_ARRAY); // construct test object