Loading tools/layoutlib/.idea/compiler.xml +1 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,5 @@ <processorPath useClasspath="true" /> </profile> </annotationProcessing> <bytecodeTargetLevel target="1.6" /> </component> </project> No newline at end of file tools/layoutlib/create/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAR_MANIFEST := manifest.txt LOCAL_STATIC_JAVA_LIBRARIES := \ asm-4.0 asm-5.0 LOCAL_MODULE := layoutlib_create Loading tools/layoutlib/create/create.iml +4 −4 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <module type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> Loading @@ -9,12 +9,12 @@ <sourceFolder url="file://$MODULE_DIR$/tests/mock_data" type="java-test-resource" /> <excludeFolder url="file://$MODULE_DIR$/.settings" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module-library"> <library name="asm-4.0"> <library name="asm-5.0"> <CLASSES> <root url="jar://$MODULE_DIR$/../../../../../prebuilts/misc/common/asm/asm-4.0.jar!/" /> <root url="jar://$MODULE_DIR$/../../../../../prebuilts/misc/common/asm/asm-5.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> Loading tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java +6 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureReader; import org.objectweb.asm.signature.SignatureVisitor; Loading @@ -44,7 +43,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { abstract String renameInternalType(String name); public AbstractClassAdapter(ClassVisitor cv) { super(Opcodes.ASM4, cv); super(Main.ASM_VERSION, cv); } /** Loading Loading @@ -239,7 +238,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { * The names must be full qualified internal ASM names (e.g. com/blah/MyClass$InnerClass). */ public RenameMethodAdapter(MethodVisitor mv) { super(Opcodes.ASM4, mv); super(Main.ASM_VERSION, mv); } @Override Loading Loading @@ -276,7 +275,8 @@ public abstract class AbstractClassAdapter extends ClassVisitor { } @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) { public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { // The owner sometimes turns out to be a type descriptor. We try to detect it and fix. if (owner.indexOf(';') > 0) { owner = renameTypeDesc(owner); Loading @@ -285,7 +285,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { } desc = renameMethodDesc(desc); super.visitMethodInsn(opcode, owner, name, desc); super.visitMethodInsn(opcode, owner, name, desc, itf); } @Override Loading Loading @@ -330,7 +330,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { private final SignatureVisitor mSv; public RenameSignatureAdapter(SignatureVisitor sv) { super(Opcodes.ASM4); super(Main.ASM_VERSION); mSv = sv; } Loading tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java +15 −15 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureReader; import org.objectweb.asm.signature.SignatureVisitor; Loading Loading @@ -65,7 +64,7 @@ public class AsmAnalyzer { /** Glob patterns of files to keep as is. */ private final String[] mIncludeFileGlobs; /** Internal names of classes that contain method calls that need to be rewritten. */ private final Set<String> mReplaceMethodCallClasses = new HashSet<String>(); private final Set<String> mReplaceMethodCallClasses = new HashSet<>(); /** * Creates a new analyzer. Loading Loading @@ -97,8 +96,8 @@ public class AsmAnalyzer { */ public void analyze() throws IOException, LogAbortException { TreeMap<String, ClassReader> zipClasses = new TreeMap<String, ClassReader>(); Map<String, InputStream> filesFound = new TreeMap<String, InputStream>(); TreeMap<String, ClassReader> zipClasses = new TreeMap<>(); Map<String, InputStream> filesFound = new TreeMap<>(); parseZip(mOsSourceJar, zipClasses, filesFound); mLog.info("Found %d classes in input JAR%s.", zipClasses.size(), Loading Loading @@ -189,7 +188,7 @@ public class AsmAnalyzer { */ Map<String, ClassReader> findIncludes(Map<String, ClassReader> zipClasses) throws LogAbortException { TreeMap<String, ClassReader> found = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> found = new TreeMap<>(); mLog.debug("Find classes to include."); Loading Loading @@ -318,10 +317,10 @@ public class AsmAnalyzer { Map<String, ClassReader> findDeps(Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutKeepClasses) { TreeMap<String, ClassReader> deps = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> new_deps = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> new_keep = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> temp = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> deps = new TreeMap<>(); TreeMap<String, ClassReader> new_deps = new TreeMap<>(); TreeMap<String, ClassReader> new_keep = new TreeMap<>(); TreeMap<String, ClassReader> temp = new TreeMap<>(); DependencyVisitor visitor = getVisitor(zipClasses, inOutKeepClasses, new_keep, Loading Loading @@ -399,7 +398,7 @@ public class AsmAnalyzer { Map<String, ClassReader> outKeep, Map<String,ClassReader> inDeps, Map<String,ClassReader> outDeps) { super(Opcodes.ASM4); super(Main.ASM_VERSION); mZipClasses = zipClasses; mInKeep = inKeep; mOutKeep = outKeep; Loading Loading @@ -557,7 +556,7 @@ public class AsmAnalyzer { private class MyFieldVisitor extends FieldVisitor { public MyFieldVisitor() { super(Opcodes.ASM4); super(Main.ASM_VERSION); } @Override Loading Loading @@ -630,7 +629,7 @@ public class AsmAnalyzer { private String mOwnerClass; public MyMethodVisitor(String ownerClass) { super(Opcodes.ASM4); super(Main.ASM_VERSION); mOwnerClass = ownerClass; } Loading Loading @@ -719,7 +718,8 @@ public class AsmAnalyzer { // instruction that invokes a method @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) { public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { // owner is the internal name of the method's owner class considerName(owner); Loading Loading @@ -779,7 +779,7 @@ public class AsmAnalyzer { private class MySignatureVisitor extends SignatureVisitor { public MySignatureVisitor() { super(Opcodes.ASM4); super(Main.ASM_VERSION); } // --------------------------------------------------- Loading Loading @@ -878,7 +878,7 @@ public class AsmAnalyzer { private class MyAnnotationVisitor extends AnnotationVisitor { public MyAnnotationVisitor() { super(Opcodes.ASM4); super(Main.ASM_VERSION); } // Visits a primitive value of an annotation Loading Loading
tools/layoutlib/.idea/compiler.xml +1 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,5 @@ <processorPath useClasspath="true" /> </profile> </annotationProcessing> <bytecodeTargetLevel target="1.6" /> </component> </project> No newline at end of file
tools/layoutlib/create/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAR_MANIFEST := manifest.txt LOCAL_STATIC_JAVA_LIBRARIES := \ asm-4.0 asm-5.0 LOCAL_MODULE := layoutlib_create Loading
tools/layoutlib/create/create.iml +4 −4 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <module type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> Loading @@ -9,12 +9,12 @@ <sourceFolder url="file://$MODULE_DIR$/tests/mock_data" type="java-test-resource" /> <excludeFolder url="file://$MODULE_DIR$/.settings" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module-library"> <library name="asm-4.0"> <library name="asm-5.0"> <CLASSES> <root url="jar://$MODULE_DIR$/../../../../../prebuilts/misc/common/asm/asm-4.0.jar!/" /> <root url="jar://$MODULE_DIR$/../../../../../prebuilts/misc/common/asm/asm-5.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> Loading
tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java +6 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureReader; import org.objectweb.asm.signature.SignatureVisitor; Loading @@ -44,7 +43,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { abstract String renameInternalType(String name); public AbstractClassAdapter(ClassVisitor cv) { super(Opcodes.ASM4, cv); super(Main.ASM_VERSION, cv); } /** Loading Loading @@ -239,7 +238,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { * The names must be full qualified internal ASM names (e.g. com/blah/MyClass$InnerClass). */ public RenameMethodAdapter(MethodVisitor mv) { super(Opcodes.ASM4, mv); super(Main.ASM_VERSION, mv); } @Override Loading Loading @@ -276,7 +275,8 @@ public abstract class AbstractClassAdapter extends ClassVisitor { } @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) { public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { // The owner sometimes turns out to be a type descriptor. We try to detect it and fix. if (owner.indexOf(';') > 0) { owner = renameTypeDesc(owner); Loading @@ -285,7 +285,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { } desc = renameMethodDesc(desc); super.visitMethodInsn(opcode, owner, name, desc); super.visitMethodInsn(opcode, owner, name, desc, itf); } @Override Loading Loading @@ -330,7 +330,7 @@ public abstract class AbstractClassAdapter extends ClassVisitor { private final SignatureVisitor mSv; public RenameSignatureAdapter(SignatureVisitor sv) { super(Opcodes.ASM4); super(Main.ASM_VERSION); mSv = sv; } Loading
tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java +15 −15 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureReader; import org.objectweb.asm.signature.SignatureVisitor; Loading Loading @@ -65,7 +64,7 @@ public class AsmAnalyzer { /** Glob patterns of files to keep as is. */ private final String[] mIncludeFileGlobs; /** Internal names of classes that contain method calls that need to be rewritten. */ private final Set<String> mReplaceMethodCallClasses = new HashSet<String>(); private final Set<String> mReplaceMethodCallClasses = new HashSet<>(); /** * Creates a new analyzer. Loading Loading @@ -97,8 +96,8 @@ public class AsmAnalyzer { */ public void analyze() throws IOException, LogAbortException { TreeMap<String, ClassReader> zipClasses = new TreeMap<String, ClassReader>(); Map<String, InputStream> filesFound = new TreeMap<String, InputStream>(); TreeMap<String, ClassReader> zipClasses = new TreeMap<>(); Map<String, InputStream> filesFound = new TreeMap<>(); parseZip(mOsSourceJar, zipClasses, filesFound); mLog.info("Found %d classes in input JAR%s.", zipClasses.size(), Loading Loading @@ -189,7 +188,7 @@ public class AsmAnalyzer { */ Map<String, ClassReader> findIncludes(Map<String, ClassReader> zipClasses) throws LogAbortException { TreeMap<String, ClassReader> found = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> found = new TreeMap<>(); mLog.debug("Find classes to include."); Loading Loading @@ -318,10 +317,10 @@ public class AsmAnalyzer { Map<String, ClassReader> findDeps(Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutKeepClasses) { TreeMap<String, ClassReader> deps = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> new_deps = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> new_keep = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> temp = new TreeMap<String, ClassReader>(); TreeMap<String, ClassReader> deps = new TreeMap<>(); TreeMap<String, ClassReader> new_deps = new TreeMap<>(); TreeMap<String, ClassReader> new_keep = new TreeMap<>(); TreeMap<String, ClassReader> temp = new TreeMap<>(); DependencyVisitor visitor = getVisitor(zipClasses, inOutKeepClasses, new_keep, Loading Loading @@ -399,7 +398,7 @@ public class AsmAnalyzer { Map<String, ClassReader> outKeep, Map<String,ClassReader> inDeps, Map<String,ClassReader> outDeps) { super(Opcodes.ASM4); super(Main.ASM_VERSION); mZipClasses = zipClasses; mInKeep = inKeep; mOutKeep = outKeep; Loading Loading @@ -557,7 +556,7 @@ public class AsmAnalyzer { private class MyFieldVisitor extends FieldVisitor { public MyFieldVisitor() { super(Opcodes.ASM4); super(Main.ASM_VERSION); } @Override Loading Loading @@ -630,7 +629,7 @@ public class AsmAnalyzer { private String mOwnerClass; public MyMethodVisitor(String ownerClass) { super(Opcodes.ASM4); super(Main.ASM_VERSION); mOwnerClass = ownerClass; } Loading Loading @@ -719,7 +718,8 @@ public class AsmAnalyzer { // instruction that invokes a method @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) { public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { // owner is the internal name of the method's owner class considerName(owner); Loading Loading @@ -779,7 +779,7 @@ public class AsmAnalyzer { private class MySignatureVisitor extends SignatureVisitor { public MySignatureVisitor() { super(Opcodes.ASM4); super(Main.ASM_VERSION); } // --------------------------------------------------- Loading Loading @@ -878,7 +878,7 @@ public class AsmAnalyzer { private class MyAnnotationVisitor extends AnnotationVisitor { public MyAnnotationVisitor() { super(Opcodes.ASM4); super(Main.ASM_VERSION); } // Visits a primitive value of an annotation Loading