format source code

This commit is contained in:
2015-03-31 21:32:49 +02:00
parent 9813f62cdf
commit cc5f2ff4c2
18 changed files with 2245 additions and 2018 deletions
@@ -50,7 +50,7 @@ public class ABCInputStream implements AutoCloseable {
public static final boolean DEBUG_READ = false;
public DumpInfo dumpInfo;
private byte[] stringDataBuffer = new byte[256];
public void startBuffer() {
@@ -477,17 +477,17 @@ public class ABCInputStream implements AutoCloseable {
public String readString(String name) throws IOException {
newDumpLevel(name, "String");
int length = readU30Internal();
// avoid creating new byte array every time
if (stringDataBuffer.length < length) {
int newLength = stringDataBuffer.length * 2;
while (newLength < length) {
newLength *= 2;
}
stringDataBuffer = new byte[newLength];
}
safeRead(length, stringDataBuffer);
String r = new String(stringDataBuffer, 0, length, Utf8Helper.charset);
endDumpLevel(r);
@@ -33,11 +33,11 @@ public class ClassInfo {
public ClassInfo() {
static_traits = new Traits();
}
public ClassInfo(Traits traits) {
static_traits = traits;
}
@Override
public String toString() {
return "method_index=" + cinit_index + "\r\n" + static_traits.toString();
@@ -56,11 +56,11 @@ public class InstanceInfo {
public InstanceInfo() {
instance_traits = new Traits();
}
public InstanceInfo(Traits traits) {
instance_traits = traits;
}
@Override
public String toString() {
return "name_index=" + name_index + " super_index=" + super_index + " flags=" + flags + " protectedNS=" + protectedNS + " interfaces=" + Helper.intArrToString(interfaces) + " method_index=" + iinit_index + "\r\n" + instance_traits.toString();
@@ -85,13 +85,13 @@ public final class MethodBody implements Cloneable {
this.codeBytes = new byte[0];
this.exceptions = new ABCException[0];
}
public MethodBody(Traits traits, byte[] codeBytes, ABCException[] exceptions) {
this.traits = traits;
this.codeBytes = codeBytes;
this.exceptions = exceptions;
}
public synchronized void setCodeBytes(byte codeBytes[]) {
this.codeBytes = codeBytes;
this.code = null;
@@ -70,7 +70,7 @@ public class ScriptInfo {
traitIndices.addAll(otherTraits);
otherTraits.clear();
}
if (packagePrefix == null || packageName.startsWith(packagePrefix)) {
ClassPath cp = new ClassPath(packageName, objectName);
ret.add(new ScriptPack(cp, abc, scriptIndex, traitIndices));
@@ -32,7 +32,7 @@ import java.util.List;
public abstract class Trait implements Serializable {
private static final int[] EMPTY_METADATA_ARRAY = new int[0];
public int name_index;
public int kindType;
@@ -39,11 +39,11 @@ public class Traits implements Serializable {
public Traits() {
traits = new ArrayList<>();
}
public Traits(int initialCapacity) {
traits = new ArrayList<>(initialCapacity);
}
public void delete(ABC abc, boolean d) {
for (Trait t : traits) {
t.delete(abc, d);