[jackson-jaxrs-providers] 80/162: Implement #19, `InputStream` should be "unwritable"

Timo Aaltonen tjaalton at moszumanska.debian.org
Mon Sep 8 22:16:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

tjaalton pushed a commit to branch master
in repository jackson-jaxrs-providers.

commit d937b15166b91856da053760cbca2732ca5fc27c
Author: Tatu Saloranta <tatu.saloranta at iki.fi>
Date:   Tue Jul 23 22:20:28 2013 -0700

    Implement #19, `InputStream` should be "unwritable"
---
 .../java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java  | 12 +++++++-----
 release-notes/CREDITS                                        |  5 +++++
 release-notes/VERSION                                        |  2 ++
 3 files changed, 14 insertions(+), 5 deletions(-)

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 d0f58b2..73d128f 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
@@ -71,6 +71,7 @@ public abstract class ProviderBase<
      * (never try to serialize instances of these types).
      */
     public final static Class<?>[] DEFAULT_UNWRITABLES = new Class<?>[] {
+    	InputStream.class, // as per [Issue#19]
         OutputStream.class, Writer.class,
         StreamingOutput.class, Response.class
     };
@@ -387,10 +388,10 @@ public abstract class ProviderBase<
         if (!hasMatchingMediaType(mediaType)) {
             return false;
         }
-
         Boolean customUntouchable = _findCustomUntouchable(type);
-        if (customUntouchable == Boolean.TRUE) {
-            return false;
+        if (customUntouchable != null) {
+        	// negation: Boolean.TRUE means untouchable -> can not write
+        	return !customUntouchable.booleanValue();
         }
         if (customUntouchable == null) {
             /* Ok: looks like we must weed out some core types here; ones that
@@ -523,8 +524,9 @@ public abstract class ProviderBase<
         }
 
         Boolean customUntouchable = _findCustomUntouchable(type);
-        if (customUntouchable == Boolean.TRUE) {
-            return false;
+        if (customUntouchable != null) {
+        	// negation: Boolean.TRUE means untouchable -> can not write
+        	return !customUntouchable.booleanValue();
         }
         if (customUntouchable == null) {
             /* Ok: looks like we must weed out some core types here; ones that
diff --git a/release-notes/CREDITS b/release-notes/CREDITS
index fee6923..a54bdaa 100644
--- a/release-notes/CREDITS
+++ b/release-notes/CREDITS
@@ -16,3 +16,8 @@ Matt Bishop:
 
 * Reported #12: Missing OSGi imports
  (2.2.2)
+
+Michael Brackx (brackxm at github.com)
+
+* Requested #19: Add `InputStream` as unwritable class
+ (2.2.3)
diff --git a/release-notes/VERSION b/release-notes/VERSION
index 5041393..de7eb7c 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -8,6 +8,8 @@ Version: 2.2.3 (xx-xxx-2013)
 #12, #16: More OSGi manifest fixes
  (reported by 'logoff at github')
 #18: Add LICENSE, NOTICE files in artifacts
+#19: Add `InputStream` as unwritable class
+ (requested by Michael B)
 
 ------------------------------------------------------------------------
 === History: ===

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jackson-jaxrs-providers.git



More information about the pkg-java-commits mailing list