Index: src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java (revision 608803)
+++ src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java (working copy)
@@ -26,7 +26,7 @@
private int[] attributeDefinitionHeader;
- private String[] attributeDefinitionLayout;
+ private String[] attributeDefinitionLayout;
private String[] attributeDefinitionName;
@@ -33,7 +33,7 @@
private AttributeLayoutMap attributeDefinitionMap;
private String[] cpUTF8;
-
+
public AttrDefinitionBands(Segment segment) {
super(segment);
this.cpUTF8 = segment.getCpBands().getCpUTF8();
@@ -51,9 +51,9 @@
Codec.UNSIGNED5, attributeDefinitionCount, cpUTF8);
attributeDefinitionLayout = parseReferences("attr_definition_layout",
in, Codec.UNSIGNED5, attributeDefinitionCount, cpUTF8);
-
+
attributeDefinitionMap = new AttributeLayoutMap();
-
+
int overflowIndex = 32;
if(segment.getSegmentHeader().getOptions().hasClassFlagsHi()) {
overflowIndex = 63;
Index: src/main/java/org/apache/harmony/pack200/AttributeLayout.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/AttributeLayout.java (revision 608803)
+++ src/main/java/org/apache/harmony/pack200/AttributeLayout.java (working copy)
@@ -87,8 +87,8 @@
}
throw new Pack200Exception("Unknown layout encoding: " + layout);
}
-
-
+
+
private int context;
private int index;
@@ -96,11 +96,11 @@
private final String layout;
private long mask;
-
+
private String name;
private boolean isDefault;
private int backwardsCallCount;
-
+
/**
* Construct a default AttributeLayout
@@ -115,7 +115,7 @@
throws Pack200Exception {
this(name, context, layout, index, true);
}
-
+
public AttributeLayout(String name, int context, String layout, int index,
boolean isDefault) throws Pack200Exception {
super();
@@ -138,8 +138,8 @@
this.layout = layout;
this.isDefault = isDefault;
}
-
-
+
+
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -153,7 +153,7 @@
return false;
} else if (!layout.equals(other.layout))
return false;
- if(index != other.index)
+ if(index != other.index)
return false;
if(context != other.context)
return false;
@@ -258,7 +258,7 @@
public String getName() {
return name;
}
-
+
public int numBackwardsCallables() {
if(layout == "*") {
return 1;
Index: src/main/java/org/apache/harmony/pack200/AttributeLayoutMap.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/AttributeLayoutMap.java (revision 608803)
+++ src/main/java/org/apache/harmony/pack200/AttributeLayoutMap.java (working copy)
@@ -26,7 +26,7 @@
* internationalized, and should not be translated.
*/
public class AttributeLayoutMap {
-
+
// Create all the default AttributeLayouts here
private static AttributeLayout[] getDefaultAttributeLayouts()
throws Pack200Exception {
@@ -193,7 +193,7 @@
private final Map fieldLayouts = new HashMap();
private final Map methodLayouts = new HashMap();
private final Map codeLayouts = new HashMap();
-
+
// The order of the maps in this array should not be changed as their indices correspond to
// the value of their context constants (AttributeLayout.CONTEXT_CLASS etc.)
private final Map[] layouts = new Map[] {classLayouts, fieldLayouts, methodLayouts, codeLayouts};
@@ -199,7 +199,7 @@
private final Map[] layouts = new Map[] {classLayouts, fieldLayouts, methodLayouts, codeLayouts};
private final Map layoutsToBands = new HashMap();
-
+
public AttributeLayoutMap() throws Pack200Exception {
AttributeLayout[] defaultAttributeLayouts = getDefaultAttributeLayouts();
for (int i = 0; i < defaultAttributeLayouts.length; i++) {
@@ -210,7 +210,7 @@
public void add(AttributeLayout layout) {
layouts[layout.getContext()].put(new Integer(layout.getIndex()), layout);
}
-
+
public void add(AttributeLayout layout, NewAttributeBands newBands) {
@@ -225,11 +225,11 @@
AttributeLayout layout = (AttributeLayout) iter.next();
if(layout.getName().equals(name)) {
return layout;
- }
+ }
}
return null;
}
-
+
public AttributeLayout getAttributeLayout(int index, int context)
throws Pack200Exception {
Map map = layouts[context];
@@ -235,11 +235,11 @@
Map map = layouts[context];
return (AttributeLayout) map.get(new Integer(index));
}
-
+
/**
* The map should not contain the same layout and name combination more than
* once for each context.
- * @throws Pack200Exception
+ * @throws Pack200Exception
*
*/
public void checkMap() throws Pack200Exception {
@@ -271,5 +271,5 @@
public NewAttributeBands getAttributeBands(AttributeLayout layout) {
return (NewAttributeBands) layoutsToBands.get(layout);
}
-
+
}
Index: src/main/java/org/apache/harmony/pack200/BHSDCodec.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/BHSDCodec.java (revision 587112)
+++ src/main/java/org/apache/harmony/pack200/BHSDCodec.java (working copy)
@@ -25,7 +25,7 @@
/**
* TODO Comment -- quite a lot can be nicked from Codec, since this was created
* from it
- *
+ *
*/
public final class BHSDCodec extends Codec {
@@ -53,7 +53,7 @@
* Represents signed numbers or not (0=unsigned,1/2=signed)
*/
private int s;
-
+
private long cardinality;
/**
@@ -58,7 +58,7 @@
/**
* Constructs an unsigned, non-delta Codec with the given B and H values.
- *
+ *
* @param b
* the maximum number of bytes that a value can be encoded as
* [1..5]
@@ -71,7 +71,7 @@
/**
* Constructs a non-delta Codec with the given B, H and S values.
- *
+ *
* @param b
* the maximum number of bytes that a value can be encoded as
* [1..5]
@@ -87,7 +87,7 @@
/**
* Constructs a Codec with the given B, H, S and D values.
- *
+ *
* @param b
* the maximum number of bytes that a value can be encoded as
* [1..5]
@@ -128,7 +128,7 @@
/**
* Returns the cardinality of this codec; that is, the number of distinct
* values that it can contain.
- *
+ *
* @return the cardinality of this codec
*/
public long cardinality() {
@@ -135,7 +135,7 @@
return cardinality;
}
-
+
public long decode(InputStream in) throws IOException, Pack200Exception {
if (d != 0)
throw new Pack200Exception(
@@ -143,7 +143,7 @@
return decode(in, 0);
}
-
+
public long decode(InputStream in, long last) throws IOException,
Pack200Exception {
int n = 0;
@@ -172,10 +172,10 @@
double twoPowSMinusOne = twoPowS-1;
if(u % twoPowS < twoPowSMinusOne) {
if(cardinality < Math.pow(2, 32)) {
- z = (long) (u - (Math.floor(u/ twoPowS)));
+ z = (long) (u - (Math.floor(u/ twoPowS)));
} else {
z = cast32((long) (u - (Math.floor(u/ twoPowS))));
- }
+ }
} else {
z = (long) (-Math.floor(u/ twoPowS) - 1);
}
@@ -196,7 +196,7 @@
/**
* True if this encoding can code the given value
- *
+ *
* @param value
* the value to check
* @return true if the encoding can encode this value
@@ -204,7 +204,7 @@
public boolean encodes(long value) {
return (value >= smallest() && value <= largest());
}
-
+
public byte[] encode(long value, long last) throws Pack200Exception {
if (isDelta()) {
value -= last;
@@ -267,7 +267,7 @@
/**
* Returns the largest value that this codec can represent.
- *
+ *
* @return the largest value that this codec can represent.
*/
public long largest() {
@@ -287,7 +287,7 @@
}
/**
* Returns the smallest value that this codec can represent.
- *
+ *
* @return the smallest value that this codec can represent.
*/
public long smallest() {
Index: src/main/java/org/apache/harmony/pack200/BandSet.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/BandSet.java (revision 612466)
+++ src/main/java/org/apache/harmony/pack200/BandSet.java (working copy)
@@ -35,11 +35,11 @@
import org.apache.harmony.pack200.bytecode.ClassConstantPool;
public abstract class BandSet {
-
+
public abstract void unpack(InputStream inputStream) throws IOException, Pack200Exception;
-
+
protected Segment segment;
-
+
protected SegmentHeader header;
public BandSet(Segment segment) {
@@ -49,7 +49,7 @@
/**
* Decode a band and return an array of int values
- *
+ *
* @param name
* the name of the band (primarily for logging/debugging
* purposes)
@@ -81,7 +81,7 @@
/**
* Decode a band and return an array of int[] values
- *
+ *
* @param name
* the name of the band (primarily for logging/debugging
* purposes)
@@ -117,10 +117,10 @@
}
return result;
}
-
+
/**
* Decode a band and return an array of long values
- *
+ *
* @param name
* the name of the band (primarily for logging/debugging
* purposes)
@@ -172,7 +172,7 @@
}
return baos.toByteArray();
}
-
+
public long[] parseFlags(String name, InputStream in, int count,
BHSDCodec codec, boolean hasHi) throws IOException,
Pack200Exception {
@@ -209,11 +209,11 @@
int[] lo;
if(hiCodec != null) {
hi = decodeBandLong(name, in, hiCodec, sum);
- lo = decodeBandInt(name, in, loCodec, sum);
+ lo = decodeBandInt(name, in, loCodec, sum);
} else {
lo = decodeBandInt(name, in, loCodec, sum);
}
-
+
int index = 0;
for (int i = 0; i < result.length; i++) {
for (int j = 0; j < result[i].length; j++) {
@@ -228,9 +228,9 @@
// TODO Remove debugging code
debug("Parsed *" + name + " (" + result.length + ")");
- return result;
+ return result;
}
-
+
/**
* Helper method to parse count references from in,
* using codec to decode the values as indexes into
@@ -237,7 +237,7 @@
* reference (which is populated prior to this call). An
* exception is thrown if a decoded index falls outside the range
* [0..reference.length-1].
- *
+ *
* @param name
* the band name
* @param in
@@ -249,7 +249,7 @@
* @param reference
* the array of values to use for the indexes; often
* {@link #cpUTF8}
- *
+ *
* @throws IOException
* if a problem occurs during reading from the underlying stream
* @throws Pack200Exception
@@ -262,7 +262,7 @@
return parseReferences(name, in, codec, new int[] { count },
reference)[0];
}
-
+
/**
* Helper method to parse count references from in,
* using codec to decode the values as indexes into
@@ -270,7 +270,7 @@
* exception is thrown if a decoded index falls outside the range
* [0..reference.length-1]. Unlike the other parseReferences, this
* post-processes the result into an array of results.
- *
+ *
* @param name
* TODO
* @param in
@@ -282,7 +282,7 @@
* @param reference
* the array of values to use for the indexes; often
* {@link #cpUTF8}
- *
+ *
* @throws IOException
* if a problem occurs during reading from the underlying stream
* @throws Pack200Exception
@@ -328,7 +328,7 @@
long[] band;
Codec codecUsed = codec;
if (codec.getB() == 1 || count == 0) {
- band = codec.decode(count, in);
+ band = codec.decode(count, in);
} else {
long[] getFirst = codec.decode(1, in);
if (getFirst.length == 0) {
@@ -339,7 +339,7 @@
// Non-default codec should be used
codecUsed = CodecEncoding.getCodec((int) (-1 - first),
header.getBandHeadersInputStream(), codec);
- band = codecUsed.decode(count, in);
+ band = codecUsed.decode(count, in);
} else if (!codec.isSigned() && first >= codec.getL()
&& first <= codec.getL() + 255) {
// Non-default codec should be used
@@ -356,7 +356,7 @@
for (int i = 0; i < returnBand.length; i++) {
returnBand[i] = (int)band[i];
}
-
+
/*
* Note - this is not in the spec, but seems to be used as an
* optimization by the RI for bands where the minimum and maximum values
@@ -392,7 +392,7 @@
}
}
}
-
+
return returnBand;
}
@@ -401,7 +401,7 @@
* class. It will be removed before going into production. If the property
* 'debug.pack200' is set, this will generate messages to stderr; otherwise,
* it will be silent.
- *
+ *
* @param message
* @deprecated this should be removed from production code
*/
@@ -410,7 +410,7 @@
}
public CPInteger[] parseCPIntReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- int[] reference = segment.getCpBands().getCpInt();
+ int[] reference = segment.getCpBands().getCpInt();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPInteger[] result = new CPInteger[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -424,7 +424,7 @@
}
public CPDouble[] parseCPDoubleReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- double[] reference = segment.getCpBands().getCpDouble();
+ double[] reference = segment.getCpBands().getCpDouble();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPDouble[] result = new CPDouble[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -438,7 +438,7 @@
}
public CPFloat[] parseCPFloatReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- float[] reference = segment.getCpBands().getCpFloat();
+ float[] reference = segment.getCpBands().getCpFloat();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPFloat[] result = new CPFloat[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -452,7 +452,7 @@
}
public CPLong[] parseCPLongReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- long[] reference = segment.getCpBands().getCpLong();
+ long[] reference = segment.getCpBands().getCpLong();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPLong[] result = new CPLong[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -464,9 +464,9 @@
}
return result;
}
-
+
public CPUTF8[] parseCPUTF8References(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpUTF8();
+ String[] reference = segment.getCpBands().getCpUTF8();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPUTF8[] result = new CPUTF8[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -481,7 +481,7 @@
public CPUTF8[][] parseCPUTF8References(String name, InputStream in, BHSDCodec codec, int[] counts) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpUTF8();
+ String[] reference = segment.getCpBands().getCpUTF8();
CPUTF8[][] result = new CPUTF8[counts.length][];
int sum = 0;
for (int i = 0; i < counts.length; i++) {
@@ -509,7 +509,7 @@
}
public CPString[] parseCPStringReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpString();
+ String[] reference = segment.getCpBands().getCpString();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPString[] result = new CPString[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -538,7 +538,7 @@
}
public CPMethodRef[] parseCPMethodRefReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpMethodClass();
+ String[] reference = segment.getCpBands().getCpMethodClass();
String[] descriptors = segment.getCpBands().getCpMethodDescriptor();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPMethodRef[] result = new CPMethodRef[indices.length];
@@ -553,7 +553,7 @@
}
public CPFieldRef[] parseCPFieldRefReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpFieldClass();
+ String[] reference = segment.getCpBands().getCpFieldClass();
String[] descriptors = segment.getCpBands().getCpFieldDescriptor();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPFieldRef[] result = new CPFieldRef[indices.length];
@@ -568,7 +568,7 @@
}
public CPNameAndType[] parseCPDescriptorReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpDescriptor();
+ String[] reference = segment.getCpBands().getCpDescriptor();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPNameAndType[] result = new CPNameAndType[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -582,7 +582,7 @@
}
public CPUTF8[] parseCPSignatureReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpSignature();
+ String[] reference = segment.getCpBands().getCpSignature();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPUTF8[] result = new CPUTF8[indices.length];
for (int i1 = 0; i1 < count; i1++) {
@@ -596,7 +596,7 @@
}
public CPClass[] parseCPClassReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception {
- String[] reference = segment.getCpBands().getCpClass();
+ String[] reference = segment.getCpBands().getCpClass();
int[] indices = decodeBandInt(name, in, codec, count, reference.length - 1);
CPClass[] result = new CPClass[indices.length];
for (int i1 = 0; i1 < count; i1++) {
Index: src/main/java/org/apache/harmony/pack200/BcBands.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/BcBands.java (revision 610778)
+++ src/main/java/org/apache/harmony/pack200/BcBands.java (working copy)
@@ -37,7 +37,7 @@
// The bytecodes for each method in each class as they come (i.e. in their packed format)
private byte[][][] methodByteCodePacked;
-
+
// The bands
// TODO: Haven't resolved references yet. Do we want to?
private int[] bcCaseCount;
@@ -77,7 +77,7 @@
*/
public void unpack(InputStream in) throws IOException,
Pack200Exception {
-
+
AttributeLayoutMap attributeDefinitionMap = segment.getAttrDefinitionBands().getAttributeDefinitionMap();
int classCount = header.getClassCount();
long[][] methodFlags = segment.getClassBands().getMethodFlags();
@@ -85,7 +85,7 @@
int[] codeMaxStack = segment.getClassBands().getCodeMaxStack();
ArrayList[][] methodAttributes = segment.getClassBands().getMethodAttributes();
String[][] methodDescr = segment.getClassBands().getMethodDescr();
-
+
int bcCaseCountCount = 0;
int bcByteCount = 0;
int bcShortCount = 0;
@@ -96,7 +96,7 @@
int bcLongRefCount = 0;
int bcDoubleRefCount = 0;
int bcStringRefCount = 0;
- int bcClassRefCount = 0;
+ int bcClassRefCount = 0;
int bcFieldRefCount = 0;
int bcMethodRefCount = 0;
int bcIMethodRefCount = 0;
@@ -103,7 +103,7 @@
int bcThisFieldCount = 0;
int bcSuperFieldCount = 0;
int bcThisMethodCount = 0;
- int bcSuperMethodCount = 0;
+ int bcSuperMethodCount = 0;
int bcInitRefCount = 0;
int bcEscCount = 0;
int bcEscRefCount = 0;
@@ -119,7 +119,7 @@
AttributeLayout.CONTEXT_METHOD);
methodByteCodePacked = new byte[classCount][][];
int bcParsed = 0;
-
+
List switchIsTableSwitch = new ArrayList();
List wideByteCodes = new ArrayList();
for (int c = 0; c < classCount; c++) {
@@ -367,7 +367,7 @@
int i = 0;
ArrayList orderedCodeAttributes = segment.getClassBands().getOrderedCodeAttributes();
-
+
// Exception table fields
int[] handlerCount = segment.getClassBands().getCodeHandlerCount();
int[][] handlerStartPCs = segment.getClassBands().getCodeHandlerStartP();
@@ -421,7 +421,7 @@
}
}
}
-
+
private boolean startsWithIf(int codePacked) {
return (codePacked >= 153 && codePacked <= 166)
|| (codePacked == 198)
Index: src/main/java/org/apache/harmony/pack200/ClassBands.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/ClassBands.java (revision 610778)
+++ src/main/java/org/apache/harmony/pack200/ClassBands.java (working copy)
@@ -115,7 +115,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.harmony.pack200.BandSet#unpack(java.io.InputStream)
*/
public void unpack(InputStream in) throws IOException, Pack200Exception {
@@ -158,7 +158,7 @@
AttributeLayout.CONTEXT_FIELD);
int[] fieldAttrCalls = decodeBandInt("field_attr_calls", in,
Codec.UNSIGNED5, callCount);
-
+
// Assign empty field attributes
fieldAttributes = new ArrayList[classCount][];
for (int i = 0; i < classCount; i++) {
@@ -186,7 +186,7 @@
int signatureIndex = 0;
int backwardsCallsUsed = parseFieldMetadataBands(in, fieldAttrCalls);
-
+
// Parse non-predefined attribute bands
int backwardsCallIndex = backwardsCallsUsed;
int limit = options.hasFieldFlagsHi() ? 62 : 31;
@@ -203,7 +203,7 @@
}
for (int i = 0; i < counts.length; i++) {
if(counts[i] > 0) {
- NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
+ NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
otherAttributes[i] = bands.parseAttributes(in, counts[i]);
int numBackwardsCallables = otherLayouts[i].numBackwardsCallables();
if(numBackwardsCallables > 0) {
@@ -260,7 +260,7 @@
private void parseMethodBands(InputStream in) throws IOException,
Pack200Exception {
methodDescr = parseReferences("method_descr", in, Codec.MDELTA5,
- classMethodCount, cpBands.getCpDescriptor());
+ classMethodCount, cpBands.getCpDescriptor());
parseMethodAttrBands(in);
}
@@ -276,7 +276,7 @@
AttributeLayout.CONTEXT_METHOD);
methodAttrCalls = decodeBandInt("code_attr_calls", in, Codec.UNSIGNED5,
callCount);
-
+
// assign empty method attributes
methodAttributes = new ArrayList[classCount][];
for (int i = 0; i < classCount; i++) {
@@ -294,7 +294,7 @@
Codec.UNSIGNED5, count);
String[][] methodExceptionsRS = parseReferences("method_Exceptions_RC",
in, Codec.UNSIGNED5, numExceptions, cpBands.getCpClass());
-
+
// Parse method signature attributes
AttributeLayout methodSignatureLayout = attrMap.getAttributeLayout(
AttributeLayout.ATTRIBUTE_SIGNATURE,
@@ -302,10 +302,10 @@
int count1 = SegmentUtils.countMatches(methodFlags, methodSignatureLayout);
long[] methodSignatureRS = decodeBandLong("method_signature_RS", in,
Codec.UNSIGNED5, count1);
-
+
// Parse method metadata bands
- int backwardsCallsUsed = parseMethodMetadataBands(in, methodAttrCalls);
-
+ int backwardsCallsUsed = parseMethodMetadataBands(in, methodAttrCalls);
+
// Parse non-predefined attribute bands
int backwardsCallIndex = backwardsCallsUsed;
int limit = options.hasMethodFlagsHi() ? 62 : 31;
@@ -322,7 +322,7 @@
}
for (int i = 0; i < counts.length; i++) {
if(counts[i] > 0) {
- NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
+ NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
otherAttributes[i] = bands.parseAttributes(in, counts[i]);
int numBackwardsCallables = otherLayouts[i].numBackwardsCallables();
if(numBackwardsCallables > 0) {
@@ -415,7 +415,7 @@
for (int i = 0; i < classCount; i++) {
classAttributes[i] = new ArrayList();
}
-
+
classFlags = parseFlags("class_flags", in, classCount, Codec.UNSIGNED5,
options.hasClassFlagsHi());
int classAttrCount = SegmentUtils.countBit16(classFlags);
@@ -513,7 +513,7 @@
}
for (int i = 0; i < counts.length; i++) {
if(counts[i] > 0) {
- NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
+ NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
otherAttributes[i] = bands.parseAttributes(in, counts[i]);
int numBackwardsCallables = otherLayouts[i].numBackwardsCallables();
if(numBackwardsCallables > 0) {
@@ -751,7 +751,7 @@
.getAttributeLayout(
AttributeLayout.ATTRIBUTE_LOCAL_VARIABLE_TYPE_TABLE,
AttributeLayout.CONTEXT_CODE);
-
+
int lengthLocalVariableNBand = SegmentUtils.countMatches(codeFlags,
localVariableTableLayout);
int[] localVariableTableN = decodeBandInt("code_LocalVariableTable_N",
@@ -787,7 +787,7 @@
}
}
}
-
+
int lengthLocalVariableTypeTableNBand = SegmentUtils.countMatches(
codeFlags, localVariableTypeTableLayout);
int[] localVariableTypeTableN = decodeBandInt(
@@ -825,7 +825,7 @@
}
for (int i = 0; i < counts.length; i++) {
if(counts[i] > 0) {
- NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
+ NewAttributeBands bands = attrMap.getAttributeBands(otherLayouts[i]);
otherAttributes[i] = bands.parseAttributes(in, counts[i]);
int numBackwardsCallables = otherLayouts[i].numBackwardsCallables();
if(numBackwardsCallables > 0) {
@@ -835,7 +835,7 @@
backwardsCallIndex+= numBackwardsCallables;
}
}
- }
+ }
int lineNumberIndex = 0;
int lvtIndex = 0;
@@ -880,7 +880,7 @@
}
}
}
-
+
}
private CPUTF8[][] stringsToCPUTF8(String[][] strings) {
@@ -893,7 +893,7 @@
}
return cpUTF8s;
}
-
+
private CPUTF8[] stringsToCPUTF8(String[] strings) {
@@ -935,7 +935,7 @@
Iterator rvaAttributesIterator = mb[0].getAttributes().iterator();
Iterator riaAttributesIterator = mb[1].getAttributes().iterator();
for (int i = 0; i < fieldFlags.length; i++) {
- for (int j = 0; j < fieldFlags[i].length; j++) {
+ for (int j = 0; j < fieldFlags[i].length; j++) {
if(rvaLayout.matches(fieldFlags[i][j])) {
fieldAttributes[i][j].add(rvaAttributesIterator.next());
}
@@ -970,7 +970,7 @@
pairCount += mbg[i].pair_N[j][k];
}
}
-
+
mbg[i].name_RU = stringsToCPUTF8(parseReferences(contextName + "_" + rxa
+ "_name_RU", in, Codec.UNSIGNED5, pairCount, cpBands.getCpUTF8()));
}
@@ -1196,7 +1196,7 @@
/**
* Answer an ArrayList of ArrayLists which hold the the code attributes
* corresponding to all classes in order.
- *
+ *
* If a class doesn't have any attributes, the corresponding element in this
* list will be an empty ArrayList.
* @return ArrayList
@@ -1230,7 +1230,7 @@
* Returns null if all classes should use the default major and minor
* version or an array of integers containing the major version numberss to
* use for each class in the segment
- *
+ *
* @return Class file major version numbers, or null if none specified
*/
public int[] getClassVersionMajor() {
@@ -1241,7 +1241,7 @@
* Returns null if all classes should use the default major and minor
* version or an array of integers containing the minor version numberss to
* use for each class in the segment
- *
+ *
* @return Class file minor version numbers, or null if none specified
*/
public int[] getClassVersionMinor() {
Index: src/main/java/org/apache/harmony/pack200/Codec.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/Codec.java (revision 591346)
+++ src/main/java/org/apache/harmony/pack200/Codec.java (working copy)
@@ -31,7 +31,7 @@
* as a sequence of 10x1s. This allows the absolute value of a coded integer to
* fall outside of the 'small number' range, whilst still being encoded as a
* single byte.
- *
+ *
* A codec is configured with four parameters:
*
* - B
@@ -65,7 +65,7 @@
* instance of the Codec to be cloned for each use.)
* -
*
- *
+ *
* Codecs are notated as (B,H,S,D) and either D or S,D may be omitted if zero.
* Thus {@link #BYTE1} is denoted (1,256,0,0) or (1,256). The
* {@link #toString()} method prints out the condensed form of the encoding.
@@ -74,11 +74,11 @@
* {@link #UNSIGNED5}) are unsigned; otherwise, in most cases, they are signed.
* The presence of the word Delta ({@link #DELTA5}, {@link #UDELTA5})
* indicates a delta encoding is used.
- *
+ *
* This codec is really quite cool for storing compressed information, and could
* be used entirely separately from the Pack200 implementation for efficient
* transfer of integer data if required.
- *
+ *
* Note that all information is byte-oriented; for decoding float/double
* information, the bit values are converted (not cast) into a long type. Note
* that long values are used throughout even though most may be cast to ints;
@@ -84,7 +84,7 @@
* that long values are used throughout even though most may be cast to ints;
* this is primarily to avoid having to worry about signed values, even if it
* would be more efficient to do so.
- *
+ *
* There are a number of standard codecs ({@link #UDELTA5}, {@link #UNSIGNED5},
* {@link #BYTE1}, {@link #CHAR3}) that are used in the implementation of many
* bands; but there are a variety of other ones, and indeed the specification
@@ -91,7 +91,7 @@
* assumes that other combinations of values can result in more specific and
* efficient formats. There are also a sequence of canonical encodings defined
* by the Pack200 specification, which allow a codec to be referred to by
- * canonical number. {@link CodecEncoding#canonicalCodec})
+ * canonical number. {@link CodecEncoding#canonicalCodec})
*/
public abstract class Codec {
/**
@@ -149,7 +149,7 @@
* Decode a sequence of bytes from the given input stream, returning the
* value as a long. Note that this method can only be applied for non-delta
* encodings.
- *
+ *
* @param in
* the input stream to read from
* @return the value as a long
@@ -168,7 +168,7 @@
* previous value must be passed in as a parameter. If it is a non-delta
* encoding, then it does not matter what value is passed in, so it makes
* sense for the value to be passed in by default using code similar to:
- *
+ *
*
* long last = 0;
* while (condition) {
@@ -176,7 +176,7 @@
* // do something with last
* }
*
- *
+ *
* @param in
* the input stream to read from
* @param last
@@ -198,7 +198,7 @@
* This should probably be used in most cases, since some codecs
* (such as @{link PopCodec}) only work when the number of values
* to be read is known.
- *
+ *
* @param n
* the number of values to decode
* @param in
@@ -221,10 +221,10 @@
}
return result;
}
-
+
/**
* Decodes a sequence of n values from in.
- *
+ *
* @param n
* the number of values to decode
* @param in
Index: src/main/java/org/apache/harmony/pack200/CodecEncoding.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/CodecEncoding.java (revision 612466)
+++ src/main/java/org/apache/harmony/pack200/CodecEncoding.java (working copy)
@@ -40,7 +40,7 @@
new BHSDCodec(5, 16, 2), new BHSDCodec(5, 32), new BHSDCodec(5, 32, 1),
new BHSDCodec(5, 32, 2), new BHSDCodec(5, 64), new BHSDCodec(5, 64, 1),
new BHSDCodec(5, 64, 2), new BHSDCodec(5, 128), new BHSDCodec(5, 128, 1),
- new BHSDCodec(5, 128, 2), new BHSDCodec(5, 4, 0, 1),
+ new BHSDCodec(5, 128, 2), new BHSDCodec(5, 4, 0, 1),
new BHSDCodec(5, 4, 1, 1), new BHSDCodec(5, 4, 2, 1),
new BHSDCodec(5, 16, 0, 1), new BHSDCodec(5, 16, 1, 1),
new BHSDCodec(5, 16, 2, 1), new BHSDCodec(5, 32, 0, 1),
@@ -80,7 +80,7 @@
new BHSDCodec(4, 240, 0, 1), new BHSDCodec(4, 240, 1, 1),
new BHSDCodec(4, 248, 0, 1), new BHSDCodec(4, 248, 1, 1) };
- /**
+ /**
* Returns the codec specified by the given value byte and optional byte header.
* If the value is >=116, then bytes may be consumed from the secondary input
* stream, which is taken to be the contents of the band_headers byte array.
@@ -91,7 +91,7 @@
* @param in the input stream to read additional byte headers from
* @param defaultCodec TODO
* @return the corresponding codec, or null if the default should be used
- * @throws IOException
+ * @throws IOException
* @throws IOException if there is a problem reading from the input stream (which
* in reality, is never, since the band_headers are likely stored in a byte array
* and accessed via a ByteArrayInputStream. However, an EOFException could occur
@@ -96,7 +96,7 @@
* in reality, is never, since the band_headers are likely stored in a byte array
* and accessed via a ByteArrayInputStream. However, an EOFException could occur
* if things go wrong)
- * @throws Pack200Exception
+ * @throws Pack200Exception
*/
public static Codec getCodec(int value, InputStream in, Codec defaultCodec) throws IOException, Pack200Exception {
// Sanity check to make sure that no-one has changed
@@ -101,7 +101,7 @@
public static Codec getCodec(int value, InputStream in, Codec defaultCodec) throws IOException, Pack200Exception {
// Sanity check to make sure that no-one has changed
// the canonical codecs, which would really cause havoc
- if (canonicalCodec.length != 116)
+ if (canonicalCodec.length != 116)
throw new Error("Canonical encodings have been incorrectly modified");
if (value < 0) {
throw new IllegalArgumentException(
@@ -122,7 +122,7 @@
throw new EOFException("End of buffer read whilst trying to decode codec");
int h = code + 1;
// This handles the special cases for invalid combinations of data.
- return new BHSDCodec(b,h,s,d);
+ return new BHSDCodec(b,h,s,d);
} else if (value >= 117 && value <= 140) { // Run codec
int offset = value - 117;
int kx = offset & 3;
@@ -138,7 +138,7 @@
if (adef) {
aCodec = defaultCodec;
} else {
- aCodec = getCodec(in.read(),in,defaultCodec);
+ aCodec = getCodec(in.read(),in,defaultCodec);
}
if (bdef) {
bCodec = defaultCodec;
@@ -143,7 +143,7 @@
if (bdef) {
bCodec = defaultCodec;
} else {
- bCodec = getCodec(in.read(),in,defaultCodec);
+ bCodec = getCodec(in.read(),in,defaultCodec);
}
return new RunCodec(k,aCodec,bCodec);
} else if (value >= 141 && value <= 188) { // Population Codec
@@ -148,7 +148,7 @@
return new RunCodec(k,aCodec,bCodec);
} else if (value >= 141 && value <= 188) { // Population Codec
int offset = value - 141;
- boolean fdef = (offset & 1) == 1;
+ boolean fdef = (offset & 1) == 1;
boolean udef = (offset >> 1 & 1) == 1;
int tdefl = offset >> 2;
boolean tdef = tdefl != 0;
Index: src/main/java/org/apache/harmony/pack200/CpBands.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/CpBands.java (revision 608803)
+++ src/main/java/org/apache/harmony/pack200/CpBands.java (working copy)
@@ -21,11 +21,11 @@
import java.util.ArrayList;
public class CpBands extends BandSet {
-
+
public SegmentConstantPool getConstantPool() {
return pool;
}
-
+
private final SegmentConstantPool pool = new SegmentConstantPool(this);
@@ -59,11 +59,11 @@
private String[] cpUTF8;
-
+
public CpBands(Segment segment) {
super(segment);
}
-
+
public void unpack(InputStream in) throws IOException, Pack200Exception {
parseCpUtf8(in);
parseCpInt(in);
@@ -78,11 +78,11 @@
parseCpMethod(in);
parseCpIMethod(in);
}
-
+
/**
* Parses the constant pool class names, using {@link #cpClassCount} to
* populate {@link #cpClass} from {@link #cpUTF8}.
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -106,7 +106,7 @@
* largely to make it easier for representing field and method descriptors
* (e.g. out:java.lang.PrintStream) in a way that is
* compatible with passing String arrays.
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -144,7 +144,7 @@
/**
* Parses the constant pool field definitions, using {@link #cpFieldCount}
* to populate {@link #cpFieldClass} and {@link #cpFieldDescriptor}.
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -177,7 +177,7 @@
* Parses the constant pool interface method definitions, using
* {@link #cpIMethodCount} to populate {@link #cpIMethodClass} and
* {@link #cpIMethodDescriptor}.
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -211,7 +211,7 @@
/**
* Parses the constant pool method definitions, using {@link #cpMethodCount}
* to populate {@link #cpMethodClass} and {@link #cpMethodDescriptor}.
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -242,7 +242,7 @@
* representation identical to the bytecode equivalent
* [Ljava/lang/String;(V) TODO Check that the form is as
* above and update other types e.g. J
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -291,7 +291,7 @@
/**
* Parses the constant pool strings, using {@link #cpStringCount} to
* populate {@link #cpString} from indexes into {@link #cpUTF8}.
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -308,7 +308,7 @@
private void parseCpUtf8(InputStream in) throws IOException,
Pack200Exception {
- int cpUTF8Count = header.getCpUTF8Count();
+ int cpUTF8Count = header.getCpUTF8Count();
cpUTF8 = new String[cpUTF8Count];
cpUTF8[0] = ""; //$NON-NLS-1$
int[] prefix = decodeBandInt("cpUTF8Prefix", in, Codec.DELTA5, cpUTF8Count-2);
@@ -327,14 +327,14 @@
int[] dataBand = decodeBandInt("cp_Utf8_chars", in, Codec.CHAR3, charCount);
for (int i = 0; i < data.length; i++) {
data[i] = (char) dataBand[i];
- }
-
+ }
+
// Read in the big suffix data
int[] bigSuffixCounts = decodeBandInt("cp_Utf8_big_suffix", in, Codec.DELTA5, bigSuffixCount);
int[][] bigSuffixDataBand = decodeBandInt("cp_Utf8_big_chars", in, Codec.DELTA5, bigSuffixCounts);
-
+
// Convert big suffix data to characters
- char bigSuffixData[][] = new char[bigSuffixCount][];
+ char bigSuffixData[][] = new char[bigSuffixCount][];
for (int i = 0; i < bigSuffixDataBand.length; i++) {
bigSuffixData[i] = new char[bigSuffixDataBand[i].length];
for (int j = 0; j < bigSuffixDataBand[i].length; j++) {
@@ -358,7 +358,7 @@
}
}
}
-
+
public String[] getCpClass() {
return cpClass;
}
Index: src/main/java/org/apache/harmony/pack200/FileBands.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/FileBands.java (revision 610389)
+++ src/main/java/org/apache/harmony/pack200/FileBands.java (working copy)
@@ -42,7 +42,7 @@
private String[] cpUTF8;
private InputStream in;
-
+
/**
* @param header
*/
@@ -77,7 +77,7 @@
}
this.in = in; // store for use by processFileBits(), which is called later
}
-
+
// TODO: stream the file bits directly somehow
public void processFileBits() throws IOException,
Pack200Exception {
Index: src/main/java/org/apache/harmony/pack200/IcBands.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/IcBands.java (revision 608803)
+++ src/main/java/org/apache/harmony/pack200/IcBands.java (working copy)
@@ -23,7 +23,7 @@
* Pack200 Inner Class Bands
*/
public class IcBands extends BandSet {
-
+
public static class ICTuple {
public String C; // this class
@@ -63,7 +63,7 @@
outerClasses, cpClass);
String[] icName = parseReferences("ic_name", in, Codec.DELTA5, outerClasses,
cpUTF8);
-
+
// Construct IC tuples
icAll = new ICTuple[icThisClass.length];
int index = 0;
@@ -83,5 +83,5 @@
return icAll;
}
-
+
}
\ No newline at end of file
Index: src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java (revision 596578)
+++ src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java (working copy)
@@ -39,7 +39,7 @@
* Group of metadata bands, e.g. class_RVA_bands, method_AD_bands etc
*/
public class MetadataBandGroup {
-
+
private String type;
public MetadataBandGroup(String type) {
@@ -45,7 +45,7 @@
public MetadataBandGroup(String type) {
this.type = type;
}
-
+
private List attributes;
public int[] param_NB;
@@ -64,7 +64,7 @@
public CPUTF8[] cases_RU;
public int[] casearray_N;
public CPUTF8[] nesttype_RS;
- public int[] nestpair_N;
+ public int[] nestpair_N;
public CPUTF8[] nestname_RU;
private Iterator caseI_Iterator;
@@ -86,9 +86,9 @@
private Iterator casearray_Iterator;
private Iterator T_iterator;
-
+
private Iterator nesttype_RS_Iterator;
-
+
private Iterator nestpair_N_Iterator;
private Iterator nestname_RU_Iterator;
@@ -98,8 +98,8 @@
private Iterator type_RS_Iterator;
private Iterator pair_N_Iterator;
-
-
+
+
public List getAttributes() {
if(attributes == null) {
attributes = new ArrayList();
@@ -146,7 +146,7 @@
Annotation[] annotations = new Annotation[numAnnotations];
for (int i = 0; i < numAnnotations; i++) {
annotations[i] = getAnnotation(types[i], pairCounts[i], namesIterator);
- }
+ }
return new RuntimeVisibleorInvisibleAnnotationsAttribute(type
.equals("RVA") ? "RuntimeVisibleAnnotations"
: "RuntimeInvisibleAnnotations",
@@ -152,7 +152,7 @@
: "RuntimeInvisibleAnnotations",
annotations);
}
-
+
private Attribute getParameterAttribute(int numParameters, Iterator namesIterator ) {
ParameterAnnotation[] parameter_annotations = new ParameterAnnotation[numParameters];
for (int i = 0; i < numParameters; i++) {
@@ -215,7 +215,7 @@
case '@':
CPUTF8 type = (CPUTF8) nesttype_RS_Iterator.next();
int numPairs = ((Integer)nestpair_N_Iterator.next()).intValue();
-
+
return getAnnotation(type, numPairs, nestname_RU_Iterator);
}
return null;
@@ -228,5 +228,5 @@
}
return boxed;
}
-
+
}
\ No newline at end of file
Index: src/main/java/org/apache/harmony/pack200/NewAttributeBands.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/NewAttributeBands.java (revision 609992)
+++ src/main/java/org/apache/harmony/pack200/NewAttributeBands.java (working copy)
@@ -47,7 +47,7 @@
private List attributes;
private int backwardsCallCount;
-
+
private List attributeLayoutElements;
public NewAttributeBands(Segment segment, AttributeLayout attributeLayout) throws IOException {
@@ -59,7 +59,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.harmony.pack200.BandSet#unpack(java.io.InputStream)
*/
public void unpack(InputStream in) throws IOException, Pack200Exception {
@@ -78,7 +78,7 @@
/**
* Parse the bands relating to this AttributeLayout and return the correct
* class file attributes as a List of {@link Attribute}
- * @throws Pack200Exception
+ * @throws Pack200Exception
*/
public List parseAttributes(InputStream in, int occurrenceCount)
throws IOException, Pack200Exception {
@@ -129,7 +129,7 @@
/**
* Resolve calls in the attribute layout and returns the number of backwards calls
- *
+ *
* @param tokens -
* the attribute layout as a List of AttributeElements
*/
@@ -145,7 +145,7 @@
if (layoutElement instanceof Call) {
// Set the callable for each call
Call call = (Call) layoutElement;
- int index = call.callableIndex;
+ int index = call.callableIndex;
if (index == 0) { // Calls the parent callable
backwardsCalls++;
call.setCallable(callable);
@@ -319,11 +319,11 @@
/**
* Read the bands associated with this part of the layout
- *
+ *
* @param in
* @param count
- * @throws Pack200Exception
- * @throws IOException
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void readBands(InputStream in, int count) throws IOException, Pack200Exception;
@@ -329,7 +329,7 @@
/**
* Add the band data for this element at the given index to the attribute
- *
+ *
* @param index
* @param attribute
*/
@@ -342,18 +342,18 @@
protected int getLength(char uint_type) {
int length = 0;;
switch(uint_type) {
- case 'B':
+ case 'B':
length = 1;
break;
- case 'H':
+ case 'H':
length = 2;
break;
- case 'I':
+ case 'I':
length = 4;
break;
- case 'V':
+ case 'V':
length = 0;
- break;
+ break;
}
return length;
}
@@ -395,7 +395,7 @@
} else if (tag.startsWith("P")) {
char uint_type = tag.substring(1).toCharArray()[0];
int length = getLength(uint_type);
- attribute.addBCIndex(length, (int) value);
+ attribute.addBCIndex(length, (int) value);
} else if (tag.startsWith("OS")) {
char uint_type = tag.substring(1).toCharArray()[0];
int length = getLength(uint_type);
@@ -406,11 +406,11 @@
} else if(length == 4) {
value = (int)value;
}
- attribute.addBCLength(length, (int) value);
+ attribute.addBCLength(length, (int) value);
} else if (tag.startsWith("O")) {
char uint_type = tag.substring(1).toCharArray()[0];
int length = getLength(uint_type);
- attribute.addBCLength(length, (int) value);
+ attribute.addBCLength(length, (int) value);
}
}
@@ -442,7 +442,7 @@
countElement.readBands(in, count);
int arrayCount = 0;
for (int i = 0; i < count; i++) {
- arrayCount += countElement.getValue(i);
+ arrayCount += countElement.getValue(i);
}
for (Iterator iter = layoutElements.iterator(); iter.hasNext();) {
LayoutElement element = (LayoutElement) iter.next();
@@ -453,7 +453,7 @@
public void addToAttribute(int index, NewAttribute attribute) {
// Add the count value
countElement.addToAttribute(index, attribute);
-
+
// Add the corresponding array values
int offset = 0;
for (int i = 0; i < index; i++) {
@@ -460,7 +460,7 @@
offset += countElement.getValue(i);
}
long numElements = countElement.getValue(index);
- for (int i = offset; i < offset + numElements; i++) {
+ for (int i = offset; i < offset + numElements; i++) {
for (Iterator iter = layoutElements.iterator(); iter.hasNext();) {
LayoutElement element = (LayoutElement) iter.next();
element.addToAttribute(i, attribute);
@@ -469,7 +469,7 @@
}
}
-
+
/**
* A Union is a type of layout element where the tag value acts as a
* selector for one of the union cases
@@ -475,7 +475,7 @@
* selector for one of the union cases
*/
private class Union extends LayoutElement {
-
+
private Integral unionTag;
private List unionCases;
private List defaultCaseBody;
@@ -506,7 +506,7 @@
for (int i = 0; i < values.length; i++) {
boolean found = false;
for (Iterator iter = unionCases.iterator(); iter.hasNext();) {
- UnionCase unionCase = (UnionCase) iter.next();
+ UnionCase unionCase = (UnionCase) iter.next();
if(unionCase.hasTag(values[i])) {
found = true;
}
@@ -592,7 +592,7 @@
*/
if(callableIndex > 0) {
callable.addCount(count);
- }
+ }
}
public void addToAttribute(int n, NewAttribute attribute) {
@@ -606,7 +606,7 @@
private class Reference extends LayoutElement {
private String tag;
-
+
private Object band;
private int length;
@@ -677,7 +677,7 @@
private class Callable implements AttributeLayoutElement {
private List body;
-
+
private boolean isBackwardsCallable;
public Callable(List body) throws IOException {
@@ -683,7 +683,7 @@
public Callable(List body) throws IOException {
this.body = body;
}
-
+
private int count;
private int index;
@@ -692,11 +692,11 @@
* so they don't have to keep track of the internal index
* of the callable
* @param attribute
- */
+ */
public void addNextToAttribute(NewAttribute attribute) {
for (Iterator iter = body.iterator(); iter.hasNext();) {
LayoutElement element = (LayoutElement) iter.next();
- element.addToAttribute(index, attribute);
+ element.addToAttribute(index, attribute);
}
index++;
}
@@ -721,7 +721,7 @@
// Ignore n because bands also contain element parts from calls
for (Iterator iter = body.iterator(); iter.hasNext();) {
LayoutElement element = (LayoutElement) iter.next();
- element.addToAttribute(index, attribute);
+ element.addToAttribute(index, attribute);
}
index++;
}
@@ -729,7 +729,7 @@
public boolean isBackwardsCallable() {
return isBackwardsCallable;
}
-
+
/**
* Tells this Callable that it is a backwards callable
*/
@@ -737,7 +737,7 @@
this.isBackwardsCallable = true;
}
}
-
+
/**
* A Union case
*/
@@ -899,7 +899,7 @@
* Once the attribute bands have been read the callables can be informed
* about the number of times each is subject to a backwards call. This
* method is used to set this information.
- *
+ *
* @param backwardsCalls
* one int for each backwards callable, which contains the number
* of times that callable is subject to a backwards call.
Index: src/main/java/org/apache/harmony/pack200/Pack200Exception.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/Pack200Exception.java (revision 587112)
+++ src/main/java/org/apache/harmony/pack200/Pack200Exception.java (working copy)
@@ -25,7 +25,7 @@
/**
* Create a new Pack200 exception with the given message and cause
- *
+ *
* @param message
* the text message to display
*/
@@ -35,7 +35,7 @@
/**
* Create a new Pack200 exception with the given message and cause
- *
+ *
* @param message
* the text message to display
* @param cause
@@ -47,7 +47,7 @@
/**
* Create a new Pack200 exception with the given message and cause
- *
+ *
* @param cause
* the throwable that caused this problem
*/
Index: src/main/java/org/apache/harmony/pack200/PopulationCodec.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/PopulationCodec.java (revision 612466)
+++ src/main/java/org/apache/harmony/pack200/PopulationCodec.java (working copy)
@@ -25,7 +25,7 @@
private Codec unvafouredCodec;
private int l;
private long[] favoured;
-
+
public PopulationCodec(Codec favouredCodec, Codec tableCodec, Codec unvafouredCodec) {
this.favouredCodec = favouredCodec;
this.tokenCodec = tableCodec;
@@ -40,7 +40,7 @@
this.unvafouredCodec = unvafouredCodec;
}
-
+
public long decode(InputStream in) throws IOException, Pack200Exception {
throw new Pack200Exception("Population encoding does not work unless the number of elements are known");
}
@@ -45,7 +45,7 @@
throw new Pack200Exception("Population encoding does not work unless the number of elements are known");
}
-
+
public long decode(InputStream in, long last) throws IOException,
Pack200Exception {
throw new Pack200Exception("Population encoding does not work unless the number of elements are known");
@@ -51,7 +51,7 @@
throw new Pack200Exception("Population encoding does not work unless the number of elements are known");
}
-
+
public long[] decode(int n, InputStream in) throws IOException, Pack200Exception {
favoured = new long[n]; // there must be <= n values, but probably a lot less
long result[];
@@ -90,7 +90,7 @@
}
}
// read favorites
- result = tokenCodec.decode(n, in);
+ result = tokenCodec.decode(n, in);
// read unfavorites
last = 0;
for(int i = 0; i < n; i++) {
Index: src/main/java/org/apache/harmony/pack200/RunCodec.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/RunCodec.java (revision 587112)
+++ src/main/java/org/apache/harmony/pack200/RunCodec.java (working copy)
@@ -51,7 +51,7 @@
return value;
} else {
this.last = bCodec.decode(in,last);
- return this.last;
+ return this.last;
}
}
public String toString() {
Index: src/main/java/org/apache/harmony/pack200/Segment.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/Segment.java (revision 610449)
+++ src/main/java/org/apache/harmony/pack200/Segment.java (working copy)
@@ -40,7 +40,7 @@
* combine (non-GZipped) archives into a single large archive by concatenation
* alone. Thus all the hard work in unpacking an archive falls to understanding
* a segment.
- *
+ *
* This class implements the Pack200 specification by an entry point ({@link #parse(InputStream)})
* which in turn delegates to a variety of other parse methods. Each parse
* method corresponds (roughly) to the name of the bands in the Pack200
@@ -45,7 +45,7 @@
* which in turn delegates to a variety of other parse methods. Each parse
* method corresponds (roughly) to the name of the bands in the Pack200
* specification.
- *
+ *
* The first component of a segment is the header; this contains (amongst other
* things) the expected counts of constant pool entries, which in turn defines
* how many values need to be read from the stream. Because values are variable
@@ -52,7 +52,7 @@
* width (see {@link Codec}), it is not possible to calculate the start of the
* next segment, although one of the header values does hint at the size of the
* segment if non-zero, which can be used for buffering purposes.
- *
+ *
* Note that this does not perform any buffering of the input stream; each value
* will be read on a byte-by-byte basis. It does not perform GZip decompression
* automatically; both of these are expected to be done by the caller if the
@@ -68,7 +68,7 @@
* Decode a segment from the given input stream. This does not attempt to
* re-assemble or export any class files, but it contains enough information
* to be able to re-assemble class files by external callers.
- *
+ *
* @param in
* the input stream to read from TODO At this point, this must be
* a non-GZipped input stream, but this decoding could be done in
@@ -105,7 +105,7 @@
private SegmentHeader header;
private CpBands cpBands;
-
+
private AttrDefinitionBands attrDefinitionBands;
private IcBands icBands;
@@ -189,7 +189,7 @@
/**
* This performs the actual work of parsing against a non-static instance of
* Segment.
- *
+ *
* @param in
* the input stream to read from
* @throws IOException
@@ -202,7 +202,7 @@
Pack200Exception {
debug("-------");
header = new SegmentHeader();
- header.unpack(in);
+ header.unpack(in);
cpBands = new CpBands(this);
cpBands.unpack(in);
attrDefinitionBands = new AttrDefinitionBands(this);
@@ -216,11 +216,11 @@
fileBands = new FileBands(this);
fileBands.unpack(in);
}
-
+
/**
* Unpacks a packed stream (either .pack. or .pack.gz) into a corresponding
* JarOuputStream.
- *
+ *
* @throws Pack200Exception
* if there is a problem unpacking
* @throws IOException
@@ -234,7 +234,7 @@
// that possibility
parse(in).unpack(in, out);
}
-
+
/**
* This is a local debugging message to aid the developer in writing this
* class. It will be removed before going into production. If the property
@@ -240,7 +240,7 @@
* class. It will be removed before going into production. If the property
* 'debug.pack200' is set, this will generate messages to stderr; otherwise,
* it will be silent.
- *
+ *
* @param message
* @deprecated this should be removed from production code
*/
@@ -258,7 +258,7 @@
* reading, since the file bits may not be loaded and thus just copied from
* one stream to another. Doesn't close the output stream when finished, in
* case there are more entries (e.g. further segments) to be written.
- *
+ *
* @param out
* the JarOutputStream to write data to
* @param in
@@ -277,7 +277,7 @@
long[] fileOptions = fileBands.getFileOptions();
long[] fileSize = fileBands.getFileSize();
byte[][] fileBits = fileBands.getFileBits();
-
+
// out.setLevel(JarEntry.DEFLATED)
// now write the files out
int classNum = 0;
Index: src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java (revision 608794)
+++ src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java (working copy)
@@ -33,7 +33,7 @@
public class SegmentConstantPool {
/**
- *
+ *
*/
private CpBands bands;
@@ -89,7 +89,7 @@
throw new Error("Get value incomplete");
}
}
-
+
/**
* Subset the constant pool of the specified type
* to be just that which has the specified class
@@ -95,7 +95,7 @@
* to be just that which has the specified class
* name. Answer the ConstantPoolEntry at the
* desiredIndex of the subsetted pool.
- *
+ *
* @param cp type of constant pool array to search
* @param desiredIndex index of the constant pool
* @param desiredClassName class to use to generate a
@@ -119,7 +119,7 @@
realIndex = matchSpecificPoolEntryIndex(array, desiredClassName, index);
return getConstantPoolEntry(cp, (long)realIndex);
}
-
+
/**
* Given the name of a class, answer the CPClass associated
* with that class. Answer null if the class doesn't exist.
@@ -139,7 +139,7 @@
throw new Error("Error getting class pool entry");
}
}
-
+
/**
* Answer the init method for the specified class.
* @param cp constant pool to search (must be CP_METHOD)
@@ -166,7 +166,7 @@
* fields defined in the superclass. Similarly, _this bytecodes
* use just those methods/fields defined in this class, and _init
* bytecodes use just those methods that start with .
- *
+ *
* This method takes an array of names, a String to match for,
* an index and a boolean as parameters, and answers the array
* position in the array of the indexth element which matches
@@ -171,7 +171,7 @@
* an index and a boolean as parameters, and answers the array
* position in the array of the indexth element which matches
* (or equals) the String (depending on the state of the boolean)
- *
+ *
* In other words, if the class array consists of:
* Object [position 0, 0th instance of Object]
* String [position 1, 0th instance of String]
@@ -181,7 +181,7 @@
* then classSpecificPoolEntryIndex(..., "Object", 2, false) will
* answer 4. classSpecificPoolEntryIndex(..., "String", 0, false)
* will answer 1.
- *
+ *
* @param nameArray Array of Strings against which the compareString is tested
* @param compareString String for which to search
* @param desiredIndex nth element with that match (counting from 0)
@@ -199,7 +199,7 @@
* - the secondaryArray[index] .matches() the secondaryCompareString
* When the desiredIndex number of hits has been reached, the index
* into the original two arrays of the element hit is returned.
- *
+ *
* @param primaryArray The first array to search
* @param secondaryArray The second array (must be same .length as primaryArray)
* @param primaryCompareString The String to compare against primaryArray using .equals()
@@ -210,7 +210,7 @@
protected int matchSpecificPoolEntryIndex(String[] primaryArray, String[] secondaryArray, String primaryCompareString, String secondaryCompareRegex, int desiredIndex) {
int instanceCount = -1;
for(int index=0; index < primaryArray.length; index++) {
- if((primaryArray[index].equals(primaryCompareString)) &&
+ if((primaryArray[index].equals(primaryCompareString)) &&
secondaryArray[index].matches(secondaryCompareRegex)) {
instanceCount++;
if(instanceCount == desiredIndex) {
@@ -222,8 +222,8 @@
// with desiredIndex must not exist in the array.
return -1;
}
-
-
+
+
public ConstantPoolEntry getConstantPoolEntry(int cp, long value) throws Pack200Exception {
int index = (int) value;
if (index == -1) {
@@ -261,7 +261,7 @@
throw new Error("Get value incomplete");
}
}
-
+
public ConstantPoolEntry[] getCpAll() throws Pack200Exception {
ArrayList cpAll = new ArrayList();
// TODO: this is 1.5-specific. Try to get rid
@@ -296,7 +296,7 @@
for(int index=0; index < bands.getCpIMethodClass().length; index++) {
cpAll.add(getConstantPoolEntry(CP_IMETHOD, index));
}
-
+
ConstantPoolEntry[] result = new ConstantPoolEntry[cpAll.size()];
cpAll.toArray(result);
return result;
@@ -302,5 +302,5 @@
return result;
}
-
+
}
Index: src/main/java/org/apache/harmony/pack200/SegmentHeader.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/SegmentHeader.java (revision 610448)
+++ src/main/java/org/apache/harmony/pack200/SegmentHeader.java (working copy)
@@ -22,11 +22,11 @@
import java.io.InputStream;
public class SegmentHeader {
-
+
private int archiveMajor;
- private int archiveMinor;
-
+ private int archiveMinor;
+
private long archiveModtime;
private long archiveSize;
@@ -74,8 +74,8 @@
private int segmentsRemaining;
private SegmentOptions options;
-
-
+
+
/**
* The magic header for a Pack200 Segment is 0xCAFED00D. I wonder where they
* get their inspiration from ...
@@ -81,7 +81,7 @@
* get their inspiration from ...
*/
private static final int[] magic = { 0xCA, 0xFE, 0xD0, 0x0D };
-
+
public void unpack(InputStream in) throws IOException,
Pack200Exception, Error, Pack200Exception {
long word[] = decodeScalar("archive_magic_word", in, Codec.BYTE1,
@@ -99,7 +99,7 @@
parseArchiveSpecialCounts(in);
parseCpCounts(in);
parseClassCounts(in);
-
+
if (getBandHeadersSize() > 0) {
byte[] bandHeaders = new byte[(int) getBandHeadersSize()];
readFully(in, bandHeaders);
@@ -106,10 +106,10 @@
setBandHeadersData(bandHeaders);
}
}
-
+
/**
* Sets the minor version of this archive
- *
+ *
* @param version
* the minor version of the archive
* @throws Pack200Exception
@@ -120,10 +120,10 @@
throw new Pack200Exception("Invalid segment minor version");
archiveMinor = version;
}
-
+
/**
* Sets the major version of this archive.
- *
+ *
* @param version
* the minor version of the archive
* @throws Pack200Exception
@@ -134,7 +134,7 @@
throw new Pack200Exception("Invalid segment major version: " + version);
archiveMajor = version;
}
-
+
public long getArchiveModtime() {
return archiveModtime;
}
@@ -222,7 +222,7 @@
public long getArchiveSize() {
return archiveSize;
}
-
+
/**
* Obtain the band headers data as an input stream. If no band headers are
* present, this will return an empty input stream to prevent any further
@@ -227,11 +227,11 @@
* Obtain the band headers data as an input stream. If no band headers are
* present, this will return an empty input stream to prevent any further
* reads taking place.
- *
+ *
* Note that as a stream, data consumed from this input stream can't be
* re-used. Data is only read from this stream if the encoding is such that
* additional information needs to be decoded from the stream itself.
- *
+ *
* @return the band headers input stream
*/
public InputStream getBandHeadersInputStream() {
@@ -241,19 +241,19 @@
return bandHeadersInputStream;
}
-
+
public int getNumberOfFiles() {
return numberOfFiles;
}
-
+
public int getSegmentsRemaining() {
return segmentsRemaining;
}
-
+
public SegmentOptions getOptions() {
return options;
}
-
+
private void parseArchiveFileCounts(InputStream in) throws IOException,
Pack200Exception {
if (options.hasArchiveFileCounts()) {
@@ -276,7 +276,7 @@
in, Codec.UNSIGNED5));
}
}
-
+
private void parseClassCounts(InputStream in) throws IOException,
Pack200Exception {
innerClassCount = (int)decodeScalar("ic_count", in, Codec.UNSIGNED5);
@@ -286,7 +286,7 @@
Codec.UNSIGNED5);
classCount = (int)decodeScalar("class_count", in, Codec.UNSIGNED5);
}
-
+
private void parseCpCounts(InputStream in) throws IOException,
Pack200Exception {
cpUTF8Count = (int)decodeScalar("cp_Utf8_count", in, Codec.UNSIGNED5);
@@ -306,11 +306,11 @@
cpMethodCount = (int)decodeScalar("cp_Method_count", in, Codec.UNSIGNED5);
cpIMethodCount = (int)decodeScalar("cp_Imethod_count", in, Codec.UNSIGNED5);
}
-
+
/**
* Decode a number of scalars from the band file. A scalar is like a band,
* but does not perform any band code switching.
- *
+ *
* @param name
* the name of the scalar (primarily for logging/debugging
* purposes)
@@ -332,11 +332,11 @@
debug("Parsed #" + name + " (" + n + ")");
return codec.decode(n, in);
}
-
+
/**
* Decode a scalar from the band file. A scalar is like a band, but does not
* perform any band code switching.
- *
+ *
* @param name
* the name of the scalar (primarily for logging/debugging
* purposes)
@@ -358,7 +358,7 @@
debug("Parsed #" + name + " as " + ret);
return ret;
}
-
+
public void setArchiveModtime(long archiveModtime) {
this.archiveModtime = archiveModtime;
}
@@ -370,7 +370,7 @@
private void setAttributeDefinitionCount(long valuie) {
this.attributeDefinitionCount = (int) valuie;
}
-
+
private void setBandHeadersData(byte[] bandHeaders) {
this.bandHeadersInputStream = new ByteArrayInputStream(bandHeaders);
}
@@ -378,7 +378,7 @@
public void setSegmentsRemaining(long value) {
segmentsRemaining = (int) value;
}
-
+
/**
* Completely reads in a byte array, akin to the implementation in
* {@link java.lang.DataInputStream}. TODO Refactor out into a separate
@@ -383,7 +383,7 @@
* Completely reads in a byte array, akin to the implementation in
* {@link java.lang.DataInputStream}. TODO Refactor out into a separate
* InputStream handling class
- *
+ *
* @param in
* the input stream to read from
* @param data
@@ -411,7 +411,7 @@
public int getBandHeadersSize() {
return bandHeadersSize;
}
-
+
protected void debug(String message) {
if (System.getProperty("debug.pack200") != null) {
System.err.println(message);
Index: src/main/java/org/apache/harmony/pack200/SegmentOptions.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/SegmentOptions.java (revision 587112)
+++ src/main/java/org/apache/harmony/pack200/SegmentOptions.java (working copy)
@@ -61,7 +61,7 @@
/**
* Creates a new segment options with the given integer value.
- *
+ *
* @param options
* the integer value to use as the flags
* @throws Pack200Exception
Index: src/main/java/org/apache/harmony/pack200/SegmentUtils.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/SegmentUtils.java (revision 608794)
+++ src/main/java/org/apache/harmony/pack200/SegmentUtils.java (working copy)
@@ -18,7 +18,7 @@
// TODO Write doc
public final class SegmentUtils {
-
+
public static int countArgs(String descriptor) {
return countArgs(descriptor, 1);
// int bra = descriptor.indexOf("(");
@@ -47,7 +47,7 @@
public static int countInvokeInterfaceArgs(String descriptor) {
return countArgs(descriptor, 2);
}
-
+
/**
* Count the number of arguments in the descriptor. Each
* long or double counts as widthOfLongsAndDoubles; all other
@@ -94,7 +94,7 @@
}
return count;
}
-
+
public static int countMatches(long[] flags, IMatcher matcher) {
int count = 0;
for (int i = 0; i < flags.length; i++) {
@@ -103,7 +103,7 @@
}
return count;
}
-
+
public static int countBit16(int[] flags) {
int count = 0;
for (int i = 0; i < flags.length; i++) {
@@ -112,7 +112,7 @@
}
return count;
}
-
+
public static int countBit16(long[] flags) {
int count = 0;
for (int i = 0; i < flags.length; i++) {
@@ -121,7 +121,7 @@
}
return count;
}
-
+
public static int countBit16(long[][] flags) {
int count = 0;
for (int i = 0; i < flags.length; i++) {
@@ -128,7 +128,7 @@
for (int j = 0; j < flags[i].length; j++) {
if ((flags[i][j] & (1 << 16)) != 0)
count++;
- }
+ }
}
return count;
}
@@ -144,7 +144,7 @@
private SegmentUtils() {
// Intended to be a helper class
}
-
+
/**
* This is a debugging message to aid the developer in writing this
* class. If the property 'debug.pack200' is set, this will
@@ -149,7 +149,7 @@
* This is a debugging message to aid the developer in writing this
* class. If the property 'debug.pack200' is set, this will
* generate messages to stderr; otherwise, it will be silent.
- *
+ *
* @param message
* @deprecated this may be removed from production code
*/
Index: src/main/java/org/apache/harmony/pack200/bytecode/AnnotationDefaultAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/AnnotationDefaultAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/AnnotationDefaultAttribute.java (working copy)
@@ -38,7 +38,7 @@
protected void writeBody(DataOutputStream dos) throws IOException {
element_value.writeBody(dos);
}
-
+
protected void resolve(ClassConstantPool pool) {
super.resolve(pool);
element_value.resolve(pool);
Index: src/main/java/org/apache/harmony/pack200/bytecode/AnnotationsAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/AnnotationsAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/AnnotationsAttribute.java (working copy)
@@ -24,7 +24,7 @@
*/
public abstract class AnnotationsAttribute extends Attribute {
-
+
/**
* Class to represent the annotation structure for class file attributes
*/
@@ -29,7 +29,7 @@
* Class to represent the annotation structure for class file attributes
*/
public static class Annotation {
-
+
private int num_pairs;
private CPUTF8[] element_names;
private ElementValue[] element_values;
@@ -34,12 +34,12 @@
private CPUTF8[] element_names;
private ElementValue[] element_values;
private CPUTF8 type;
-
+
// Resolved values
private int type_index;
private int[] name_indexes;
-
-
+
+
public Annotation(int num_pairs, CPUTF8 type, CPUTF8[] element_names, ElementValue[] element_values) {
this.num_pairs = num_pairs;
this.type = type;
@@ -46,7 +46,7 @@
this.element_names = element_names;
this.element_values = element_values;
}
-
+
public int getLength() {
int length = 4;
for (int i = 0; i < num_pairs; i++) {
@@ -55,7 +55,7 @@
}
return length;
}
-
+
public void resolve(ClassConstantPool pool) {
type.resolve(pool);
type_index = pool.indexOf(type);
@@ -75,17 +75,17 @@
element_values[i].writeBody(dos);
}
}
-
+
}
public static class ElementValue {
-
+
private Object value;
private int tag;
-
+
// resolved value index if it's a constant
private int constant_value_index = -1;
-
+
public ElementValue(int tag, Object value) {
this.tag = tag;
this.value = value;
@@ -90,7 +90,7 @@
this.tag = tag;
this.value = value;
}
-
+
public void resolve(ClassConstantPool pool) {
if(value instanceof CPConstant) {
((CPConstant)value).resolve(pool);
@@ -100,7 +100,7 @@
constant_value_index = pool.indexOf((CPClass)value);
} else if (value instanceof CPNameAndType) {
((CPNameAndType)value).resolve(pool);
- } else if (value instanceof Annotation) {
+ } else if (value instanceof Annotation) {
((Annotation)value).resolve(pool);
} else if (value instanceof ElementValue[]) {
ElementValue[] nestedValues = (ElementValue[])value;
@@ -116,7 +116,7 @@
dos.writeShort(constant_value_index);
} else if (value instanceof CPNameAndType) {
((CPNameAndType)value).writeBody(dos);
- } else if (value instanceof Annotation) {
+ } else if (value instanceof Annotation) {
((Annotation)value).writeBody(dos);
} else if (value instanceof ElementValue[]) {
ElementValue[] nestedValues = (ElementValue[])value;
@@ -158,6 +158,6 @@
super(attributeName);
}
-
+
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java (working copy)
@@ -62,7 +62,7 @@
* when attributes are nested within other attributes - the outer attribute
* needs to take the inner attribute headers into account when calculating
* its length.
- *
+ *
* @return int adjusted length
*/
protected int getLengthIncludingHeader() {
@@ -76,7 +76,7 @@
/**
* Answer true if the receiver needs to have BCI renumbering applied to it;
* otherwise answer false.
- *
+ *
* @return boolean BCI renumbering required
*/
public boolean hasBCIRenumbering() {
Index: src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java (working copy)
@@ -25,7 +25,7 @@
public abstract class BCIRenumberedAttribute extends Attribute {
protected boolean renumbered = false;
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.Attribute#hasBCIRenumbering()
*/
@@ -32,11 +32,11 @@
public boolean hasBCIRenumbering() {
return true;
}
-
+
public BCIRenumberedAttribute(String attributeName) {
super(attributeName);
}
-
+
protected abstract int getLength();
protected abstract void writeBody(DataOutputStream dos) throws IOException;
public abstract String toString();
@@ -41,7 +41,7 @@
protected abstract void writeBody(DataOutputStream dos) throws IOException;
public abstract String toString();
protected abstract int[] getStartPCs();
-
+
/**
* In Pack200, line number tables are BCI renumbered.
* This method takes the byteCodeOffsets (which is
@@ -49,7 +49,7 @@
* byte code array of each instruction) and updates the
* start_pcs so that it points to the instruction index
* itself, not the BCI renumbering of the instruction.
- *
+ *
* @param byteCodeOffsets List of Integer offsets of the bytecode array
*/
public void renumber(List byteCodeOffsets) {
Index: src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java (working copy)
@@ -124,15 +124,15 @@
for(int index = 0; index < nested.length; index++) {
int argLength = getNestedPosition(index)[1];
switch(argLength) {
-
+
case 1:
setOperandByte(pool.indexOf(nested[index]), getNestedPosition(index)[0]);
break;
-
- case 2:
+
+ case 2:
setOperand2Bytes(pool.indexOf(nested[index]), getNestedPosition(index)[0]);
break;
-
+
case 4:
// TODO: need to handle wides?
SegmentUtils.debug("Need to handle wides");
@@ -138,8 +138,8 @@
SegmentUtils.debug("Need to handle wides");
// figure out and if so, handle and put a break here.
// break;
-
- default:
+
+ default:
SegmentUtils.debug("Unhandled resolve " + this);
}
}
@@ -153,7 +153,7 @@
* operand to be the appropriate values. All values in
* operands[] will be masked with 0xFF so they fit into
* a byte.
- * @param operands int[] rewrite operand bytes
+ * @param operands int[] rewrite operand bytes
*/
public void setOperandBytes(int[] operands) {
int firstOperandIndex = getByteCodeForm().firstOperandIndex();
@@ -162,11 +162,11 @@
// No operand rewriting permitted for this bytecode
throw new Error("Trying to rewrite " + this + " that has no rewrite");
}
-
+
if(byteCodeFormLength != operands.length) {
throw new Error("Trying to rewrite " + this + " with " + operands.length + " but bytecode has length " + byteCodeForm.operandLength());
}
-
+
for(int index=0; index < byteCodeFormLength; index++) {
rewrite[index + firstOperandIndex] = operands[index] & 0xFF;
}
@@ -171,7 +171,7 @@
rewrite[index + firstOperandIndex] = operands[index] & 0xFF;
}
}
-
+
/**
* Given an int operand, set the rewrite bytes for
* that position and the one immediately following it
@@ -176,9 +176,9 @@
* Given an int operand, set the rewrite bytes for
* that position and the one immediately following it
* to a high-byte, low-byte encoding of the operand.
- *
+ *
* @param operand int to set the rewrite bytes to
- * @param position int position in the operands of the
+ * @param position int position in the operands of the
* rewrite bytes. For a rewrite array of {100, -1, -1, -1}
* position 0 is the first -1, position 1 is the second -1,
* etc.
@@ -190,15 +190,15 @@
// No operand rewriting permitted for this bytecode
throw new Error("Trying to rewrite " + this + " that has no rewrite");
}
-
+
if(firstOperandIndex + position + 1 > byteCodeFormLength) {
throw new Error("Trying to rewrite " + this + " with an int at position " + position + " but this won't fit in the rewrite array");
}
-
+
rewrite[firstOperandIndex + position] = (operand & 0xFF00) >> 8;
rewrite[firstOperandIndex + position + 1] = operand & 0xFF;
}
-
+
/**
* This is just like setOperandInt, but takes special care when the
* operand is less than 0 to make sure it's written correctly.
@@ -218,9 +218,9 @@
* Given an int operand, treat it as a byte and set
* the rewrite byte for that position to that value.
* Mask of anything beyond 0xFF.
- *
+ *
* @param operand int to set the rewrite byte to (unsigned)
- * @param position int position in the operands of the
+ * @param position int position in the operands of the
* rewrite bytes. For a rewrite array of {100, -1, -1, -1}
* position 0 is the first -1, position 1 is the second -1,
* etc.
@@ -232,23 +232,23 @@
// No operand rewriting permitted for this bytecode
throw new Error("Trying to rewrite " + this + " that has no rewrite");
}
-
+
if(firstOperandIndex + position > byteCodeFormLength) {
throw new Error("Trying to rewrite " + this + " with an byte at position " + position + " but this won't fit in the rewrite array");
}
-
- rewrite[firstOperandIndex + position] = operand & 0xFF;
+
+ rewrite[firstOperandIndex + position] = operand & 0xFF;
}
-
-
+
+
public String toString() {
return getByteCodeForm().getName();
}
-
+
public void setNested(ClassFileEntry[] nested) {
this.nested = nested;
}
-
+
/**
* nestedPositions is an array of arrays of ints. Each
* subarray specifies a position of a nested
@@ -254,7 +254,7 @@
* subarray specifies a position of a nested
* element (from the nested[] array) and the length of
* that element.
- *
+ *
* For instance, one might have a nested of:
* {CPClass java/lang/Foo, CPFloat 3.14}
* The nestedPositions would then be:
@@ -265,7 +265,7 @@
* occurrences of -1). The CPFloat will be resolved to
* an int position and inserted at positions 2 and 3 of
* the rewrite arguments.
- *
+ *
* @param nestedPositions
*/
public void setNestedPositions(int[][] nestedPositions) {
@@ -271,11 +271,11 @@
public void setNestedPositions(int[][] nestedPositions) {
this.nestedPositions = nestedPositions;
}
-
+
public int[][] getNestedPositions() {
return nestedPositions;
}
-
+
public int[] getNestedPosition(int index) {
return getNestedPositions()[index];
}
@@ -285,7 +285,7 @@
* a multi-bytecode instruction (such as
* aload0_putfield_super); otherwise, it will answer
* false.
- *
+ *
* @return boolean true if multibytecode, false otherwise
*/
public boolean hasMultipleByteCodes() {
@@ -298,10 +298,10 @@
* to know where they are in order to calculate their
* targets). This method lets the CodeAttribute specify
* where the byte code is.
- *
+ *
* Since there are no aload0+label instructions, this
* method doesn't worry about multioperation bytecodes.
- *
+ *
* @param byteCodeOffset int position in code array.
*/
public void setByteCodeIndex(int byteCodeOffset) {
@@ -312,7 +312,7 @@
public int getByteCodeIndex() {
return byteCodeOffset;
}
-
+
/**
* Some ByteCodes (in particular, those with labels)
* have to keep track of byteCodeTargets. These are
@@ -320,7 +320,7 @@
* relative to the byteCodeOffset, but later get fixed
* up to point to the absolute position in the CodeAttribute
* array. This method sets the targets.
- *
+ *
* @param byteCodeTarget int index in array
*/
public void setByteCodeTargets(int[] byteCodeTargets) {
@@ -326,11 +326,11 @@
public void setByteCodeTargets(int[] byteCodeTargets) {
this.byteCodeTargets = byteCodeTargets;
}
-
+
public int[] getByteCodeTargets() {
return byteCodeTargets;
}
-
+
/**
* Some ByteCodes (in particular, those with labels
* need to be fixed up after all the bytecodes in the
@@ -346,11 +346,11 @@
* Some bytecodes (the ones with variable lengths) can't
* have a static rewrite array - they need the ability to
* update the array. This method permits that.
- *
+ *
* Note that this should not be called from bytecodes
* which have a static rewrite; use the table in ByteCodeForm
* instead to specify those rewrites.
- *
+ *
* @param rewrite
*/
public void setRewrite(int[] rewrite) {
@@ -356,7 +356,7 @@
public void setRewrite(int[] rewrite) {
this.rewrite = rewrite;
}
-
+
/**
* Some bytecodes (the ones with variable lengths) can't
* have a static rewrite array - they need the ability to
@@ -362,7 +362,7 @@
* have a static rewrite array - they need the ability to
* update the array. This method permits their associated
* bytecode formst to query their rewrite array.
- *
+ *
* Note that this should not be called from bytecodes
* which have a static rewrite; use the table in ByteCodeForm
* instead to specify those rewrites.
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java (working copy)
@@ -34,7 +34,7 @@
this.utf8 = new CPUTF8(name, ClassConstantPool.DOMAIN_NORMALASCIIZ);
}
-
+
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -60,7 +60,7 @@
return new ClassFileEntry[] { utf8, };
}
-
+
public int hashCode() {
final int PRIME = 31;
int result = 1;
@@ -81,11 +81,11 @@
public String getName() {
return name;
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeShort(index);
}
-
+
public String comparisonString() {
return getName();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java (working copy)
@@ -26,7 +26,7 @@
this.value = value;
}
-
+
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -43,7 +43,7 @@
return true;
}
-
+
public int hashCode() {
final int PRIME = 31;
int result = 1;
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java (working copy)
@@ -25,7 +25,7 @@
this.domain = ClassConstantPool.DOMAIN_DOUBLE;
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeDouble(getNumber().doubleValue());
}
@@ -30,7 +30,7 @@
dos.writeDouble(getNumber().doubleValue());
}
-
+
public String toString() {
return "Double: " + getValue();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java (working copy)
@@ -36,7 +36,7 @@
}
-
+
protected ClassFileEntry[] getNestedClassFileEntries() {
return new ClassFileEntry[] {className, nameAndType};
}
@@ -42,7 +42,7 @@
}
-
+
protected void resolve(ClassConstantPool pool) {
super.resolve(pool);
nameAndTypeIndex = pool.indexOf(nameAndType);
@@ -54,7 +54,7 @@
dos.writeShort(nameAndTypeIndex);
}
-
+
public String toString() {
return "FieldRef: " + className + "#" + nameAndType;
}
@@ -60,7 +60,7 @@
}
-
+
public int hashCode() {
final int PRIME = 31;
int result = 1;
@@ -70,7 +70,7 @@
}
-
+
public boolean equals(Object obj) {
if (this == obj)
return true;
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java (working copy)
@@ -25,7 +25,7 @@
this.domain = ClassConstantPool.DOMAIN_FLOAT;
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeFloat(getNumber().floatValue());
}
@@ -30,7 +30,7 @@
dos.writeFloat(getNumber().floatValue());
}
-
+
public String toString() {
return "Float: " + getValue();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java (working copy)
@@ -26,7 +26,7 @@
this.domain = ClassConstantPool.DOMAIN_INTEGER;
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeInt(getNumber().intValue());
}
@@ -31,7 +31,7 @@
dos.writeInt(getNumber().intValue());
}
-
+
public String toString() {
return "Integer: " + getValue();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPInterfaceMethodRef.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPInterfaceMethodRef.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPInterfaceMethodRef.java (working copy)
@@ -28,7 +28,7 @@
* for an invokeinterface call. This is equal to 1 + the
* count of all the args, where longs and doubles count for
* 2 and all others count for 1.
- *
+ *
* @return integer count
*/
public int invokeInterfaceCount() {
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java (working copy)
@@ -26,7 +26,7 @@
this.domain = ClassConstantPool.DOMAIN_LONG;
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeLong(getNumber().longValue());
}
@@ -31,7 +31,7 @@
dos.writeLong(getNumber().longValue());
}
-
+
public String toString() {
return "Long: " + getValue();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java (working copy)
@@ -45,7 +45,7 @@
}
-
+
protected ClassFileEntry[] getNestedClassFileEntries() {
int attributeCount = attributes.size();
ClassFileEntry[] entries = new ClassFileEntry[attributeCount+2];
@@ -58,7 +58,7 @@
}
-
+
protected void resolve(ClassConstantPool pool) {
super.resolve(pool);
nameIndex = pool.indexOf(name);
@@ -69,7 +69,7 @@
}
}
-
+
public String toString() {
return "Field: " + name + "(" + descriptor + ")";
}
@@ -74,7 +74,7 @@
return "Field: " + name + "(" + descriptor + ")";
}
-
+
public int hashCode() {
final int PRIME = 31;
int result = 1;
@@ -86,7 +86,7 @@
}
-
+
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -116,7 +116,7 @@
}
-
+
protected void doWrite(DataOutputStream dos) throws IOException {
dos.writeShort(flags);
dos.writeShort(nameIndex);
@@ -127,7 +127,7 @@
Attribute attribute = (Attribute) attributes.get(i);
attribute.doWrite(dos);
}
-
+
}
}
\ No newline at end of file
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java (working copy)
@@ -68,7 +68,7 @@
return new ClassFileEntry[] { name, descriptor };
}
-
+
protected void resolve(ClassConstantPool pool) {
super.resolve(pool);
descriptorIndex = pool.indexOf(descriptor);
@@ -79,7 +79,7 @@
* field_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2
* attributes_count; attribute_info attributes[attributes_count]; }
*/
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeShort(nameIndex);
dos.writeShort(descriptorIndex);
@@ -85,7 +85,7 @@
dos.writeShort(descriptorIndex);
}
-
+
public String toString() {
return "NameAndType: " + name + "(" + descriptor + ")";
}
@@ -90,7 +90,7 @@
return "NameAndType: " + name + "(" + descriptor + ")";
}
-
+
public int hashCode() {
final int PRIME = 31;
int result = 1;
@@ -99,7 +99,7 @@
return result;
}
-
+
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -131,7 +131,7 @@
public int invokeInterfaceCount() {
return 1 + SegmentUtils.countInvokeInterfaceArgs(descriptor.underlyingString());
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.ConstantPoolEntry#comparisonString()
@@ -138,7 +138,7 @@
*/
public String comparisonString() {
// First come those things which don't have an
- // associated signature. Then come the native signatures,
+ // associated signature. Then come the native signatures,
// then finally the class signatures.
// TODO: I think Character.MAX_VALUE is no longer the
// biggest character, what with the weird codepage thing
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPRef.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPRef.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPRef.java (working copy)
@@ -81,7 +81,7 @@
// This one is tricky. The sorting appears to be
// done based on the indices of the method descriptor
// and class name in the classpool *after* sorting them.
-
+
// If we haven't yet been resolved, just do a normal
// compare (so things like .contains() work).
if(!isResolved()) {
@@ -87,7 +87,7 @@
if(!isResolved()) {
return super.comparisonString();
}
-
+
// If we get here, the receiver has been resolved; there
// is a different sort order.
StringBuffer result = new StringBuffer();
@@ -95,7 +95,7 @@
int padLength = 6;
int classIndexLength = ("" + classNameIndex).length();
int nameAndTypeIndexLength = ("" + nameAndTypeIndex).length();
-
+
for(int index=0; index < (padLength - classIndexLength); index++) {
result.append('0');
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPString.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPString.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPString.java (working copy)
@@ -30,7 +30,7 @@
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeShort(nameIndex);
}
@@ -35,7 +35,7 @@
dos.writeShort(nameIndex);
}
-
+
public String toString() {
return "String: " + getValue();
}
@@ -42,7 +42,7 @@
/**
* Allows the constant pool entries to resolve their nested entries
- *
+ *
* @param pool
*/
protected void resolve(ClassConstantPool pool) {
Index: src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java (working copy)
@@ -44,7 +44,7 @@
return false;
return true;
}
-
+
public int hashCode() {
final int PRIME = 31;
int result = 1;
@@ -76,7 +76,7 @@
public String underlyingString() {
return utf8;
}
-
+
public String comparisonString() {
// Should use either normalComparisonString or signatureComparisonString.
// If we get here, that might indicate an error.
Index: src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java (working copy)
@@ -26,7 +26,7 @@
public class ClassConstantPool {
-
+
class PoolComparator implements Comparator {
/* (non-Javadoc)
* Note: this comparator imposes orderings that are inconsistent with equals.
@@ -40,7 +40,7 @@
int domain1 = cpe1.getDomain();
int domain2 = cpe2.getDomain();
-
+
if(domain1 < domain2) {
return -1;
}
@@ -47,7 +47,7 @@
if(domain1 > domain2) {
return 1;
}
-
+
// Domains must be the same, need to compare
// based on name.
// TODO: what means name?
@@ -92,7 +92,7 @@
// We don't want duplicates.
// Only add in constant pools, but resolve all types since they may
// introduce new constant pool entries
-// This is a handy way to see what's adding a ClassFileEntry - set a breakpoint on the print
+// This is a handy way to see what's adding a ClassFileEntry - set a breakpoint on the print
// if(entry instanceof CPUTF8) {
// System.out.println("AAH:" + ((CPUTF8)entry).comparisonString());
// if (((CPUTF8)entry).underlyingString().matches("Code")) {
@@ -156,7 +156,7 @@
}
resolve();
}
-
+
public void resolve() {
resolved= true;
Iterator it = entries.iterator();
@@ -169,7 +169,7 @@
ClassFileEntry entry = (ClassFileEntry) it.next();
entry.resolve(this);
}
-
+
// Now that everything has been resolved, do one
// final sort of the class pool. This fixes up
// references, which are sorted by index in the
Index: src/main/java/org/apache/harmony/pack200/bytecode/ClassFileEntry.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ClassFileEntry.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ClassFileEntry.java (working copy)
@@ -35,7 +35,7 @@
/**
* Allows the constant pool entries to resolve their nested entries
- *
+ *
* @param pool
*/
protected void resolve(ClassConstantPool pool) {
@@ -45,7 +45,7 @@
protected boolean isResolved() {
return resolved;
}
-
+
public abstract String toString();
public final void write(DataOutputStream dos) throws IOException {
Index: src/main/java/org/apache/harmony/pack200/bytecode/ClassPoolSet.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ClassPoolSet.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ClassPoolSet.java (working copy)
@@ -32,7 +32,7 @@
/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
- public int compare(Object o1, Object o2) {
+ public int compare(Object o1, Object o2) {
if(o1.equals(o2)) {
return 0;
}
@@ -53,7 +53,7 @@
// with this comparator, it is an error.
ConstantPoolEntry cpe1 = (ConstantPoolEntry)o1;
ConstantPoolEntry cpe2 = (ConstantPoolEntry)o2;
-
+
// Domains must be the same, need to compare
// based on comparisonString.
String compare1 = cpe1.comparisonString();
@@ -71,7 +71,7 @@
if(classCompare != 0) {
return classCompare;
}
-
+
// Now that we've reached this point, we're
// comparing objects of the same class. Since
// they have the same class, we can make the
@@ -96,7 +96,7 @@
if(classCompare != 0) {
return classCompare;
}
-
+
// Now that we've reached this point, we're
// comparing objects of the same class. Since
// they have the same class, we can make the
@@ -130,7 +130,7 @@
comparators[ClassConstantPool.DOMAIN_FIELD] = new PoolComparator();
comparators[ClassConstantPool.DOMAIN_METHOD] = new PoolComparator();
comparators[ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ] = new NormalAsciizComparator();
-
+
for(int index=0; index < ClassConstantPool.NUM_DOMAINS; index++) {
sets[index] = new TreeSet(comparators[index]);
}
@@ -135,8 +135,8 @@
sets[index] = new TreeSet(comparators[index]);
}
}
-
-
+
+
/**
* Answer the index of the first set which contains the entry
* passed in as the parameter.
@@ -151,7 +151,7 @@
}
return -1;
}
-
+
/**
* @param set
* @param testEntry
@@ -176,7 +176,7 @@
* that. If the parameter exists in a lower precedence
* domain, remove it from the lower domain and add it to
* the higher one.
- *
+ *
* @param entry ConstantPoolEntry to add
* @return ConstantPoolEntry from the domain where it's stored
*/
@@ -184,7 +184,7 @@
ConstantPoolEntry cpEntry = (ConstantPoolEntry)entry;
int entryDomain = cpEntry.getDomain();
int currentStoredDomain = findFirstSetContaining(cpEntry);
-
+
if(currentStoredDomain < 0) {
// Entry is not currently stored; just store it.
sets[entryDomain].add(cpEntry);
@@ -190,7 +190,7 @@
sets[entryDomain].add(cpEntry);
return cpEntry;
}
-
+
if(currentStoredDomain <= entryDomain) {
// Entry is either already in this place
// or in a higher-precedence (numerically lower)
@@ -198,7 +198,7 @@
// domain.
return getStoredEntry(currentStoredDomain, cpEntry);
}
-
+
// Entry is in a lower-precedence (numerically higher)
// domain. Need to remove it from the lower-precedence
// domain and add it to the higher precedence domain.
@@ -228,6 +228,6 @@
for(int index=start; index <= stop; index++) {
someElements.addAll(sets[index]);
}
- return someElements.iterator();
+ return someElements.iterator();
}
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/CodeAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/CodeAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/CodeAttribute.java (working copy)
@@ -84,7 +84,7 @@
byteCode.applyByteCodeTargetFixup(this);
}
// TODO: By the time I get here, the input stream
- // is somehow confused.
+ // is somehow confused.
}
protected int getLength() {
@@ -125,7 +125,7 @@
}
for (Iterator iter = exceptionTable.iterator(); iter.hasNext();) {
ExceptionTableEntry entry = (ExceptionTableEntry) iter.next();
- entry.resolve(pool);
+ entry.resolve(pool);
}
}
@@ -160,7 +160,7 @@
public void addAttribute(Attribute attribute) {
attributes.add(attribute);
}
-
+
public List attributes() {
return attributes;
}
@@ -173,7 +173,7 @@
public void renumber(List byteCodeOffsets) {
for (Iterator iter = exceptionTable.iterator(); iter.hasNext();) {
ExceptionTableEntry entry = (ExceptionTableEntry) iter.next();
- entry.renumber(byteCodeOffsets);
+ entry.renumber(byteCodeOffsets);
}
}
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/ConstantPoolEntry.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ConstantPoolEntry.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ConstantPoolEntry.java (working copy)
@@ -20,7 +20,7 @@
import java.io.IOException;
/**
- *
+ *
*/
public abstract class ConstantPoolEntry extends ClassFileEntry {
public static final byte CP_Class = 7;
@@ -35,9 +35,9 @@
/*
* class MemberRef extends ConstantPoolEntry { private int index;
- *
+ *
* Class(String name) { super(CP_Class); index = pool.indexOf(name); }
- *
+ *
* void writeBody(DataOutputStream dos) throws IOException {
* dos.writeShort(index); } }
*/
@@ -76,11 +76,11 @@
public int getDomain() {
return domain;
}
-
+
public void setDomain(int newDomain) {
this.domain = newDomain;
}
-
+
public abstract int hashCode();
public void doWrite(DataOutputStream dos) throws IOException {
Index: src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java (working copy)
@@ -41,7 +41,7 @@
}
}
-
+
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -58,7 +58,7 @@
return true;
}
-
+
protected int getLength() {
return 2;
}
@@ -67,7 +67,7 @@
return new ClassFileEntry[] { getAttributeName(), entry };
}
-
+
public int hashCode() {
final int PRIME = 31;
int result = super.hashCode();
@@ -85,7 +85,7 @@
return "Constant:" + entry;
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeShort(constantIndex);
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/EnclosingMethodAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/EnclosingMethodAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/EnclosingMethodAttribute.java (working copy)
@@ -38,7 +38,7 @@
protected int getLength() {
return 4;
}
-
+
protected void resolve(ClassConstantPool pool) {
super.resolve(pool);
cpClass.resolve(pool);
Index: src/main/java/org/apache/harmony/pack200/bytecode/ExceptionTableEntry.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ExceptionTableEntry.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ExceptionTableEntry.java (working copy)
@@ -25,7 +25,7 @@
private int startPC;
private int endPC;
private int handlerPC;
- private CPClass catchType;
+ private CPClass catchType;
private int startPcRenumbered;
private int endPcRenumbered;
@@ -45,7 +45,7 @@
dos.writeShort(handlerPcRenumbered);
dos.writeShort(catchTypeIndex);
}
-
+
public void renumber(List byteCodeOffsets) {
startPcRenumbered = ((Integer)byteCodeOffsets.get(startPC)).intValue();
int endPcIndex = startPC + endPC;
@@ -53,7 +53,7 @@
int handlerPcIndex = endPcIndex + handlerPC;
handlerPcRenumbered = ((Integer)byteCodeOffsets.get(handlerPcIndex)).intValue();
}
-
+
public void resolve(ClassConstantPool pool) {
catchType.resolve(pool);
catchTypeIndex = pool.indexOf(catchType);
Index: src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java (working copy)
@@ -44,7 +44,7 @@
this.exceptions = exceptions;
}
-
+
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -58,7 +58,7 @@
return true;
}
-
+
protected int getLength() {
return 2 + 2 * exceptions.length;
}
@@ -68,11 +68,11 @@
for (int i = 0; i < exceptions.length; i++) {
result[i] = exceptions[i];
}
- result[exceptions.length] = getAttributeName();
+ result[exceptions.length] = getAttributeName();
return result;
}
-
+
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
@@ -93,7 +93,7 @@
return "Exceptions:" + exceptions;
}
-
+
protected void writeBody(DataOutputStream dos) throws IOException {
dos.writeShort(exceptionIndexes.length);
for (int i = 0; i < exceptionIndexes.length; i++) {
Index: src/main/java/org/apache/harmony/pack200/bytecode/LineNumberTableAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/LineNumberTableAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/LineNumberTableAttribute.java (working copy)
@@ -24,7 +24,7 @@
private int line_number_table_length;
private int[] start_pcs;
private int[] line_numbers;
-
+
public LineNumberTableAttribute(int line_number_table_length, int[] start_pcs, int[] line_numbers) {
super("LineNumberTable");
this.line_number_table_length = line_number_table_length;
@@ -57,7 +57,7 @@
protected ClassFileEntry[] getNestedClassFileEntries() {
return new ClassFileEntry[] {getAttributeName()};
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.Attribute#resolve(org.apache.harmony.pack200.bytecode.ClassConstantPool)
*/
Index: src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java (working copy)
@@ -70,9 +70,9 @@
ClassFileEntry[] nestedEntryArray = new ClassFileEntry[nestedEntries
.size()];
nestedEntries.toArray(nestedEntryArray);
- return nestedEntryArray;
+ return nestedEntryArray;
}
-
+
protected void resolve(ClassConstantPool pool) {
super.resolve(pool);
name_indexes = new int[local_variable_table_length];
@@ -84,7 +84,7 @@
descriptor_indexes[i] = pool.indexOf(descriptors[i]);
}
}
-
+
public String toString() {
return "LocalVariableTable: " + + local_variable_table_length + " variables";
}
@@ -115,7 +115,7 @@
// First figure out the maximum size of the byteCodeOffsets array
int lastInstruction = ((Integer)byteCodeOffsets.get(byteCodeOffsets.size() - 1)).intValue();
int maxSize = lastInstruction + 1;
-
+
// Iterate through the lengths and update each in turn.
// This is done in place in the lengths array.
for(int index=0; index < lengths.length; index++) {
@@ -122,7 +122,7 @@
int start_pc = start_pcs[index];
int revisedLength = -1;
int encodedLength = lengths[index];
-
+
// First get the index of the start_pc in the byteCodeOffsets
int indexOfStartPC = unrenumbered_start_pcs[index];
// Given the index of the start_pc, we can now add
@@ -128,7 +128,7 @@
// Given the index of the start_pc, we can now add
// the encodedLength to it to get the stop index.
int stopIndex = indexOfStartPC + encodedLength;
-
+
// 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.
if(stopIndex == byteCodeOffsets.size()) {
@@ -137,7 +137,7 @@
} else {
// We're indexed into the byte code array
int stopValue = ((Integer)byteCodeOffsets.get(stopIndex)).intValue();
- revisedLength = stopValue - start_pc;
+ revisedLength = stopValue - start_pc;
}
lengths[index] = revisedLength;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTypeTableAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTypeTableAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTypeTableAttribute.java (working copy)
@@ -69,7 +69,7 @@
signature_indexes[i] = pool.indexOf(signatures[i]);
}
}
-
+
public String toString() {
return "LocalVariableTypeTable: " + + local_variable_type_table_length + " varaibles";
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/NewAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/NewAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/NewAttribute.java (working copy)
@@ -26,7 +26,7 @@
* A New (i.e. non-predefined) Class File attribute
*/
public class NewAttribute extends BCIRenumberedAttribute {
-
+
private List lengths = new ArrayList(); // List of Integers
private List body = new ArrayList();
private ClassConstantPool pool;
@@ -135,7 +135,7 @@
lengths.add(new Integer(length));
body.add(ref);
}
-
+
protected void resolve(ClassConstantPool pool) {
super.resolve(pool);
for (Iterator iter = body.iterator(); iter.hasNext();) {
@@ -146,9 +146,9 @@
}
this.pool = pool;
}
-
+
private static class BCOffset extends BCValue {
-
+
private int offset;
private int index;
@@ -161,9 +161,9 @@
}
}
-
+
private static class BCIndex extends BCValue {
-
+
private int index;
public BCIndex(int index) {
@@ -172,7 +172,7 @@
}
private static class BCLength extends BCValue {
-
+
private int length;
public BCLength(int length) {
@@ -179,7 +179,7 @@
this.length = length;
}
}
-
+
// Bytecode-related value (either a bytecode index or a length)
private static abstract class BCValue {
@@ -195,7 +195,7 @@
// Don't need to return anything here as we've overridden renumber
return null;
}
-
+
public void renumber(List byteCodeOffsets) {
if(!renumbered) {
Object previous = null;
@@ -209,14 +209,14 @@
if(previous instanceof BCIndex) {
int index = ((BCIndex)previous).index + bcOffset.offset;
bcOffset.setIndex(index);
- bcOffset.setActualValue(((Integer)byteCodeOffsets.get(index)).intValue());
+ bcOffset.setActualValue(((Integer)byteCodeOffsets.get(index)).intValue());
} else if(previous instanceof BCOffset) {
int index = ((BCOffset)previous).index + bcOffset.offset;
bcOffset.setIndex(index);
- bcOffset.setActualValue(((Integer)byteCodeOffsets.get(index)).intValue());
+ bcOffset.setActualValue(((Integer)byteCodeOffsets.get(index)).intValue());
} else {
// Not sure if this should be able to happen
- bcOffset.setActualValue(((Integer)byteCodeOffsets.get(bcOffset.offset)).intValue());
+ bcOffset.setActualValue(((Integer)byteCodeOffsets.get(bcOffset.offset)).intValue());
}
} else if (obj instanceof BCLength) {
// previous must be a BCIndex
@@ -224,7 +224,7 @@
BCIndex prevIndex = (BCIndex) previous;
int index = prevIndex.index + bcLength.length;
int actualLength = ((Integer)byteCodeOffsets.get(index)).intValue() - prevIndex.actualValue;
- bcLength.setActualValue(actualLength);
+ bcLength.setActualValue(actualLength);
}
previous = obj;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/OperandManager.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/OperandManager.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/OperandManager.java (working copy)
@@ -27,7 +27,7 @@
* in super, this and new references.
*/
public class OperandManager {
-
+
int[] bcCaseCount;
int[] bcCaseValue;
int[] bcByte;
@@ -49,7 +49,7 @@
int[] bcSuperMethod;
int[] bcInitRef;
int[] wideByteCodes;
-
+
int bcCaseCountIndex = 0;
int bcCaseValueIndex = 0;
int bcByteIndex = 0;
@@ -71,13 +71,13 @@
int bcSuperMethodIndex = 0;
int bcInitRefIndex = 0;
int wideByteCodeIndex = 0;
-
+
Segment segment = null;
-
+
String currentClass = null;
String superClass = null;
String newClass = null;
-
+
public OperandManager(int[] bcCaseCount, int[] bcCaseValue, int[] bcByte, int[] bcShort, int[] bcLocal, int[] bcLabel, int[] bcIntRef, int[] bcFloatRef, int[] bcLongRef, int[] bcDoubleRef, int[] bcStringRef, int[] bcClassRef, int[] bcFieldRef, int[] bcMethodRef, int[] bcIMethodRef, int[] bcThisField, int[] bcSuperField, int[] bcThisMethod, int[] bcSuperMethod, int[] bcInitRef, int[] wideByteCodes) {
this.bcCaseCount = bcCaseCount;
this.bcCaseValue = bcCaseValue;
@@ -102,67 +102,67 @@
this.bcInitRef = bcInitRef;
this.wideByteCodes = wideByteCodes;
}
-
+
public int nextCaseCount() {
- return bcCaseCount[bcCaseCountIndex++];
+ return bcCaseCount[bcCaseCountIndex++];
}
-
+
public int nextCaseValues() {
- return bcCaseValue[bcCaseValueIndex++];
+ return bcCaseValue[bcCaseValueIndex++];
}
-
+
public int nextByte() {
- return bcByte[bcByteIndex++];
+ return bcByte[bcByteIndex++];
}
-
+
public int nextShort() {
- return bcShort[bcShortIndex++];
+ return bcShort[bcShortIndex++];
}
-
+
public int nextLocal() {
- return bcLocal[bcLocalIndex++];
+ return bcLocal[bcLocalIndex++];
}
-
+
public int nextLabel() {
- return bcLabel[bcLabelIndex++];
+ return bcLabel[bcLabelIndex++];
}
-
+
public int nextIntRef() {
- return bcIntRef[bcIntRefIndex++];
+ return bcIntRef[bcIntRefIndex++];
}
-
+
public int nextFloatRef() {
- return bcFloatRef[bcFloatRefIndex++];
+ return bcFloatRef[bcFloatRefIndex++];
}
-
+
public int nextLongRef() {
- return bcLongRef[bcLongRefIndex++];
+ return bcLongRef[bcLongRefIndex++];
}
-
+
public int nextDoubleRef() {
- return bcDoubleRef[bcDoubleRefIndex++];
+ return bcDoubleRef[bcDoubleRefIndex++];
}
-
+
public int nextStringRef() {
- return bcStringRef[bcStringRefIndex++];
+ return bcStringRef[bcStringRefIndex++];
}
-
+
public int nextClassRef() {
- return bcClassRef[bcClassRefIndex++];
+ return bcClassRef[bcClassRefIndex++];
}
-
+
public int nextFieldRef() {
- return bcFieldRef[bcFieldRefIndex++];
+ return bcFieldRef[bcFieldRefIndex++];
}
-
+
public int nextMethodRef() {
- return bcMethodRef[bcMethodRefIndex++];
+ return bcMethodRef[bcMethodRefIndex++];
}
-
+
public int nextIMethodRef() {
- return bcIMethodRef[bcIMethodRefIndex++];
+ return bcIMethodRef[bcIMethodRefIndex++];
}
-
+
public int nextThisFieldRef() {
return bcThisField[bcThisFieldIndex++];
}
@@ -186,7 +186,7 @@
public int nextWideByteCode() {
return wideByteCodes[wideByteCodeIndex++];
}
-
+
public void setSegment(Segment segment) {
this.segment = segment;
}
@@ -193,11 +193,11 @@
public Segment getSegment() {
return segment;
}
-
+
public SegmentConstantPool globalConstantPool() {
return segment.getConstantPool();
}
-
+
public void setCurrentClass(String string) {
currentClass = string;
}
@@ -207,7 +207,7 @@
public void setNewClass(String string) {
newClass = string;
}
-
+
public String getCurrentClass() {
if(null==currentClass) {
throw new Error("Current class not set yet");
Index: src/main/java/org/apache/harmony/pack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java (working copy)
@@ -57,10 +57,10 @@
public String toString() {
return name + ": " + num_parameters + " parameter annotations";
}
-
+
public static class ParameterAnnotation {
-
+
private Annotation[] annotations;
private int num_annotations;
Index: src/main/java/org/apache/harmony/pack200/bytecode/SignatureAttribute.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/SignatureAttribute.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/SignatureAttribute.java (working copy)
@@ -20,7 +20,7 @@
import java.io.IOException;
public class SignatureAttribute extends Attribute {
-
+
private int signature_index;
private CPUTF8 signature;
@@ -41,7 +41,7 @@
signature.resolve(pool);
signature_index = pool.indexOf(signature);
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.Attribute#writeBody(java.io.DataOutputStream)
*/
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/ByteCodeForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/ByteCodeForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/ByteCodeForm.java (working copy)
@@ -56,9 +56,9 @@
protected static final int TYPE_SUPERINITMETHODREF=23;
protected static final int TYPE_NEWINITMETHODREF=24;
protected static final int TYPE_NEWCLASSREF=25;
-
+
protected static final boolean WIDENED = true;
-
+
protected static final Map byteCodes = new HashMap();
static {
ByteCodeForm[] byteCodeArray = new ByteCodeForm[256];
@@ -297,7 +297,7 @@
byteCodeArray[230] = new ThisInitMethodRefForm(230, "invokespecial_this_init", new int[] {183, -1, -1});
byteCodeArray[231] = new SuperInitMethodRefForm(231, "invokespecial_super_init", new int[] {183, -1, -1});
byteCodeArray[232] = new NewInitMethodRefForm(232, "invokespecial_new_init", new int[] {183, -1, -1});
- byteCodeArray[233] = new NarrowClassRefForm(233, "cldc", new int[] {18, -1});
+ byteCodeArray[233] = new NarrowClassRefForm(233, "cldc", new int[] {18, -1});
byteCodeArray[234] = new IntRefForm(234, "ildc", new int[] {18, -1});
byteCodeArray[235] = new FloatRefForm(235, "fldc", new int[] {18, -1});
byteCodeArray[236] = new NarrowClassRefForm(236, "cldc_w", new int[] {19, -1, -1}, WIDENED);
@@ -304,7 +304,7 @@
byteCodeArray[237] = new IntRefForm(237, "ildc_w", new int[] {19, -1, -1}, WIDENED);
byteCodeArray[238] = new FloatRefForm(238, "fldc_w", new int[] {19, -1, -1}, WIDENED);
byteCodeArray[239] = new DoubleForm(239, "dldc2_w", new int[] {20, -1, -1});
-
+
// Reserved bytecodes
byteCodeArray[254] = new NoArgumentForm(254, "impdep1");
byteCodeArray[255] = new NoArgumentForm(255, "impdep2");
@@ -312,7 +312,7 @@
// Bytecodes that aren't defined in the spec but are useful when
// unpacking (all must be >255)
// maybe wide versions of the others? etc.
-
+
// Put all the bytecodes in a HashMap so we can
// get them by either name or number
for (int i = 0; i < byteCodeArray.length; i++) {
@@ -323,7 +323,7 @@
}
}
}
-
+
private final int opcode;
private final String name;
private final int[] rewrite;
@@ -329,7 +329,7 @@
private final int[] rewrite;
private int firstOperandIndex;
private int operandLength;
-
+
/**
* Answer a new instance of this class with the specified
* opcode and name. Assume no rewrite.
@@ -339,7 +339,7 @@
public ByteCodeForm(int opcode, String name) {
this(opcode, name, new int[]{opcode});
}
-
+
/**
* Answer a new instance of this class with the specified
* opcode, name, operandType and rewrite
@@ -358,7 +358,7 @@
protected void calculateOperandPosition() {
firstOperandIndex = -1;
operandLength = -1;
-
+
// Find the first negative number in the rewrite array
int iterationIndex = 0;
while (iterationIndex < rewrite.length) {
@@ -395,19 +395,19 @@
}
operandLength = difference + 1;
}
-
+
public static ByteCodeForm get(int opcode) {
return (ByteCodeForm)byteCodes.get(new Integer(opcode));
}
-
+
public static ByteCodeForm get(String name) {
return (ByteCodeForm)byteCodes.get(name);
}
-
+
public String toString() {
return this.getClass().getName() + "(" + getName() + ":" + getOperandType() + ")";
}
-
+
public int getOpcode() {
return opcode;
}
@@ -419,11 +419,11 @@
public int getOperandType() {
return -1;
}
-
+
public int[] getRewrite() {
return rewrite;
}
-
+
public int[] getRewriteCopy() {
int[] result = new int[rewrite.length];
System.arraycopy(rewrite, 0, result, 0, rewrite.length);
@@ -429,11 +429,11 @@
System.arraycopy(rewrite, 0, result, 0, rewrite.length);
return result;
}
-
+
public int firstOperandIndex() {
return firstOperandIndex;
}
-
+
public int operandLength() {
return operandLength;
}
@@ -441,7 +441,7 @@
public boolean hasNoOperand() {
return false;
}
-
+
public boolean hasByteOperand() {
return false;
}
@@ -537,7 +537,7 @@
public boolean hasNewInitMethodRefOperand() {
return false;
}
-
+
public boolean hasInitMethodRefOperand() {
return false;
}
@@ -542,7 +542,7 @@
return false;
}
-
+
/**
* This method will answer true if the receiver is
* a multi-bytecode instruction (such as
@@ -548,7 +548,7 @@
* a multi-bytecode instruction (such as
* aload0_putfield_super); otherwise, it will answer
* false.
- *
+ *
* @return boolean true if multibytecode, false otherwise
*/
public boolean hasMultipleByteCodes() {
@@ -564,7 +564,7 @@
}
return false;
}
-
+
/**
* When passed a byteCode, an OperandTable and a
* SegmentConstantPool, this method will set the
@@ -569,7 +569,7 @@
* When passed a byteCode, an OperandTable and a
* SegmentConstantPool, this method will set the
* rewrite of the byteCode appropriately.
- *
+ *
* @param byteCode ByteCode to be updated (!)
* @param operandManager OperandTable from which to draw info
* @param codeLength Length of bytes (excluding this bytecode)
@@ -579,7 +579,7 @@
*/
public void setByteCodeOperands(ByteCode byteCode,
OperandManager operandManager, int codeLength) {
- throw new Error("My subclass should have implemented this");
+ throw new Error("My subclass should have implemented this");
}
/**
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/ClassRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/ClassRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/ClassRefForm.java (working copy)
@@ -27,7 +27,7 @@
public class ClassRefForm extends ReferenceForm {
protected boolean widened = false;
-
+
public ClassRefForm(int opcode, String name, int[] rewrite) {
super(opcode, name, rewrite);
// TODO Auto-generated constructor stub
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/ClassSpecificReferenceForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/ClassSpecificReferenceForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/ClassSpecificReferenceForm.java (working copy)
@@ -36,11 +36,11 @@
super(opcode, name, rewrite);
// TODO Auto-generated constructor stub
}
-
+
protected abstract int getOffset(OperandManager operandManager);
protected abstract int getPoolID();
protected abstract String context(OperandManager operandManager);
-
+
protected void setNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset) throws Pack200Exception {
SegmentConstantPool globalPool = operandManager.globalConstantPool();
ClassFileEntry[] nested = null;
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/DoubleForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/DoubleForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/DoubleForm.java (working copy)
@@ -25,7 +25,7 @@
* double references).
*/
public class DoubleForm extends ReferenceForm {
-
+
public DoubleForm(int opcode, String name, int[] rewrite) {
super(opcode, name, rewrite);
// TODO Auto-generated constructor stub
@@ -34,7 +34,7 @@
public int getOperandType() {
return TYPE_DOUBLE;
}
-
+
public boolean hasDoubleOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/FieldRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/FieldRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/FieldRefForm.java (working copy)
@@ -34,7 +34,7 @@
public int getOperandType() {
return TYPE_FIELDREF;
}
-
+
public boolean hasFieldRefOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/IMethodRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/IMethodRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/IMethodRefForm.java (working copy)
@@ -28,7 +28,7 @@
*/
public class IMethodRefForm extends ReferenceForm {
- public IMethodRefForm(int opcode, String name,
+ public IMethodRefForm(int opcode, String name,
int[] rewrite) {
super(opcode, name, rewrite);
}
@@ -48,7 +48,7 @@
protected int getPoolID() {
return SegmentConstantPool.CP_IMETHOD;
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.forms.ByteCodeForm#setByteCodeOperands(org.apache.harmony.pack200.bytecode.ByteCode, org.apache.harmony.pack200.bytecode.OperandTable, org.apache.harmony.pack200.Segment)
*/
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/IincForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/IincForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/IincForm.java (working copy)
@@ -33,7 +33,7 @@
public int getOperandType() {
return TYPE_IINC;
}
-
+
public boolean hasIincOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/InitMethodReferenceForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/InitMethodReferenceForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/InitMethodReferenceForm.java (working copy)
@@ -44,7 +44,7 @@
protected int getPoolID() {
return SegmentConstantPool.CP_METHOD;
}
-
+
protected int getOffset(OperandManager operandManager) {
return operandManager.nextInitRef();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/IntRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/IntRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/IntRefForm.java (working copy)
@@ -39,11 +39,11 @@
public int getOperandType() {
return TYPE_INTREF;
}
-
+
public boolean hasIntRefOperand() {
return true;
}
-
+
protected int getOffset(OperandManager operandManager) {
return operandManager.nextIntRef();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/LabelForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/LabelForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/LabelForm.java (working copy)
@@ -28,7 +28,7 @@
public class LabelForm extends ByteCodeForm {
protected boolean widened = false;
-
+
public LabelForm(int opcode, String name, int[] rewrite) {
super(opcode, name, rewrite);
// TODO Auto-generated constructor stub
@@ -66,7 +66,7 @@
byteCode.setNestedPositions(new int[][] {{0,2}});
}
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.forms.ByteCodeForm#setByteCodeOperands(org.apache.harmony.pack200.bytecode.ByteCode, org.apache.harmony.pack200.bytecode.OperandTable, org.apache.harmony.pack200.SegmentConstantPool)
*/
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/LocalForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/LocalForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/LocalForm.java (working copy)
@@ -39,7 +39,7 @@
public int getOperandType() {
return TYPE_LOCAL;
}
-
+
public boolean hasLocalOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/LongForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/LongForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/LongForm.java (working copy)
@@ -25,7 +25,7 @@
* long references).
*/
public class LongForm extends ReferenceForm {
-
+
public LongForm(int opcode, String name, int[] rewrite) {
super(opcode, name, rewrite);
// TODO Auto-generated constructor stub
@@ -34,7 +34,7 @@
public int getOperandType() {
return TYPE_LONG;
}
-
+
public boolean hasLongOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/LookupSwitchForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/LookupSwitchForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/LookupSwitchForm.java (working copy)
@@ -55,8 +55,8 @@
// All this gets dumped into the rewrite bytes of the
// poor bytecode.
-
-
+
+
// Unlike most byte codes, the LookupSwitch is a
// variable-sized bytecode. Because of this, the
// rewrite array has to be defined here individually
@@ -62,11 +62,11 @@
// rewrite array has to be defined here individually
// for each bytecode, rather than in the ByteCodeForm
// class.
-
+
// First, there's the bytecode. Then there are 0-3
// bytes of padding so that the first (default)
// label is on a 4-byte offset.
- int padLength = 3 - (codeLength % 4);
+ int padLength = 3 - (codeLength % 4);
int rewriteSize = 1 + padLength + 4 // defaultbytes
+ 4 // npairs
+ (4 * case_values.length)
@@ -71,14 +71,14 @@
+ 4 // npairs
+ (4 * case_values.length)
+ (4 * case_pcs.length);
-
+
int[] newRewrite = new int[rewriteSize];
int rewriteIndex = 0;
-
+
// Fill in what we can now
// opcode
newRewrite[rewriteIndex++] = byteCode.getOpcode();
-
+
// padding
for(int index=0; index < padLength; index++) {
newRewrite[rewriteIndex++] = 0;
@@ -83,7 +83,7 @@
for(int index=0; index < padLength; index++) {
newRewrite[rewriteIndex++] = 0;
}
-
+
// defaultbyte
// This gets overwritten by fixUpByteCodeTargets
newRewrite[rewriteIndex++] = -1;
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/MultiANewArrayForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/MultiANewArrayForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/MultiANewArrayForm.java (working copy)
@@ -37,7 +37,7 @@
public int getOperandType() {
return TYPE_MULTIANEWARRAY;
}
-
+
public boolean hasMultianewarrayOperand() {
return true;
}
@@ -54,7 +54,7 @@
// multianewarray has a class ref and a dimension.
// The superclass handles the class ref.
super.setByteCodeOperands(byteCode, operandManager, codeLength);
-
+
// We have to handle the dimension.
int dimension = operandManager.nextByte();
byteCode.setOperandByte(dimension, 2);
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/NewInitMethodRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/NewInitMethodRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/NewInitMethodRefForm.java (working copy)
@@ -34,7 +34,7 @@
public int getOperandType() {
return TYPE_NEWINITMETHODREF;
}
-
+
public boolean hasNewInitMethodRefOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/NoArgumentForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/NoArgumentForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/NoArgumentForm.java (working copy)
@@ -35,11 +35,11 @@
public int getOperandType() {
return TYPE_NONE;
}
-
+
public boolean hasNoOperand() {
return true;
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.forms.ByteCodeForm#setByteCodeOperands(org.apache.harmony.pack200.bytecode.ByteCode, org.apache.harmony.pack200.bytecode.OperandTable, org.apache.harmony.pack200.SegmentConstantPool)
*/
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/ReferenceForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/ReferenceForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/ReferenceForm.java (working copy)
@@ -35,7 +35,7 @@
protected abstract int getPoolID();
protected abstract int getOffset(OperandManager operandManager);
-
+
protected void setNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset) throws Pack200Exception {
SegmentConstantPool globalPool = operandManager.globalConstantPool();
ClassFileEntry[] nested = null;
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/ShortForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/ShortForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/ShortForm.java (working copy)
@@ -33,7 +33,7 @@
public int getOperandType() {
return TYPE_SHORT;
}
-
+
public boolean hasShortOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/SingleByteReferenceForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/SingleByteReferenceForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/SingleByteReferenceForm.java (working copy)
@@ -28,7 +28,7 @@
public abstract class SingleByteReferenceForm extends ReferenceForm {
protected boolean widened = false;
-
+
public SingleByteReferenceForm(int opcode, String name,
int[] rewrite) {
super(opcode, name, rewrite);
@@ -38,7 +38,7 @@
protected abstract int getOffset(OperandManager operandManager);
protected abstract int getPoolID();
-
+
protected void setNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset) throws Pack200Exception {
super.setNestedEntries(byteCode, operandManager, offset);
if(widened) {
@@ -44,7 +44,7 @@
if(widened) {
byteCode.setNestedPositions(new int[][] {{0,2}});
} else {
- byteCode.setNestedPositions(new int[][] {{0,1}});
+ byteCode.setNestedPositions(new int[][] {{0,1}});
}
}
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/StringRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/StringRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/StringRefForm.java (working copy)
@@ -55,7 +55,7 @@
protected int getPoolID() {
return SegmentConstantPool.CP_STRING;
}
-
+
protected void setNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset) throws Pack200Exception {
SegmentConstantPool globalPool = operandManager.globalConstantPool();
ClassFileEntry[] nested = null;
@@ -66,7 +66,7 @@
if(widened) {
byteCode.setNestedPositions(new int[][]{{0, 2}});
} else {
- byteCode.setNestedPositions(new int[][]{{0, 1}});
+ byteCode.setNestedPositions(new int[][]{{0, 1}});
}
}
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperFieldRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperFieldRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperFieldRefForm.java (working copy)
@@ -37,7 +37,7 @@
public int getOperandType() {
return TYPE_SUPERFIELDREF;
}
-
+
public boolean hasSuperFieldRefOperand() {
return true;
}
@@ -49,7 +49,7 @@
protected int getPoolID() {
return SegmentConstantPool.CP_FIELD;
}
-
+
protected String context(OperandManager operandManager) {
return operandManager.getSuperClass();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperInitMethodRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperInitMethodRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperInitMethodRefForm.java (working copy)
@@ -23,7 +23,7 @@
*/
public class SuperInitMethodRefForm extends InitMethodReferenceForm {
- public SuperInitMethodRefForm(int opcode, String name,
+ public SuperInitMethodRefForm(int opcode, String name,
int[] rewrite) {
super(opcode, name, rewrite);
// TODO Auto-generated constructor stub
@@ -32,7 +32,7 @@
public int getOperandType() {
return TYPE_SUPERINITMETHODREF;
}
-
+
public boolean hasSuperInitMethodRefOperand() {
return true;
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperMethodRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperMethodRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/SuperMethodRefForm.java (working copy)
@@ -37,11 +37,11 @@
public int getOperandType() {
return TYPE_SUPERMETHODREF;
}
-
+
public boolean hasSuperMethodRefOperand() {
return true;
}
-
+
protected int getOffset(OperandManager operandManager) {
return operandManager.nextSuperMethodRef();
}
@@ -49,7 +49,7 @@
protected int getPoolID() {
return SegmentConstantPool.CP_METHOD;
}
-
+
protected String context(OperandManager operandManager) {
return operandManager.getSuperClass();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/SwitchForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/SwitchForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/SwitchForm.java (working copy)
@@ -35,11 +35,11 @@
public int getOperandType() {
return TYPE_SWITCH;
}
-
+
public boolean hasSwitchOperand() {
return true;
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.forms.ByteCodeForm#setByteCodeOperands(org.apache.harmony.pack200.bytecode.ByteCode, org.apache.harmony.pack200.bytecode.OperandTable, org.apache.harmony.pack200.SegmentConstantPool)
*/
@@ -46,7 +46,7 @@
public void setByteCodeOperands(ByteCode byteCode,
OperandManager operandManager, int codeLength) {
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.forms.ByteCodeForm#fixUpByteCodeTargets(org.apache.harmony.pack200.bytecode.ByteCode, org.apache.harmony.pack200.bytecode.CodeAttribute)
*/
@@ -55,7 +55,7 @@
int[] originalTargets = byteCode.getByteCodeTargets();
int numberOfLabels = originalTargets.length;
int[] replacementTargets = new int[numberOfLabels];
-
+
int sourceIndex = byteCode.getByteCodeIndex();
int sourceValue = ((Integer)codeAttribute.byteCodeOffsets.get(sourceIndex)).intValue();
for(int index=0; index < numberOfLabels; index++) {
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/TableSwitchForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/TableSwitchForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/TableSwitchForm.java (working copy)
@@ -20,7 +20,7 @@
import org.apache.harmony.pack200.bytecode.OperandManager;
public class TableSwitchForm extends SwitchForm {
-
+
public TableSwitchForm(int opcode, String name) {
super(opcode, name);
}
@@ -29,7 +29,7 @@
super(opcode, name, rewrite);
}
-
+
/* (non-Javadoc)
* @see org.apache.harmony.pack200.bytecode.forms.SwitchForm#setByteCodeOperands(org.apache.harmony.pack200.bytecode.ByteCode, org.apache.harmony.pack200.bytecode.OperandManager, int)
*/
@@ -63,11 +63,11 @@
// rewrite array has to be defined here individually
// for each bytecode, rather than in the ByteCodeForm
// class.
-
+
// First, there's the bytecode. Then there are 0-3
// bytes of padding so that the first (default)
// label is on a 4-byte offset.
- int padLength = 3 - (codeLength % 4);
+ int padLength = 3 - (codeLength % 4);
int rewriteSize = 1 + padLength + 4 // defaultbytes
+ 4 // lowbyte
+ 4 // highbyte
@@ -72,14 +72,14 @@
+ 4 // lowbyte
+ 4 // highbyte
+ (4 * case_pcs.length);
-
+
int[] newRewrite = new int[rewriteSize];
int rewriteIndex = 0;
-
+
// Fill in what we can now
// opcode
newRewrite[rewriteIndex++] = byteCode.getOpcode();
-
+
// padding
for(int index=0; index < padLength; index++) {
newRewrite[rewriteIndex++] = 0;
@@ -84,7 +84,7 @@
for(int index=0; index < padLength; index++) {
newRewrite[rewriteIndex++] = 0;
}
-
+
// defaultbyte
// This gets overwritten by fixUpByteCodeTargets
newRewrite[rewriteIndex++] = -1;
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/ThisFieldRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/ThisFieldRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/ThisFieldRefForm.java (working copy)
@@ -49,7 +49,7 @@
protected int getPoolID() {
return SegmentConstantPool.CP_FIELD;
}
-
+
protected String context(OperandManager operandManager) {
return operandManager.getCurrentClass();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/ThisMethodRefForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/ThisMethodRefForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/ThisMethodRefForm.java (working copy)
@@ -28,7 +28,7 @@
*/
public class ThisMethodRefForm extends ClassSpecificReferenceForm {
- public ThisMethodRefForm(int opcode, String name,
+ public ThisMethodRefForm(int opcode, String name,
int[] rewrite) {
super(opcode, name, rewrite);
// TODO Auto-generated constructor stub
@@ -37,11 +37,11 @@
public int getOperandType() {
return TYPE_THISMETHODREF;
}
-
+
public boolean hasThisMethodRefOperand() {
return true;
}
-
+
protected int getOffset(OperandManager operandManager) {
return operandManager.nextThisMethodRef();
}
@@ -49,7 +49,7 @@
protected int getPoolID() {
return SegmentConstantPool.CP_METHOD;
}
-
+
protected String context(OperandManager operandManager) {
return operandManager.getCurrentClass();
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/VariableInstructionForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/VariableInstructionForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/VariableInstructionForm.java (working copy)
@@ -37,7 +37,7 @@
* the next available operand position and the three
* immediately following it to a highest-byte,
* mid-high, mid-low, low-byte encoding of the operand.
- *
+ *
* Note that unlike the ByteCode setOperand* operations, this
* starts with an actual bytecode rewrite array (rather than
* a ByteCodeForm prototype rewrite array). Also, this method
@@ -50,7 +50,7 @@
* Calling setRewrite4Bytes(0, rewrite) a second time will
* convert it to:
* {100, 0, 0, 0, 0, 200, 0, 0, 0, 0}
- *
+ *
* @param operand int to set the rewrite bytes to
* @param rewrite int[] bytes to rewrite
*/
@@ -56,7 +56,7 @@
*/
public void setRewrite4Bytes(int operand, int[] rewrite) {
int firstOperandPosition = -1;
-
+
// Find the first -1 in the rewrite array
for(int index=0; index < rewrite.length - 3; index++) {
if((rewrite[index] == -1)
@@ -75,7 +75,7 @@
* the next available operand position and the byte
* immediately following it to a high-byte,
* low-byte encoding of the operand.
- *
+ *
* Note that unlike the ByteCode setOperand* operations, this
* starts with an actual bytecode rewrite array (rather than
* a ByteCodeForm prototype rewrite array). Also, this method
@@ -88,7 +88,7 @@
* Calling setRewrite2Bytes(0, rewrite) a second time will
* convert it to:
* {100, 0, 0, 0, 0, 200, -1, -1, -1, -1}
- *
+ *
* @param operand int to set the rewrite bytes to
* @param rewrite int[] bytes to rewrite
*/
@@ -94,7 +94,7 @@
*/
public void setRewrite2Bytes(int operand, int[] rewrite) {
int firstOperandPosition = -1;
-
+
// Find the first -1 in the rewrite array
for(int index=0; index < rewrite.length - 3; index++) {
if((rewrite[index] == -1)
@@ -119,13 +119,13 @@
if(absPosition < 0) {
throw new Error("Trying to rewrite " + this + " but there is no room for 4 bytes");
}
-
+
int byteCodeRewriteLength = rewrite.length;
-
+
if(absPosition + 3 > byteCodeRewriteLength) {
throw new Error("Trying to rewrite " + this + " with an int at position " + absPosition + " but this won't fit in the rewrite array");
}
-
+
rewrite[absPosition] = ((0xFF000000) & operand) >> 24;
rewrite[absPosition + 1] = ((0x00FF0000) & operand) >> 16;
rewrite[absPosition + 2] = ((0x0000FF00) & operand) >> 8;
@@ -145,13 +145,13 @@
if(absPosition < 0) {
throw new Error("Trying to rewrite " + this + " but there is no room for 4 bytes");
}
-
+
int byteCodeRewriteLength = rewrite.length;
-
+
if(absPosition + 1 > byteCodeRewriteLength) {
throw new Error("Trying to rewrite " + this + " with an int at position " + absPosition + " but this won't fit in the rewrite array");
}
-
+
rewrite[absPosition] = ((0xFF00) & operand) >> 8;
rewrite[absPosition + 1] = ((0x00FF) & operand);
}
Index: src/main/java/org/apache/harmony/pack200/bytecode/forms/WideForm.java
===================================================================
--- src/main/java/org/apache/harmony/pack200/bytecode/forms/WideForm.java (revision 612444)
+++ src/main/java/org/apache/harmony/pack200/bytecode/forms/WideForm.java (working copy)
@@ -38,7 +38,7 @@
public int getOperandType() {
return TYPE_WIDE;
}
-
+
public boolean hasWideOperand() {
return true;
}
@@ -67,7 +67,7 @@
*/
protected void setByteCodeOperandsFormat1(int instruction, ByteCode byteCode,
OperandManager operandManager, int codeLength) {
-
+
// Even though this code is really similar to the
// code for setByteCodeOperandsFormat2, I've left it
// distinct here. This is so changing one will
@@ -76,7 +76,7 @@
// differ, so an updater will not have to disentangle
// it.
int local = operandManager.nextLocal();
-
+
// Unlike most byte codes, the wide bytecode is a
// variable-sized bytecode. Because of this, the
// rewrite array has to be defined here individually
@@ -82,14 +82,14 @@
// rewrite array has to be defined here individually
// for each bytecode, rather than in the ByteCodeForm
// class.
-
+
int[] newRewrite = new int[4];
int rewriteIndex = 0;
-
+
// Fill in what we can now
// wide opcode
newRewrite[rewriteIndex++] = byteCode.getOpcode();
-
+
// "real" instruction that is widened
newRewrite[rewriteIndex++] = instruction;
@@ -96,11 +96,11 @@
// Index bytes
setRewrite2Bytes(local, rewriteIndex, newRewrite);
rewriteIndex +=2;
-
+
byteCode.setRewrite(newRewrite);
}
-
+
/**
* This method sets the rewrite array for the bytecode
* using Format 2 of the JVM spec: an opcode, two index
@@ -112,10 +112,10 @@
*/
protected void setByteCodeOperandsFormat2(int instruction, ByteCode byteCode,
OperandManager operandManager, int codeLength) {
-
- int local = operandManager.nextLocal();
+
+ int local = operandManager.nextLocal();
int constWord = operandManager.nextShort();
-
+
// Unlike most byte codes, the wide bytecode is a
// variable-sized bytecode. Because of this, the
// rewrite array has to be defined here individually
@@ -121,14 +121,14 @@
// rewrite array has to be defined here individually
// for each bytecode, rather than in the ByteCodeForm
// class.
-
+
int[] newRewrite = new int[6];
int rewriteIndex = 0;
-
+
// Fill in what we can now
// wide opcode
newRewrite[rewriteIndex++] = byteCode.getOpcode();
-
+
// "real" instruction that is widened
newRewrite[rewriteIndex++] = instruction;
@@ -135,11 +135,11 @@
// Index bytes
setRewrite2Bytes(local, rewriteIndex, newRewrite);
rewriteIndex +=2;
-
+
// constant bytes
setRewrite2Bytes(constWord, rewriteIndex, newRewrite);
rewriteIndex += 2; // not strictly necessary, but just in case something comes along later
-
+
byteCode.setRewrite(newRewrite);
}
}
Index: src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
===================================================================
--- src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java (revision 565676)
+++ src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java (working copy)
@@ -49,7 +49,7 @@
support.removePropertyChangeListener(listener);
}
- /**
+ /**
* Completion between 0..1
* @param value
*/
Index: src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java
===================================================================
--- src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java (revision 610449)
+++ src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java (working copy)
@@ -36,7 +36,7 @@
public class Pack200UnpackerAdapter extends Pack200Adapter implements Unpacker {
/*
* (non-Javadoc)
- *
+ *
* @see java.util.jar.Pack200.Unpacker#unpack(java.io.InputStream,
* java.util.jar.JarOutputStream)
*/
@@ -60,7 +60,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see java.util.jar.Pack200.Unpacker#unpack(java.io.File,
* java.util.jar.JarOutputStream)
*/
Index: src/test/java/org/apache/harmony/pack200/tests/AbstractBandsTestCase.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/AbstractBandsTestCase.java (revision 587112)
+++ src/test/java/org/apache/harmony/pack200/tests/AbstractBandsTestCase.java (working copy)
@@ -37,7 +37,7 @@
public int getClassCount() {
return numClasses;
}
-
+
public SegmentOptions getOptions() {
try {
return new SegmentOptions(0);
@@ -52,7 +52,7 @@
public MockAttributeDefinitionBands(Segment segment) {
super(segment);
}
-
+
public AttributeLayoutMap getAttributeDefinitionMap() {
try {
return new AttributeLayoutMap();
@@ -61,8 +61,8 @@
}
return null;
}
-
-
+
+
}
@@ -67,11 +67,11 @@
}
public class MockSegment extends Segment {
-
+
protected AttrDefinitionBands getAttrDefinitionBands() {
return new MockAttributeDefinitionBands(this);
- }
-
+ }
+
public SegmentHeader getSegmentHeader() {
return new MockSegmentHeader();
}
@@ -76,6 +76,6 @@
return new MockSegmentHeader();
}
}
-
-
+
+
}
Index: src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutMapTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutMapTest.java (revision 587112)
+++ src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutMapTest.java (working copy)
@@ -43,6 +43,6 @@
layout = b.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
assertNotNull(layout);
assertEquals("RUNH",layout.getLayout());
-
+
}
}
Index: src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutTest.java (revision 596606)
+++ src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutTest.java (working copy)
@@ -45,7 +45,7 @@
return null;
return data[cp][(int)index];
}
-
+
};
}
}
Index: src/test/java/org/apache/harmony/pack200/tests/BHSDCodecTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/BHSDCodecTest.java (revision 608797)
+++ src/test/java/org/apache/harmony/pack200/tests/BHSDCodecTest.java (working copy)
@@ -30,12 +30,12 @@
*/
public class BHSDCodecTest extends TestCase {
-
+
public void testEncodeDecode() throws IOException, Pack200Exception {
for (int i = 1; i < 116; i++) {
-
+
BHSDCodec codec = (BHSDCodec) CodecEncoding.getCodec(i, null, null);
-
+
// Test encode-decode with a selection of numbers within the range of the codec
long delta = (codec.largest() - codec.smallest()) / 4;
for (long j = codec.smallest(); j <= codec.largest() + 1; j += delta) {
@@ -47,8 +47,8 @@
+ ", got: " + decoded);
}
}
-
- // Test encode-decode with 0
+
+ // Test encode-decode with 0
assertEquals(0, codec.decode(new ByteArrayInputStream(codec.encode(
0, 0)), 0));
}
@@ -53,5 +53,5 @@
0, 0)), 0));
}
}
-
+
}
\ No newline at end of file
Index: src/test/java/org/apache/harmony/pack200/tests/BandSetTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/BandSetTest.java (revision 608803)
+++ src/test/java/org/apache/harmony/pack200/tests/BandSetTest.java (working copy)
@@ -31,7 +31,7 @@
import org.apache.harmony.pack200.SegmentHeader;
public class BandSetTest extends TestCase {
-
+
public class MockSegment extends Segment {
public SegmentHeader getSegmentHeader() {
return new SegmentHeader();
@@ -45,9 +45,9 @@
public void unpack(InputStream inputStream) throws IOException, Pack200Exception {
}
-
+
};
-
+
public void testDecodeBandInt() throws IOException, Pack200Exception {
BHSDCodec codec = Codec.BYTE1;
byte[] bytes = new byte[]{(byte)3,(byte)56,(byte)122,(byte)78};
@@ -57,7 +57,7 @@
assertEquals("Wrong value in position " + i, ints[i], bytes[i]);
}
}
-
+
public void testDecodeBandLong() throws IOException, Pack200Exception {
BHSDCodec codec = Codec.BYTE1;
byte[] bytes = new byte[]{(byte)3,(byte)56,(byte)122,(byte)78, (byte)0, (byte)255};
@@ -65,12 +65,12 @@
long[] longs = bandSet.decodeBandLong("Test Band", in, codec, 6);
for (int i = 0; i < longs.length; i++) {
assertEquals("Wrong value in position " + i, (byte)longs[i], bytes[i]);
- }
+ }
//TODO: Should test this with other Codecs.
}
-
+
public void testDecodeBandLong2() throws IOException, Pack200Exception {
-
+
BHSDCodec codec = Codec.DELTA5;
byte[] bytes = new byte[]{3, 1, 2, 3, 4, 5}; // 3 is decoded to -2 by DELTA5, which signifies a switch to BYTE1
InputStream in = new ByteArrayInputStream(bytes);
@@ -77,27 +77,27 @@
long[] longs = bandSet.decodeBandLong("Test Band", in, codec, 5);
for (int i = 0; i < longs.length; i++) {
assertEquals("Wrong value in position " + i, longs[i], bytes[i + 1]);
- }
+ }
}
-
+
public void testParseFlags1() {
-
+
}
-
+
public void testParseFlags2() {
-
+
}
-
+
public void testParseFlags3() {
-
+
}
-
+
public void testParseReferences1() {
-
+
}
-
+
public void testParseReferences2() {
-
+
}
}
Index: src/test/java/org/apache/harmony/pack200/tests/BcBandsTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/BcBandsTest.java (revision 608794)
+++ src/test/java/org/apache/harmony/pack200/tests/BcBandsTest.java (working copy)
@@ -53,7 +53,7 @@
public MockCpBands(Segment segment) {
super(segment);
}
-
+
public String[] getCpString() {
String[] classes = new String[100];
for(int index=0; index < 100; index++) {
@@ -65,31 +65,31 @@
public String[] getCpClass() {
return getCpString();
}
-
+
public String[] getCpFieldClass() {
return getCpClass();
}
-
+
public String[] getCpFieldDescriptor() {
return getCpString();
}
-
+
public String[] getCpMethodClass() {
return getCpClass();
}
-
+
public String[] getCpMethodDescriptor() {
return getCpString();
}
-
+
public String[] getCpIMethodClass() {
return getCpClass();
}
-
+
public String[] getCpIMethodDescriptor() {
return getCpString();
}
-
+
public int[] getCpInt() {
int[] elements = new int[100];
for(int index=0; index < 100; index++) {
@@ -103,7 +103,7 @@
for(int index=0; index < 100; index++) {
elements[index] = 1.0f;
}
- return elements;
+ return elements;
}
public long[] getCpLong() {
@@ -111,7 +111,7 @@
for(int index=0; index < 100; index++) {
elements[index] = 1L;
}
- return elements;
+ return elements;
}
public double[] getCpDouble() {
@@ -119,7 +119,7 @@
for(int index=0; index < 100; index++) {
elements[index] = 1.0D;
}
- return elements;
+ return elements;
}
}
@@ -127,7 +127,7 @@
public MockClassBands(Segment segment) {
super(segment);
}
-
+
public long[][] getMethodFlags() {
long[][] flags = new long[numClasses][] ;
for (int i = 0; i < flags.length; i++) {
@@ -135,7 +135,7 @@
}
return flags;
}
-
+
public int[] getCodeMaxStack() {
int totalMethods = 0;
for (int i = 0; i < numClasses; i++) {
@@ -143,7 +143,7 @@
}
return new int[totalMethods];
}
-
+
public int[] getCodeMaxNALocals() {
int totalMethods = 0;
for (int i = 0; i < numClasses; i++) {
@@ -151,7 +151,7 @@
}
return new int[totalMethods];
}
-
+
public String[][] getMethodDescr() {
String[][] descr = new String[numClasses][];
for (int i = 0; i < descr.length; i++) {
@@ -162,7 +162,7 @@
}
return descr;
}
-
+
public String[] getClassThis() {
String[] thisClasses = new String[numClasses];
for(int index=0; index < numClasses; index++) {
@@ -189,7 +189,7 @@
}
return attributes;
}
-
+
public ArrayList getOrderedCodeAttributes() {
int totalMethods = 0;
for(int classIndex = 0; classIndex < numMethods.length; classIndex++) {
@@ -209,7 +209,7 @@
protected AttrDefinitionBands getAttrDefinitionBands() {
return new MockAttributeDefinitionBands(this);
}
-
+
protected CpBands getCpBands() {
if(null == cpBands) {
cpBands = new MockCpBands(this);
@@ -216,11 +216,11 @@
}
return cpBands;
}
-
+
protected ClassBands getClassBands() {
return new MockClassBands(this);
}
-
+
public SegmentConstantPool getConstantPool() {
return cpBands.getConstantPool();
}
@@ -227,11 +227,11 @@
}
BcBands bcBands = new BcBands(new MockSegment());
-
+
/**
* Test with single byte instructions that mean all other bands apart from
* bc_codes will be empty.
- *
+ *
* @throws IOException
* @throws Pack200Exception
*/
@@ -249,7 +249,7 @@
(byte) 140, (byte) 141, (byte) 142, (byte) 143, (byte) 144,
(byte) 145, (byte) 146, (byte) 147, (byte) 148, (byte) 149,
(byte) 150, (byte) 151, (byte) 172, (byte) 173, (byte) 174,
- (byte) 175, (byte) 176, (byte) 177, (byte) 190, (byte) 191,
+ (byte) 175, (byte) 176, (byte) 177, (byte) 190, (byte) 191,
(byte) 194, (byte) 195, (byte) 255 };
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
@@ -255,10 +255,10 @@
bcBands.unpack(in);
assertEquals(bytes.length - 1, bcBands.getMethodByteCodePacked()[0][0].length);
}
-
+
/**
* Test with multiple classes but single byte instructions
- *
+ *
* @throws IOException
* @throws Pack200Exception
*/
@@ -270,11 +270,11 @@
bcBands.unpack(in);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
-
+
numClasses = 1;
numMethods = new int[] {1};
}
-
+
/**
* Test with multiple classes and multiple methods but single byte instructions
* @throws IOException
@@ -288,22 +288,22 @@
bcBands.unpack(in);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
-
+
numClasses = 1;
- numMethods = new int[] {1};
+ numMethods = new int[] {1};
}
-
-
+
+
/**
* Test with codes that require entries in the bc_case_count and bc_case_value bands
- * @throws Pack200Exception
- * @throws IOException
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcCaseBands() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] { (byte)170, (byte)171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte)255,
+ byte[] bytes = new byte[] { (byte)170, (byte)171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte)255,
2, 5, // bc_case_count
0, 0, 0, 0, 0, 0, 0, // bc_case_value
- 0, 0, 0, 0, 0, 0, 0, 0, 0}; // bc_label
+ 0, 0, 0, 0, 0, 0, 0, 0, 0}; // bc_label
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(18, bcBands.getMethodByteCodePacked()[0][0].length);
@@ -316,15 +316,15 @@
assertEquals(0, bc_case_value[1]);
assertEquals(9, bcBands.getBcLabel().length);
}
-
+
/**
* Test with codes that should require entries in the bc_byte band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcByteBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {16, (byte)132, (byte)188, (byte)197, (byte)255,
+ byte[] bytes = new byte[] {16, (byte)132, (byte)188, (byte)197, (byte)255,
8, 8, 8, 8, // bc_byte band
8, // bc_locals band (required by iinc (132))
8}; // bc_class band (required by multianewarray (197))
@@ -331,7 +331,7 @@
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(4, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_byte = bcBands.getBcByte();
+ int[] bc_byte = bcBands.getBcByte();
assertEquals(4, bc_byte.length);
for (int i = 0; i < bc_byte.length; i++) {
assertEquals(8, bc_byte[i]);
@@ -339,16 +339,16 @@
assertEquals(1, bcBands.getBcLocal().length);
assertEquals(1, bcBands.getBcClassRef().length);
}
-
+
/**
* Test with codes that should require entries in the bc_short band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcShortBand() throws IOException, Pack200Exception {
//TODO: Need to fix this testcase so it has enough data to pass.
- byte[] bytes = new byte[] {17, (byte)196, (byte)132, (byte)255,
+ byte[] bytes = new byte[] {17, (byte)196, (byte)132, (byte)255,
8, 8,// bc_short band
8, 8, 8, 8}; // bc_locals band (required by wide iinc (196, 132))
InputStream in = new ByteArrayInputStream(bytes);
@@ -357,15 +357,15 @@
assertEquals(2, bcBands.getBcShort().length);
assertEquals(2, bcBands.getBcLocal().length);
}
-
+
/**
* Test with codes that should require entries in the bc_local band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcLocalBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {21, 22, 23, 24, 25,
+ byte[] bytes = new byte[] {21, 22, 23, 24, 25,
54, 55, 56, 57, 58, (byte)169, (byte) 255,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}; // bc_local band
InputStream in = new ByteArrayInputStream(bytes);
@@ -373,12 +373,12 @@
assertEquals(11, bcBands.getMethodByteCodePacked()[0][0].length);
assertEquals(11, bcBands.getBcLocal().length);
}
-
+
/**
* Test with codes that should require entries in the bc_label band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcLabelBand() throws IOException, Pack200Exception {
byte[] bytes = new byte[] {(byte) 159, (byte) 160, (byte) 161,
@@ -387,7 +387,7 @@
2, 2, // bc_case_count (required by tableswitch (170) and lookupswitch (171))
0, 0, 0, 0, // bc_case_value
// Now that we're actually doing real label lookup, need valid labels
-// 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }; // bc_label band
+// 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }; // bc_label band
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // bc_label band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
@@ -394,13 +394,13 @@
assertEquals(36, bcBands.getMethodByteCodePacked()[0][0].length);
assertEquals(20, bcBands.getBcLabel().length);
}
-
+
public void testWideForms() throws IOException, Pack200Exception {
byte[] bytes = new byte[] {(byte) 196, (byte) 54, // wide istore
(byte) 196, (byte) 132, // wide iinc
- (byte) 255,
+ (byte) 255,
0, // bc_short band
- 0, 0, 0, 1}; // bc_locals band
+ 0, 0, 0, 1}; // bc_locals band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(4, bcBands.getMethodByteCodePacked()[0][0].length);
@@ -407,158 +407,158 @@
assertEquals(4, bcBands.getBcLocal().length);
assertEquals(1, bcBands.getBcShort().length);
}
-
+
/**
* Test with codes that should require entries in the bc_intref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcIntRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)234, (byte)237, (byte)255,
- 8, 8}; // bc_intref band
+ byte[] bytes = new byte[] {(byte)234, (byte)237, (byte)255,
+ 8, 8}; // bc_intref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_intref = bcBands.getBcIntRef();
+ int[] bc_intref = bcBands.getBcIntRef();
assertEquals(2, bc_intref.length);
}
-
+
/**
* Test with codes that should require entries in the bc_floatref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcFloatRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)235, (byte)238, (byte)255,
- 8, 8}; // bc_floatref band
+ byte[] bytes = new byte[] {(byte)235, (byte)238, (byte)255,
+ 8, 8}; // bc_floatref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_floatref = bcBands.getBcFloatRef();
+ int[] bc_floatref = bcBands.getBcFloatRef();
assertEquals(2, bc_floatref.length);
}
-
+
/**
* Test with codes that should require entries in the bc_longref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcLongRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {20, (byte)255,
- 8}; // bc_longref band
+ byte[] bytes = new byte[] {20, (byte)255,
+ 8}; // bc_longref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(1, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_longref = bcBands.getBcLongRef();
+ int[] bc_longref = bcBands.getBcLongRef();
assertEquals(1, bc_longref.length);
}
-
+
/**
* Test with codes that should require entries in the bc_doubleref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcDoubleRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)239, (byte)255,
- 8}; // bc_doubleref band
+ byte[] bytes = new byte[] {(byte)239, (byte)255,
+ 8}; // bc_doubleref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(1, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_doubleref = bcBands.getBcDoubleRef();
- assertEquals(1, bc_doubleref.length);
+ int[] bc_doubleref = bcBands.getBcDoubleRef();
+ assertEquals(1, bc_doubleref.length);
}
-
-
+
+
/**
* Test with codes that should require entries in the bc_stringref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcStringRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {18, 19, (byte)255,
- 8, 8}; // bc_stringref band
+ byte[] bytes = new byte[] {18, 19, (byte)255,
+ 8, 8}; // bc_stringref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_stringref = bcBands.getBcStringRef();
+ int[] bc_stringref = bcBands.getBcStringRef();
assertEquals(2, bc_stringref.length);
}
-
-
+
+
/**
* Test with codes that should require entries in the bc_classref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcClassRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)233, (byte)236, (byte)255,
- 8, 8}; // bc_classref band
+ byte[] bytes = new byte[] {(byte)233, (byte)236, (byte)255,
+ 8, 8}; // bc_classref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(2, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_classref = bcBands.getBcClassRef();
- assertEquals(2, bc_classref.length);
+ int[] bc_classref = bcBands.getBcClassRef();
+ assertEquals(2, bc_classref.length);
}
-
+
/**
* Test with codes that should require entries in the bc_fieldref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcFieldRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)178, (byte)179, (byte)180, (byte)181, (byte)255,
- 8, 8, 8, 8}; // bc_fieldref band
+ byte[] bytes = new byte[] {(byte)178, (byte)179, (byte)180, (byte)181, (byte)255,
+ 8, 8, 8, 8}; // bc_fieldref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(4, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_fieldref = bcBands.getBcFieldRef();
+ int[] bc_fieldref = bcBands.getBcFieldRef();
assertEquals(4, bc_fieldref.length);
}
-
+
/**
* Test with codes that should require entries in the bc_methodref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcMethodRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)182, (byte)183, (byte)184, (byte)255,
- 8, 8, 8}; // bc_methodref band
+ byte[] bytes = new byte[] {(byte)182, (byte)183, (byte)184, (byte)255,
+ 8, 8, 8}; // bc_methodref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(3, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_methodref = bcBands.getBcMethodRef();
+ int[] bc_methodref = bcBands.getBcMethodRef();
assertEquals(3, bc_methodref.length);
}
-
+
/**
* Test with codes that should require entries in the bc_imethodref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcIMethodRefBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)185, (byte)255,
- 8}; // bc_imethodref band
+ byte[] bytes = new byte[] {(byte)185, (byte)255,
+ 8}; // bc_imethodref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(1, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_imethodref = bcBands.getBcIMethodRef();
- assertEquals(1, bc_imethodref.length);
+ int[] bc_imethodref = bcBands.getBcIMethodRef();
+ assertEquals(1, bc_imethodref.length);
}
-
+
/**
* Test with codes that should require entries in the bc_thisfieldref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcThisFieldBand() throws IOException, Pack200Exception {
byte[] bytes = new byte[] { (byte) 202, (byte) 203, (byte) 204,
@@ -563,7 +563,7 @@
public void testBcThisFieldBand() throws IOException, Pack200Exception {
byte[] bytes = new byte[] { (byte) 202, (byte) 203, (byte) 204,
(byte) 205, (byte) 209, (byte) 210, (byte) 211, (byte) 212,
- (byte) 255,
+ (byte) 255,
8, 8, 8, 8, 8, 8, 8, 8 }; // bc_thisfieldref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
@@ -568,15 +568,15 @@
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(8, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_thisfield = bcBands.getBcThisField();
+ int[] bc_thisfield = bcBands.getBcThisField();
assertEquals(8, bc_thisfield.length);
}
-
+
/**
* Test with codes that should require entries in the bc_superfield band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcSuperFieldBand() throws IOException, Pack200Exception {
byte[] bytes = new byte[] { (byte) 216, (byte) 217, (byte) 218,
@@ -581,36 +581,36 @@
public void testBcSuperFieldBand() throws IOException, Pack200Exception {
byte[] bytes = new byte[] { (byte) 216, (byte) 217, (byte) 218,
(byte) 219, (byte) 223, (byte) 224, (byte) 225, (byte) 226,
- (byte) 255,
- 8, 8, 8, 8, 8, 8, 8, 8}; // bc_superfield band
+ (byte) 255,
+ 8, 8, 8, 8, 8, 8, 8, 8}; // bc_superfield band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(8, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_superfield = bcBands.getBcSuperField();
- assertEquals(8, bc_superfield.length);
+ int[] bc_superfield = bcBands.getBcSuperField();
+ assertEquals(8, bc_superfield.length);
}
-
+
/**
* Test with codes that should require entries in the bc_thismethod band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcThisMethodBand() throws IOException, Pack200Exception {
- byte[] bytes = new byte[] {(byte)206, (byte)207, (byte)208, (byte)213, (byte)214, (byte)215, (byte)255,
- 8, 8, 8, 8, 8, 8}; // bc_thismethod band
+ byte[] bytes = new byte[] {(byte)206, (byte)207, (byte)208, (byte)213, (byte)214, (byte)215, (byte)255,
+ 8, 8, 8, 8, 8, 8}; // bc_thismethod band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(6, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_thismethod = bcBands.getBcThisMethod();
+ int[] bc_thismethod = bcBands.getBcThisMethod();
assertEquals(6, bc_thismethod.length);
}
-
+
/**
* Test with codes that should require entries in the bc_supermethod band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcSuperMethodBand() throws IOException, Pack200Exception {
//TODO: Need to fix this testcase so it has enough data to pass.
@@ -615,20 +615,20 @@
public void testBcSuperMethodBand() throws IOException, Pack200Exception {
//TODO: Need to fix this testcase so it has enough data to pass.
if(true) return;
- byte[] bytes = new byte[] {(byte)220, (byte)221, (byte)222, (byte)227, (byte)228, (byte)229, (byte)255,
- 8, 8, 8, 8, 8, 8}; // bc_supermethod band
+ byte[] bytes = new byte[] {(byte)220, (byte)221, (byte)222, (byte)227, (byte)228, (byte)229, (byte)255,
+ 8, 8, 8, 8, 8, 8}; // bc_supermethod band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(6, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_supermethod = bcBands.getBcSuperMethod();
+ int[] bc_supermethod = bcBands.getBcSuperMethod();
assertEquals(6, bc_supermethod.length);
}
-
+
/**
* Test with codes that should require entries in the bc_initrefref band
- *
- * @throws Pack200Exception
- * @throws IOException
+ *
+ * @throws Pack200Exception
+ * @throws IOException
*/
public void testBcInitRefRefBand() throws IOException, Pack200Exception {
//TODO: Need to fix this testcase so it has enough data to pass.
@@ -633,21 +633,21 @@
public void testBcInitRefRefBand() throws IOException, Pack200Exception {
//TODO: Need to fix this testcase so it has enough data to pass.
if(true) return;
- byte[] bytes = new byte[] {(byte)230, (byte)231, (byte)232, (byte)255,
- 8, 8, 8}; // bc_initrefref band
+ byte[] bytes = new byte[] {(byte)230, (byte)231, (byte)232, (byte)255,
+ 8, 8, 8}; // bc_initrefref band
InputStream in = new ByteArrayInputStream(bytes);
bcBands.unpack(in);
assertEquals(3, bcBands.getMethodByteCodePacked()[0][0].length);
- int[] bc_initrefref = bcBands.getBcInitRef();
+ int[] bc_initrefref = bcBands.getBcInitRef();
assertEquals(3, bc_initrefref.length);
}
-
+
public void testBcEscRefBands() throws IOException, Pack200Exception {
// TODO
}
-
+
public void testBcEscBands() throws IOException, Pack200Exception {
// TODO
}
-
+
}
Index: src/test/java/org/apache/harmony/pack200/tests/ClassBandsTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/ClassBandsTest.java (revision 596578)
+++ src/test/java/org/apache/harmony/pack200/tests/ClassBandsTest.java (working copy)
@@ -29,11 +29,11 @@
*
*/
public class ClassBandsTest extends AbstractBandsTestCase {
-
+
private String[] cpClasses;
private String[] cpDescriptor;
private String[] cpUTF8;
-
+
public class MockCpBands extends CpBands {
public MockCpBands(Segment segment) {
@@ -39,35 +39,35 @@
public MockCpBands(Segment segment) {
super(segment);
}
-
+
public String[] getCpClass() {
return cpClasses;
}
-
+
public String[] getCpDescriptor() {
return cpDescriptor;
}
-
+
public String[] getCpUTF8() {
return cpUTF8;
}
-
+
public int[] getCpInt() {
return new int[0];
}
-
+
public double[] getCpDouble() {
return new double[0];
}
-
+
public long[] getCpLong() {
- return new long[0];
+ return new long[0];
}
-
+
public float[] getCpFloat() {
return new float[0];
}
-
+
public String[] getCpSignature() {
return new String[0];
}
@@ -78,11 +78,11 @@
return new MockCpBands(this);
}
}
-
-
-
+
+
+
ClassBands classBands = new ClassBands(new MockSegment());
-
+
public void testSimple() throws IOException, Pack200Exception {
cpClasses = new String[] { "Class1", "Class2", "Class3", "Interface1", "Interface2" };
cpDescriptor = new String[0];
@@ -119,7 +119,7 @@
assertEquals(cpClasses[4], classBands.getClassInterfaces()[0][1]);
cpClasses = null;
}
-
+
public void testWithMethods() throws Pack200Exception, IOException {
cpClasses = new String[] { "Class1", "Class2", "Class3" };
cpDescriptor = new String[] {"method1", "method2", "method3"};
@@ -133,7 +133,7 @@
byte[] methodFlagsLo = classBands.encodeBandLong(new long[]{0, 0, 0}, Codec.UNSIGNED5);
byte[] classFlags = Codec.UNSIGNED5.encode(0, 0);
byte[][] allArrays = new byte[][] { classThis, classSuper,
- classInterfaceCount, classFieldCount, classMethodCount,
+ classInterfaceCount, classFieldCount, classMethodCount,
methodDescr, methodFlagsLo, classFlags, };
int total = 0;
for (int i = 0; i < allArrays.length; i++) {
@@ -156,15 +156,15 @@
assertEquals(cpDescriptor[0], classBands.getMethodDescr()[0][0]);
assertEquals(cpDescriptor[1], classBands.getMethodDescr()[0][1]);
assertEquals(cpDescriptor[2], classBands.getMethodDescr()[0][2]);
-
+
cpClasses = null;
cpDescriptor = null;
}
-
+
public void testWithFields() {
-
+
}
-
-
-
+
+
+
}
Index: src/test/java/org/apache/harmony/pack200/tests/CodeAttributeTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/CodeAttributeTest.java (revision 610778)
+++ src/test/java/org/apache/harmony/pack200/tests/CodeAttributeTest.java (working copy)
@@ -123,7 +123,7 @@
Segment segment = new MockSegment();
CpBands cpBands = new MockCpBands(segment);
-
+
public byte[] mixedByteArray = { -47, // aload_0_getstatic_this 0, 1
-46, // aload_0_putstatic_this 4, 5
1, // aconst_null 8
Index: src/test/java/org/apache/harmony/pack200/tests/CodecEncodingTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/CodecEncodingTest.java (revision 587112)
+++ src/test/java/org/apache/harmony/pack200/tests/CodecEncodingTest.java (working copy)
@@ -29,11 +29,11 @@
import org.apache.harmony.pack200.Pack200Exception;
/**
- *
+ *
*/
public class CodecEncodingTest extends TestCase {
-
- public void testCanonicalEncodings() throws IOException, Pack200Exception {
+
+ public void testCanonicalEncodings() throws IOException, Pack200Exception {
Codec defaultCodec = new BHSDCodec(2,16,0,0);
assertEquals(defaultCodec,CodecEncoding.getCodec(0,null, defaultCodec));
Map map = new HashMap();
@@ -162,5 +162,5 @@
assertEquals("(5,128,2,1)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x25, (byte)0x7F}), null).toString());
assertEquals("(2,128,1,1)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x0B, (byte)0x7F}), null).toString());
}
-
+
}
Index: src/test/java/org/apache/harmony/pack200/tests/CodecTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/CodecTest.java (revision 587112)
+++ src/test/java/org/apache/harmony/pack200/tests/CodecTest.java (working copy)
@@ -159,7 +159,7 @@
assertTrue(byte2s.encodes(128));
assertTrue(byte2s.encodes(191));
assertFalse(byte2s.encodes(192));
- assertFalse(byte2s.encodes(256));
+ assertFalse(byte2s.encodes(256));
}
public void testRunCodec() throws Exception {
Index: src/test/java/org/apache/harmony/pack200/tests/PopulationCodecTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/PopulationCodecTest.java (revision 587112)
+++ src/test/java/org/apache/harmony/pack200/tests/PopulationCodecTest.java (working copy)
@@ -44,7 +44,7 @@
private void checkDecode(byte[] data, long[] expectedResult, Codec codec) throws IOException, Pack200Exception {
InputStream in = new ByteArrayInputStream(data );
-
+
long[] result = new PopulationCodec(codec,codec,codec).decode(expectedResult.length,in);
assertEquals(expectedResult.length,result.length);
for(int i=0;i.*", 0));
assertEquals(4, mockInstance.matchSpecificPoolEntryIndex(testClassArray, testMethodArray, "Object", "isNull.*", 0));
assertEquals(5, mockInstance.matchSpecificPoolEntryIndex(testClassArray, testMethodArray, "Other", "Other", 0));
-
+
// Elements that don't exist shouldn't be found
assertEquals(-1, mockInstance.matchSpecificPoolEntryIndex(testClassArray, testMethodArray, "NotThere", "NotThere", 0));
assertEquals(-1, mockInstance.matchSpecificPoolEntryIndex(testClassArray, testMethodArray, "Object", "NotThere", 0));
-
+
// Elements that exist but don't have the requisite number
// of hits shouldn't be found.
- assertEquals(-1, mockInstance.matchSpecificPoolEntryIndex(testClassArray, testMethodArray, "java/lang/String", ".*", 1));
+ assertEquals(-1, mockInstance.matchSpecificPoolEntryIndex(testClassArray, testMethodArray, "java/lang/String", ".*", 1));
}
}
\ No newline at end of file
Index: src/test/java/org/apache/harmony/pack200/tests/SegmentOptionsTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/SegmentOptionsTest.java (revision 587112)
+++ src/test/java/org/apache/harmony/pack200/tests/SegmentOptionsTest.java (working copy)
@@ -22,10 +22,10 @@
import org.apache.harmony.pack200.SegmentOptions;
/**
- *
+ *
*/
public class SegmentOptionsTest extends TestCase {
-
+
public void testUnused() {
int[] unused = new int[] { 3, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31 };
Index: src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java
===================================================================
--- src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java (revision 612445)
+++ src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java (working copy)
@@ -29,7 +33,7 @@
* Tests for org.apache.harmony.pack200.Segment, which is the main class for pack200.
*/
public class SegmentTest extends TestCase {
-
+
InputStream in;
JarOutputStream out;
@@ -61,7 +84,7 @@
out = new JarOutputStream(new FileOutputStream(File.createTempFile("Just", "ResourcesGz.jar")));
segment.writeJar(out);
}
-
+
// Test with an archive containing Harmony's SQL module, packed with -E1
public void testWithSqlE1() throws Exception {
in = Segment.class
@@ -71,7 +94,7 @@
out = new JarOutputStream(new FileOutputStream(File.createTempFile("sql", "-e1.jar")));
segment.writeJar(out);
}
-
+
// Test with an archive containing Harmony's SQL module
public void testWithSql() throws Exception {
if(!handlingInnerClasses) return;
@@ -92,7 +142,7 @@
out = new JarOutputStream(new FileOutputStream(File.createTempFile("pack", "200-e1.jar")));
segment.writeJar(out);
}
-
+
// Test with an archive containing Harmony's Pack200 module
public void testWithPack200() throws Exception {
in = Segment.class
@@ -102,7 +152,7 @@
out = new JarOutputStream(new FileOutputStream(File.createTempFile("pack", "200.jar")));
segment.writeJar(out);
}
-
+
// Test with an archive containing Harmony's JNDI module
public void testWithJNDIE1() throws Exception {
if(!handlingInnerClasses) return;
@@ -113,7 +163,7 @@
out = new JarOutputStream(new FileOutputStream(File.createTempFile("jndi", "-e1.jar")));
segment.writeJar(out);
}
-
+
// Test with an archive containing Annotations
public void testWithAnnotations() throws Exception {
@@ -123,9 +173,9 @@
assertNotNull(segment);
out = new JarOutputStream(new FileOutputStream(File.createTempFile("ann", "otations.jar")));
segment.writeJar(out);
-
+
}
-
+
public void testInterfaceOnly() throws Exception {
in = Segment.class
.getResourceAsStream("/org/apache/harmony/pack200/tests/InterfaceOnly.pack");
@@ -134,7 +184,7 @@
out = new JarOutputStream(new FileOutputStream(File.createTempFile("Interface", "Only.jar")));
segment.writeJar(out);
}
-
+
protected void tearDown() throws Exception {
super.tearDown();
try {