Ignore JDK5 specific LVTT attribute for the time being

todo: Handle/maintain similar to LVT
master
patrickroemer 17 years ago
parent bc3c3dad55
commit 04d5dd7daa
  1. 4
      changes.txt
  2. 23
      src/EDU/purdue/cs/bloat/file/Code.java

@ -1,3 +1,7 @@
2007-10-27
- Ignore/purge JDK5 LVTT attribute in Code constructor
2007-10-25 2007-10-25
- ClassFileLoader#loadClassFromRessource(): String#replaceAll() -> String#replace() - ClassFileLoader#loadClassFromRessource(): String#replaceAll() -> String#replace()

@ -21,6 +21,7 @@
package EDU.purdue.cs.bloat.file; package EDU.purdue.cs.bloat.file;
import java.io.*; import java.io.*;
import java.util.*;
import EDU.purdue.cs.bloat.reflect.*; import EDU.purdue.cs.bloat.reflect.*;
@ -118,7 +119,7 @@ public class Code extends Attribute {
final int numAttributes = in.readUnsignedShort(); final int numAttributes = in.readUnsignedShort();
attrs = new Attribute[numAttributes]; List attrList = new ArrayList(numAttributes);
for (int i = 0; i < numAttributes; i++) { for (int i = 0; i < numAttributes; i++) {
final int nameIndex = in.readUnsignedShort(); final int nameIndex = in.readUnsignedShort();
@ -129,17 +130,25 @@ public class Code extends Attribute {
if (name != null) { if (name != null) {
if ("LineNumberTable".equals(name.value())) { if ("LineNumberTable".equals(name.value())) {
lineNumbers = new LineNumberTable(in, nameIndex, length); lineNumbers = new LineNumberTable(in, nameIndex, length);
attrs[i] = lineNumbers; attrList.add(lineNumbers);
} else if ("LocalVariableTable".equals(name.value())) { }
else if ("LocalVariableTable".equals(name.value())) {
locals = new LocalVariableTable(in, nameIndex, length); locals = new LocalVariableTable(in, nameIndex, length);
attrs[i] = locals; attrList.add(locals);
}
else if ("LocalVariableTypeTable".equals(name.value())) {
// just read and ignore
new GenericAttribute(in, nameIndex, length);
}
else {
attrList.add(new GenericAttribute(in, nameIndex, length));
} }
} }
else {
if (attrs[i] == null) { attrList.add(new GenericAttribute(in, nameIndex, length));
attrs[i] = new GenericAttribute(in, nameIndex, length);
} }
} }
attrs = (Attribute[]) attrList.toArray(new Attribute[attrList.size()]);
} }
/** /**

Loading…
Cancel
Save