commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1696942 - in /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6: classfile/ generic/ util/
Date Fri, 21 Aug 2015 11:30:55 GMT
Author: sebb
Date: Fri Aug 21 11:30:55 2015
New Revision: 1696942

URL: http://svn.apache.org/r1696942
Log:
Ignore some numbers that are not magic

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Code.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantUtf8.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/AnnotationEntryGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/CodeHTML.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Code.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Code.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Code.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Code.java Fri
Aug 21 11:30:55 2015
@@ -300,7 +300,7 @@ public final class Code extends Attribut
      * @return String representation of code chunk.
      */
     public final String toString( boolean verbose ) {
-        StringBuilder buf = new StringBuilder(100);
+        StringBuilder buf = new StringBuilder(100); // CHECKSTYLE IGNORE MagicNumber
         buf.append("Code(max_stack = ").append(max_stack).append(", max_locals = ").append(
                 max_locals).append(", code_length = ").append(code.length).append(")\n").append(
                 Utility.codeToString(code, super.getConstantPool(), 0, -1, verbose));

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantUtf8.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantUtf8.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantUtf8.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantUtf8.java
Fri Aug 21 11:30:55 2015
@@ -44,7 +44,8 @@ public final class ConstantUtf8 extends
     private static volatile int created = 0;
 
     // Set the size to 0 or below to skip caching entirely
-    private static final int MAX_CACHED_SIZE = Integer.getInteger("bcel.maxcached.size",
200).intValue();
+    private static final int MAX_CACHED_SIZE =
+            Integer.getInteger("bcel.maxcached.size", 200).intValue();// CHECKSTYLE IGNORE
MagicNumber
     private static final boolean BCEL_STATISTICS = Boolean.getBoolean("bcel.statistics");
 
 

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java
Fri Aug 21 11:30:55 2015
@@ -126,7 +126,7 @@ public final class Field extends FieldOr
         access = access.equals("") ? "" : (access + " ");
         signature = Utility.signatureToString(getSignature());
         name = getName();
-        StringBuilder buf = new StringBuilder(64);
+        StringBuilder buf = new StringBuilder(64); // CHECKSTYLE IGNORE MagicNumber
         buf.append(access).append(signature).append(" ").append(name);
         ConstantValue cv = getConstantValue();
         if (cv != null) {

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java
Fri Aug 21 11:30:55 2015
@@ -34,6 +34,7 @@ import org.apache.commons.bcel6.Constant
  */
 public final class LineNumberTable extends Attribute {
 
+    private static final int MAX_LINE_LENGTH = 72;
     private LineNumber[] line_number_table; // Table of line/numbers pairs
 
 
@@ -136,7 +137,7 @@ public final class LineNumberTable exten
             if (i < line_number_table.length - 1) {
                 line.append(", ");
             }
-            if ((line.length() > 72) && (i < line_number_table.length - 1))
{
+            if ((line.length() > MAX_LINE_LENGTH) && (i < line_number_table.length
- 1)) {
                 line.append(newLine);
                 buf.append(line.toString());
                 line.setLength(0);

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
Fri Aug 21 11:30:55 2015
@@ -146,7 +146,7 @@ public abstract class Utility {
      */
     public static String codeToString( byte[] code, ConstantPool constant_pool, int index,
             int length, boolean verbose ) {
-        StringBuilder buf = new StringBuilder(code.length * 20); // Should be sufficient
+        StringBuilder buf = new StringBuilder(code.length * 20); // Should be sufficient
// CHECKSTYLE IGNORE MagicNumber
         ByteSequence stream = new ByteSequence(code);
         try {
             for (int i = 0; i < index; i++) {

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/AnnotationEntryGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/AnnotationEntryGen.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/AnnotationEntryGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/AnnotationEntryGen.java
Fri Aug 21 11:30:55 2015
@@ -155,7 +155,7 @@ public class AnnotationEntryGen {
 
     @Override
     public String toString() {
-        StringBuilder s = new StringBuilder(32);
+        StringBuilder s = new StringBuilder(32); // CHECKSTYLE IGNORE MagicNumber
         s.append("AnnotationGen:[").append(getTypeName()).append(" #").append(evs.size()).append("
{");
         for (int i = 0; i < evs.size(); i++) {
             s.append(evs.get(i));

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGen.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGen.java
Fri Aug 21 11:30:55 2015
@@ -319,7 +319,7 @@ public class FieldGen extends FieldGenOr
         access = access.equals("") ? "" : (access + " ");
         signature = type.toString();
         name = getName();
-        StringBuilder buf = new StringBuilder(32);
+        StringBuilder buf = new StringBuilder(32); // CHECKSTYLE IGNORE MagicNumber
         buf.append(access).append(signature).append(" ").append(name);
         String value = getInitValue();
         if (value != null) {

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/CodeHTML.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/CodeHTML.java?rev=1696942&r1=1696941&r2=1696942&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/CodeHTML.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/CodeHTML.java Fri
Aug 21 11:30:55 2015
@@ -91,7 +91,7 @@ final class CodeHTML {
         int[] jump_table;
         int no_pad_bytes = 0;
         int offset;
-        StringBuilder buf = new StringBuilder(256);
+        StringBuilder buf = new StringBuilder(256); // CHECKSTYLE IGNORE MagicNumber
         buf.append("<TT>").append(Constants.OPCODE_NAMES[opcode]).append("</TT></TD><TD>");
         /* Special case: Skip (0-3) padding bytes, i.e., the
          * following bytes are 4-byte-aligned



Mime
View raw message