commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1698233 - in /commons/proper/bcel/trunk/src: changes/changes.xml examples/ClassDumper.java
Date Thu, 27 Aug 2015 22:27:02 GMT
Author: sebb
Date: Thu Aug 27 22:27:01 2015
New Revision: 1698233

URL: http://svn.apache.org/r1698233
Log:
BCEL-260 ClassDumper example duplicates field attribute types

Modified:
    commons/proper/bcel/trunk/src/changes/changes.xml
    commons/proper/bcel/trunk/src/examples/ClassDumper.java

Modified: commons/proper/bcel/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/changes/changes.xml?rev=1698233&r1=1698232&r2=1698233&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/changes/changes.xml (original)
+++ commons/proper/bcel/trunk/src/changes/changes.xml Thu Aug 27 22:27:01 2015
@@ -63,6 +63,7 @@ The <action> type attribute can be add,u
 
   <body>
     <release version="6.0" date="TBA" description="Major release with Java 7 and 8 support">
+      <action issue="BCEL-260" type="fix">ClassDumper example duplicates field attribute
types</action>
       <action issue="BCEL-258" type="fix">No tests to check the output of dump methods</action>
       <action issue="BCEL-257" type="fix">INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL
need to define dump() methods</action>
       <action issue="BCEL-254" type="fix">Two more methods that would be nice to be
public.</action>

Modified: commons/proper/bcel/trunk/src/examples/ClassDumper.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/ClassDumper.java?rev=1698233&r1=1698232&r2=1698233&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/ClassDumper.java (original)
+++ commons/proper/bcel/trunk/src/examples/ClassDumper.java Thu Aug 27 22:27:01 2015
@@ -243,7 +243,7 @@ class ClassDumper {
         System.out.printf("%nFields(%d):%n", fields_count); 
 
         for (int i = 0; i < fields_count; i++) {
-            processFieldOrMethod(true);
+            processFieldOrMethod();
             if (i < fields_count - 1) {
                 System.out.println(); 
             }
@@ -263,7 +263,7 @@ class ClassDumper {
         System.out.printf("%nMethods(%d):%n", methods_count); 
 
         for (int i = 0; i < methods_count; i++) {
-            processFieldOrMethod(false);
+            processFieldOrMethod();
             if (i < methods_count - 1) {
                 System.out.println(); 
             }
@@ -294,7 +294,7 @@ class ClassDumper {
      * @throws IOException
      * @throws ClassFormatException
      */
-    private final void processFieldOrMethod (boolean isField) throws IOException, ClassFormatException
{
+    private final void processFieldOrMethod () throws IOException, ClassFormatException {
         int access_flags = file.readUnsignedShort();
         int name_index = file.readUnsignedShort();
         System.out.printf("  name_index: %d (", name_index); 
@@ -334,9 +334,6 @@ class ClassDumper {
                         attribute_length, pos2-pos1-6, pos1, pos1, pos2, pos2); 
             }
             System.out.printf("  "); 
-            if (isField) {
-                System.out.printf("%s: ", attributes[i].getName()); 
-            }
             System.out.println(attributes[i]); 
         }
     }



Mime
View raw message