You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/20 18:03:19 UTC

svn commit: r1696813 - in /commons/proper/bcel/trunk: ./ src/main/java/org/apache/commons/bcel6/util/ src/main/java/org/apache/commons/bcel6/verifier/structurals/

Author: sebb
Date: Thu Aug 20 16:03:18 2015
New Revision: 1696813

URL: http://svn.apache.org/r1696813
Log:
Checkstyle

Modified:
    commons/proper/bcel/trunk/checkstyle.xml
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/Class2HTML.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/SyntheticRepository.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExecutionVisitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java

Modified: commons/proper/bcel/trunk/checkstyle.xml
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/checkstyle.xml?rev=1696813&r1=1696812&r2=1696813&view=diff
==============================================================================
--- commons/proper/bcel/trunk/checkstyle.xml (original)
+++ commons/proper/bcel/trunk/checkstyle.xml Thu Aug 20 16:03:18 2015
@@ -79,7 +79,7 @@ limitations under the License.
     <module name="TypeName"/>
      -->
     <!-- Checks for imports                              -->
-    <!-- See http://checkstyle.sf.net/config_import.html -->
+    <!-- See http://checkstyle.sf.net/config_imports.html -->
     <module name="AvoidStarImport"/>
     <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
     <module name="RedundantImport"/>
@@ -154,8 +154,8 @@ limitations under the License.
 
     <!-- Checks for class design                         -->
     <!-- See http://checkstyle.sf.net/config_design.html -->
-    <module name="FinalClass"/>
-    <module name="HideUtilityClassConstructor"/>
+    <!--module name="FinalClass"/-->
+    <!--module name="HideUtilityClassConstructor"/-->
     <module name="InterfaceIsType"/>
     <module name="VisibilityModifier">
         <property name="protectedAllowed" value="true"/>
@@ -168,7 +168,12 @@ limitations under the License.
     <!--module name="TodoComment"/-->
     <module name="UpperEll"/>
     
+    <!-- Required for SuppressionCommentFilter below -->
+    <module name="FileContentsHolder"/>
+
   </module>
 
+  <module name="SuppressionCommentFilter"/>
+
 </module>
 

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/Class2HTML.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/Class2HTML.java?rev=1696813&r1=1696812&r2=1696813&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/Class2HTML.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/Class2HTML.java Thu Aug 20 16:03:18 2015
@@ -179,28 +179,25 @@ public class Class2HTML {
 
     static String toHTML( String str ) {
         StringBuilder buf = new StringBuilder();
-        try { // Filter any characters HTML doesn't like such as < and > in particular
-            for (int i = 0; i < str.length(); i++) {
-                char ch;
-                switch (ch = str.charAt(i)) {
-                    case '<':
-                        buf.append("&lt;");
-                        break;
-                    case '>':
-                        buf.append("&gt;");
-                        break;
-                    case '\n':
-                        buf.append("\\n");
-                        break;
-                    case '\r':
-                        buf.append("\\r");
-                        break;
-                    default:
-                        buf.append(ch);
-                }
+        for (int i = 0; i < str.length(); i++) {
+            char ch;
+            switch (ch = str.charAt(i)) {
+                case '<':
+                    buf.append("&lt;");
+                    break;
+                case '>':
+                    buf.append("&gt;");
+                    break;
+                case '\n':
+                    buf.append("\\n");
+                    break;
+                case '\r':
+                    buf.append("\\r");
+                    break;
+                default:
+                    buf.append(ch);
             }
-        } catch (StringIndexOutOfBoundsException e) {
-        } // Never occurs
+        }
         return buf.toString();
     }
 

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/SyntheticRepository.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/SyntheticRepository.java?rev=1696813&r1=1696812&r2=1696813&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/SyntheticRepository.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/SyntheticRepository.java Thu Aug 20 16:03:18 2015
@@ -187,6 +187,7 @@ public class SyntheticRepository impleme
                 try {
                     is.close();
                 } catch (IOException e) {
+                    // ignored
                 }
             }
         }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExecutionVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExecutionVisitor.java?rev=1696813&r1=1696812&r2=1696813&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExecutionVisitor.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExecutionVisitor.java Thu Aug 20 16:03:18 2015
@@ -26,7 +26,9 @@ import org.apache.commons.bcel6.classfil
 import org.apache.commons.bcel6.classfile.ConstantInteger;
 import org.apache.commons.bcel6.classfile.ConstantLong;
 import org.apache.commons.bcel6.classfile.ConstantString;
+// CHECKSTYLE:OFF (there are lots of references!)
 import org.apache.commons.bcel6.generic.*;
+//CHECKSTYLE:ON
 
 /**
  * This Visitor class may be used for a type-based Java Virtual Machine

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java?rev=1696813&r1=1696812&r2=1696813&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java Thu Aug 20 16:03:18 2015
@@ -30,7 +30,9 @@ import org.apache.commons.bcel6.classfil
 import org.apache.commons.bcel6.classfile.ConstantString;
 import org.apache.commons.bcel6.classfile.Field;
 import org.apache.commons.bcel6.classfile.JavaClass;
+//CHECKSTYLE:OFF (there are lots of references!)
 import org.apache.commons.bcel6.generic.*;
+//CHECKSTYLE:ON
 import org.apache.commons.bcel6.verifier.VerificationResult;
 import org.apache.commons.bcel6.verifier.Verifier;
 import org.apache.commons.bcel6.verifier.VerifierFactory;

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java?rev=1696813&r1=1696812&r2=1696813&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java Thu Aug 20 16:03:18 2015
@@ -165,7 +165,7 @@ public class Subroutines{
          */
         @Override
         public InstructionHandle[] getEnteringJsrInstructions(){
-            if (this == TOPLEVEL) {
+            if (this == getTopLevel()) {
                 throw new AssertionViolatedException("getLeavingRET() called on top level pseudo-subroutine.");
             }
             InstructionHandle[] jsrs = new InstructionHandle[theJSRs.size()];
@@ -196,7 +196,7 @@ public class Subroutines{
          */
         @Override
         public InstructionHandle getLeavingRET(){
-            if (this == TOPLEVEL) {
+            if (this == getTopLevel()) {
                 throw new AssertionViolatedException("getLeavingRET() called on top level pseudo-subroutine.");
             }
             return theRET;
@@ -264,7 +264,7 @@ public class Subroutines{
         public int[] getAccessedLocalsIndices(){
             //TODO: Implement caching.
             Set<Integer> acc = new HashSet<>();
-            if (theRET == null && this != TOPLEVEL){
+            if (theRET == null && this != getTopLevel()){
                 throw new AssertionViolatedException("This subroutine object must be built up completely before calculating accessed locals.");
             }
             {
@@ -359,7 +359,9 @@ public class Subroutines{
      * it to distinguish between top level instructions and
      * unreachable instructions.
      */
-    public final Subroutine TOPLEVEL;
+    // CHECKSTYLE:OFF
+    public final Subroutine TOPLEVEL; // TODO can this be made private?
+    // CHECKSTYLE:ON
 
     /**
      * Constructor.