You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sj...@apache.org on 2008/04/02 12:01:08 UTC
svn commit: r643825 - in
/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode:
BCIRenumberedAttribute.java LocalVariableTableAttribute.java
Author: sjanuary
Date: Wed Apr 2 03:01:00 2008
New Revision: 643825
URL: http://svn.apache.org/viewvc?rev=643825&view=rev
Log:
Fix for HARMONY-5678 ([classlib][pack200] LocalVariableTableAttribute contains System.out.println)
Modified:
harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java
harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java
Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java?rev=643825&r1=643824&r2=643825&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java Wed Apr 2 03:01:00 2008
@@ -20,6 +20,8 @@
import java.io.IOException;
import java.util.List;
+import org.apache.harmony.pack200.Pack200Exception;
+
public abstract class BCIRenumberedAttribute extends Attribute {
protected boolean renumbered = false;
@@ -50,7 +52,7 @@
*
* @param byteCodeOffsets List of Integer offsets of the bytecode array
*/
- public void renumber(List byteCodeOffsets) {
+ public void renumber(List byteCodeOffsets) throws Pack200Exception {
if(renumbered) {
throw new Error("Trying to renumber a line number table that has already been renumbered");
}
Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java?rev=643825&r1=643824&r2=643825&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java Wed Apr 2 03:01:00 2008
@@ -21,16 +21,18 @@
import java.util.ArrayList;
import java.util.List;
+import org.apache.harmony.pack200.Pack200Exception;
+
public class LocalVariableTableAttribute extends BCIRenumberedAttribute {
private int local_variable_table_length;
- private int[] start_pcs;
- private int[] lengths;
+ private final int[] start_pcs;
+ private final int[] lengths;
private int[] name_indexes;
private int[] descriptor_indexes;
- private int[] indexes;
- private CPUTF8[] names;
- private CPUTF8[] descriptors;
+ private final int[] indexes;
+ private final CPUTF8[] names;
+ private final CPUTF8[] descriptors;
private static final CPUTF8 attributeName = new CPUTF8(
"LocalVariableTable", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ); //$NON-NLS-1$
@@ -98,7 +100,7 @@
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.BCIRenumberedAttribute#renumber(java.util.List)
*/
- public void renumber(List byteCodeOffsets) {
+ public void renumber(List byteCodeOffsets) throws Pack200Exception {
// Remember the unrenumbered start_pcs, since that's used later
// to calculate end position.
int[] unrenumbered_start_pcs = new int[start_pcs.length];
@@ -131,7 +133,7 @@
// the encodedLength to it to get the stop index.
int stopIndex = indexOfStartPC + encodedLength;
if(stopIndex < 0) {
- System.out.println(stopIndex);
+ throw new Pack200Exception("Error renumbering bytecode indexes");
}
// Length can either be an index into the byte code offsets, or one beyond the
// end of the byte code offsets. Need to determine which this is.