Author: sebb
Date: Thu Aug 13 20:09:51 2015
New Revision: 1695771
URL: http://svn.apache.org/r1695771
Log:
BCEL-212 Inconsistent toString() results
Modified:
commons/proper/bcel/trunk/src/changes/changes.xml
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.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/Signature.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.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=1695771&r1=1695770&r2=1695771&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/changes/changes.xml (original)
+++ commons/proper/bcel/trunk/src/changes/changes.xml Thu Aug 13 20:09:51 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-212" type="update">Inconsistent toString()
results</action>
<action issue="BCEL-217" type="fix">long type instructions are not
searched by InstructionFinder using regular expression</action>
<action issue="BCEL-244" type="update" dev="ggregory">Update Java
requirement from 5 to 7</action>
<action issue="BCEL-239" type="fix">Interfaces should not be used to
define constants</action>
Modified:
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java
URL:
http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java?rev=1695771&r1=1695770&r2=1695771&view=diff
==============================================================================
---
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java
(original)
+++
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java
Thu Aug 13 20:09:51 2015
@@ -146,6 +146,7 @@ public final class ExceptionTable extend
public final String toString() {
StringBuilder buf = new StringBuilder();
String str;
+ buf.append("Exceptions: ");
for (int i = 0; i < exception_index_table.length; i++) {
str =
super.getConstantPool().getConstantString(exception_index_table[i],
Constants.CONSTANT_Class);
buf.append(Utility.compactClassName(str, false));
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=1695771&r1=1695770&r2=1695771&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
Thu Aug 13 20:09:51 2015
@@ -129,7 +129,7 @@ public final class LineNumberTable exten
if (i < line_number_table.length - 1) {
line.append(", ");
}
- if (line.length() > 72) {
+ if ((line.length() > 72) && (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/Signature.java
URL:
http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java?rev=1695771&r1=1695770&r2=1695771&view=diff
==============================================================================
---
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
(original)
+++
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
Thu Aug 13 20:09:51 2015
@@ -247,7 +247,7 @@ public final class Signature extends Att
@Override
public final String toString() {
String s = getSignature();
- return "Signature(" + s + ")";
+ return "Signature: " + s;
}
Modified:
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
URL:
http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java?rev=1695771&r1=1695770&r2=1695771&view=diff
==============================================================================
---
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
(original)
+++
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
Thu Aug 13 20:09:51 2015
@@ -129,7 +129,7 @@ public final class SourceFile extends At
*/
@Override
public final String toString() {
- return "SourceFile(" + getSourceFileName() + ")";
+ return "SourceFile: " + getSourceFileName();
}