Reformat files using Android-style imports.
Test: m ahat-test
Change-Id: Ib0eee0b7c414d85c245c7ef3163485cfa6ff34a4
diff --git a/tools/ahat/src/AhatSnapshot.java b/tools/ahat/src/AhatSnapshot.java
index d088e8c..e6f8411 100644
--- a/tools/ahat/src/AhatSnapshot.java
+++ b/tools/ahat/src/AhatSnapshot.java
@@ -16,6 +16,7 @@
package com.android.ahat;
+import com.android.tools.perflib.captures.MemoryMappedFileBuffer;
import com.android.tools.perflib.heap.ClassObj;
import com.android.tools.perflib.heap.Heap;
import com.android.tools.perflib.heap.Instance;
@@ -24,9 +25,11 @@
import com.android.tools.perflib.heap.Snapshot;
import com.android.tools.perflib.heap.StackFrame;
import com.android.tools.perflib.heap.StackTrace;
-import com.android.tools.perflib.captures.MemoryMappedFileBuffer;
+
import com.google.common.collect.Lists;
+
import gnu.trove.TObjectProcedure;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/tools/ahat/src/InstanceUtils.java b/tools/ahat/src/InstanceUtils.java
index 8defba2..3cdb40c 100644
--- a/tools/ahat/src/InstanceUtils.java
+++ b/tools/ahat/src/InstanceUtils.java
@@ -19,9 +19,10 @@
import com.android.tools.perflib.heap.ArrayInstance;
import com.android.tools.perflib.heap.ClassInstance;
import com.android.tools.perflib.heap.ClassObj;
-import com.android.tools.perflib.heap.Instance;
import com.android.tools.perflib.heap.Heap;
+import com.android.tools.perflib.heap.Instance;
import com.android.tools.perflib.heap.Type;
+
import java.awt.image.BufferedImage;
/**
@@ -42,11 +43,11 @@
* Returns null if the instance is not a byte array.
*/
private static byte[] asByteArray(Instance inst) {
- if (! (inst instanceof ArrayInstance)) {
+ if (!(inst instanceof ArrayInstance)) {
return null;
}
- ArrayInstance array = (ArrayInstance)inst;
+ ArrayInstance array = (ArrayInstance) inst;
if (array.getArrayType() != Type.BYTE) {
return null;
}
@@ -54,7 +55,7 @@
Object[] objs = array.getValues();
byte[] bytes = new byte[objs.length];
for (int i = 0; i < objs.length; i++) {
- Byte b = (Byte)objs[i];
+ Byte b = (Byte) objs[i];
bytes[i] = b.byteValue();
}
return bytes;
@@ -143,10 +144,10 @@
int[] abgr = new int[height * width];
for (int i = 0; i < abgr.length; i++) {
abgr[i] = (
- (((int)buffer[i * 4 + 3] & 0xFF) << 24) +
- (((int)buffer[i * 4 + 0] & 0xFF) << 16) +
- (((int)buffer[i * 4 + 1] & 0xFF) << 8) +
- ((int)buffer[i * 4 + 2] & 0xFF));
+ (((int) buffer[i * 4 + 3] & 0xFF) << 24)
+ + (((int) buffer[i * 4 + 0] & 0xFF) << 16)
+ + (((int) buffer[i * 4 + 1] & 0xFF) << 8)
+ + ((int) buffer[i * 4 + 2] & 0xFF));
}
BufferedImage bitmap = new BufferedImage(
@@ -185,7 +186,7 @@
if (!(value instanceof Instance)) {
return null;
}
- return (Instance)value;
+ return (Instance) value;
}
/**
@@ -199,7 +200,7 @@
if (!(value instanceof Integer)) {
return def;
}
- return (Integer)value;
+ return (Integer) value;
}
/**
@@ -213,7 +214,7 @@
if (!(value instanceof Long)) {
return def;
}
- return (Long)value;
+ return (Long) value;
}
/**
@@ -226,7 +227,7 @@
if (!(value instanceof Instance)) {
return null;
}
- return asByteArray((Instance)value);
+ return asByteArray((Instance) value);
}
// Return the bitmap instance associated with this object, or null if there
@@ -243,7 +244,7 @@
}
if (inst instanceof ArrayInstance) {
- ArrayInstance array = (ArrayInstance)inst;
+ ArrayInstance array = (ArrayInstance) inst;
if (array.getArrayType() == Type.BYTE && inst.getHardReverseReferences().size() == 1) {
Instance ref = inst.getHardReverseReferences().get(0);
ClassObj clsref = ref.getClassObj();
@@ -323,10 +324,10 @@
// Note: We know inst as an instance of ClassInstance because we already
// read the nativePtr field from it.
Instance registry = null;
- for (ClassInstance.FieldValue field : ((ClassInstance)inst).getValues()) {
+ for (ClassInstance.FieldValue field : ((ClassInstance) inst).getValues()) {
Object fieldValue = field.getValue();
if (fieldValue instanceof Instance) {
- Instance fieldInst = (Instance)fieldValue;
+ Instance fieldInst = (Instance) fieldValue;
if (isInstanceOfClass(fieldInst, "libcore.util.NativeAllocationRegistry")) {
registry = fieldInst;
break;
diff --git a/tools/ahat/src/Site.java b/tools/ahat/src/Site.java
index d504096..dbb84f6 100644
--- a/tools/ahat/src/Site.java
+++ b/tools/ahat/src/Site.java
@@ -20,6 +20,7 @@
import com.android.tools.perflib.heap.Heap;
import com.android.tools.perflib.heap.Instance;
import com.android.tools.perflib.heap.StackFrame;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
diff --git a/tools/ahat/src/Sort.java b/tools/ahat/src/Sort.java
index c5f89c3..8a3d9f2 100644
--- a/tools/ahat/src/Sort.java
+++ b/tools/ahat/src/Sort.java
@@ -16,13 +16,14 @@
package com.android.ahat;
-import com.android.tools.perflib.heap.Instance;
import com.android.tools.perflib.heap.Heap;
+import com.android.tools.perflib.heap.Instance;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
-import java.util.List;
import java.util.Iterator;
+import java.util.List;
/**
* Provides Comparators and helper functions for sorting Instances, Sites, and