true
meaning that entry is untouchable,
+ * false
that is is not.
*/
- protected HashSet* NOTE: starting with version 2.2, general-purpose annotations * will be moved to a shared package, and this package will only diff --git a/json/src/test/java/com/fasterxml/jackson/jaxrs/json/TestUntouchables.java b/json/src/test/java/com/fasterxml/jackson/jaxrs/json/TestUntouchables.java index ab741bf8..9ed8012a 100644 --- a/json/src/test/java/com/fasterxml/jackson/jaxrs/json/TestUntouchables.java +++ b/json/src/test/java/com/fasterxml/jackson/jaxrs/json/TestUntouchables.java @@ -76,6 +76,25 @@ public void testCustomUntouchables() throws Exception new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); assertFalse(prov.isWriteable(HashSet.class, HashSet.class, new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); + + // But also allow removals... + prov.removeUntouchable(Collection.class); + assertTrue(prov.isReadable(ArrayList.class, ArrayList.class, + new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); + assertTrue(prov.isWriteable(HashSet.class, HashSet.class, + new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); + // which should even override default ones + + assertFalse(prov.isReadable(String.class, getClass(), + new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); + assertFalse(prov.isWriteable(String.class, HashSet.class, + new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); + prov.removeUntouchable(String.class); + assertTrue(prov.isReadable(String.class, getClass(), + new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); + assertTrue(prov.isWriteable(String.class, HashSet.class, + new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); + } } \ No newline at end of file diff --git a/release-notes/VERSION b/release-notes/VERSION index 98e71fe4..74870f7b 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -9,6 +9,7 @@ First multi-module release, to make release easier, share some boilerplate code. Changes: +#5: Add 'provider.removeUntouchable()' * Add Woodstox dependency (not just in 'test' scope) to try to avoid problems with users relying on SJSXP (such as 'extra' xmlns declarations)