Author: markt
Date: Tue Mar 15 13:23:13 2011
New Revision: 1081771

URL: http://svn.apache.org/viewvc?rev=1081771&view=rev
Log:
Fix a couple of FindBBugs warnings

Modified:
    tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
    tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
    tomcat/trunk/res/findbugs/filter-false-positives.xml

Modified: tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties?rev=1081771&r1=1081770&r2=1081771&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties Tue 
Mar 15 13:23:13 2011
@@ -483,3 +483,5 @@ jsp.message.jsp_queue_update=Updating JS
 jsp.message.jsp_removed_excess=Removing excess JSP for path [{0}] from queue 
of context [{1}]
 jsp.message.jsp_removed_idle=Removing idle JSP for path [{0}] in context [{1}] 
after {2} seconds");
 jsp.message.jsp_unload_check=Checking JSPs for unload in context [{0}], JSP 
count: {1} queue length: {2}
+
+xmlParser.skipBomFail=Failed to skip BOM when parsing XML input stream
\ No newline at end of file

Modified: tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java?rev=1081771&r1=1081770&r2=1081771&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java Tue 
Mar 15 13:23:13 2011
@@ -37,6 +37,7 @@ import org.apache.jasper.JasperException
 import org.apache.jasper.JspCompilationContext;
 import org.apache.jasper.compiler.ErrorDispatcher;
 import org.apache.jasper.compiler.JspUtil;
+import org.apache.jasper.compiler.Localizer;
 
 public class XMLEncodingDetector {
     
@@ -170,7 +171,11 @@ public class XMLEncodingDetector {
                     int b2 = b4[2] & 0xFF;
                     if (b0 == 0xEF && b1 == 0xBB && b2 == 0xBF) {
                         // ignore first three bytes...
-                        stream.skip(3);
+                        long skipped = stream.skip(3);
+                        if (skipped != 3) {
+                            throw new IOException(Localizer.getMessage(
+                                    "xmlParser.skipBomFail"));
+                        }
                     }
                 }
                 reader = createReader(stream, encoding, isBigEndian);

Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1081771&r1=1081770&r2=1081771&view=diff
==============================================================================
--- tomcat/trunk/res/findbugs/filter-false-positives.xml (original)
+++ tomcat/trunk/res/findbugs/filter-false-positives.xml Tue Mar 15 13:23:13 
2011
@@ -212,6 +212,12 @@
   <Match>
     <Class name="org.apache.el.parser.ParseException" />
   </Match>
+  <Match>
+    <!-- fCurrentEntity may be null after endEntity() call -->
+    <Class name="org.apache.jasper.xmlparser.XMLEncodingDetector" />
+    <Method name="load" />
+    <Bug code="RCN" />
+  </Match>
 
   <!-- Test code -->
   <Match>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to