You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2014/12/24 01:04:57 UTC

tapestry-5 git commit: TAP5-2430: Throw an exception in the case that the content type is null.

Repository: tapestry-5
Updated Branches:
  refs/heads/master ea30dba85 -> 93fbe262a


TAP5-2430: Throw an exception in the case that the content type is null.


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/93fbe262
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/93fbe262
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/93fbe262

Branch: refs/heads/master
Commit: 93fbe262a7611599ac8e6b525dc019cbbfb662a1
Parents: ea30dba
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Dec 23 16:04:49 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Dec 23 16:04:49 2014 -0800

----------------------------------------------------------------------
 .../assets/CompressionAnalyzerImpl.java         | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/93fbe262/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/CompressionAnalyzerImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/CompressionAnalyzerImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/CompressionAnalyzerImpl.java
index bca9404..32acc5c 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/CompressionAnalyzerImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/CompressionAnalyzerImpl.java
@@ -1,15 +1,3 @@
-// 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.
-
 package org.apache.tapestry5.internal.services.assets;
 
 import java.util.Map;
@@ -27,7 +15,9 @@ public class CompressionAnalyzerImpl implements CompressionAnalyzer
 
     public boolean isCompressable(String contentType)
     {
-        assert contentType != null;
+        if (contentType == null) {
+            throw new IllegalStateException("Content type provided to CompressionAnalyzer is null, which is not allowed.");
+        }
 
         int x = contentType.indexOf(';');
 
@@ -36,7 +26,7 @@ public class CompressionAnalyzerImpl implements CompressionAnalyzer
         Boolean result = configuration.get(key);
 
         if (result != null) {
-            return result.booleanValue();
+            return result;
         }
 
         // Now look for a wild card.
@@ -47,6 +37,6 @@ public class CompressionAnalyzerImpl implements CompressionAnalyzer
 
         result = configuration.get(wildKey);
 
-        return result == null ? true : result.booleanValue();
+        return result == null ? true : result;
     }
 }