[proguard] 01/07: Imported Upstream version 5.2.1
komal sukhani
komal-guest at moszumanska.debian.org
Tue Jul 28 12:58:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
komal-guest pushed a commit to branch master
in repository proguard.
commit a585bd2671e31cd0d0538a69aa3ec2af8ea92762
Author: Komal Sukhani <komaldsukhani at gmail.com>
Date: Mon Jul 27 22:24:09 2015 +0530
Imported Upstream version 5.2.1
---
README | 16 +-
{build => buildscripts}/README | 4 +-
{build => buildscripts}/build.properties | 0
{build => buildscripts}/build.sh | 9 +-
{build => buildscripts}/build.xml | 11 +-
{build => buildscripts}/makefile | 20 +-
{build => buildscripts}/maven/ant/pom.xml | 2 +-
{build => buildscripts}/maven/base/pom.xml | 2 +-
{build => buildscripts}/maven/gradle/pom.xml | 14 +-
{build => buildscripts}/maven/gui/pom.xml | 2 +-
{build => buildscripts}/maven/pom.xml | 6 +-
{build => buildscripts}/maven/retrace/pom.xml | 2 +-
{build => buildscripts}/maven/wtk/pom.xml | 2 +-
src/proguard/ArgumentWordReader.java | 2 +-
src/proguard/AssumeNoSideEffectsChecker.java | 2 +-
src/proguard/ClassMemberChecker.java | 2 +-
src/proguard/ClassPath.java | 2 +-
src/proguard/ClassPathEntry.java | 2 +-
src/proguard/ClassSpecification.java | 2 +-
src/proguard/ClassSpecificationVisitorFactory.java | 2 +-
src/proguard/Configuration.java | 2 +-
src/proguard/ConfigurationChecker.java | 2 +-
src/proguard/ConfigurationConstants.java | 2 +-
src/proguard/ConfigurationParser.java | 2 +-
src/proguard/ConfigurationWriter.java | 2 +-
src/proguard/DataEntryReaderFactory.java | 2 +-
src/proguard/DataEntryWriterFactory.java | 2 +-
src/proguard/DescriptorKeepChecker.java | 2 +-
src/proguard/DuplicateClassPrinter.java | 2 +-
src/proguard/FileWordReader.java | 2 +-
src/proguard/FullyQualifiedClassNameChecker.java | 2 +-
src/proguard/GPL.java | 2 +-
src/proguard/GetAnnotationChecker.java | 2 +-
src/proguard/GetEnclosingClassChecker.java | 2 +-
src/proguard/GetEnclosingMethodChecker.java | 2 +-
src/proguard/GetSignatureChecker.java | 2 +-
src/proguard/Initializer.java | 2 +-
src/proguard/InputReader.java | 2 +-
src/proguard/KeepClassMemberChecker.java | 2 +-
src/proguard/KeepClassSpecification.java | 2 +-
src/proguard/LibraryKeepChecker.java | 2 +-
src/proguard/LineWordReader.java | 2 +-
src/proguard/MemberSpecification.java | 2 +-
src/proguard/OutputWriter.java | 2 +-
src/proguard/ParseException.java | 2 +-
src/proguard/ProGuard.java | 35 +-
src/proguard/SeedPrinter.java | 2 +-
src/proguard/SubclassedClassFilter.java | 2 +-
src/proguard/Targeter.java | 2 +-
src/proguard/UpToDateChecker.java | 2 +-
src/proguard/WordReader.java | 2 +-
src/proguard/ant/ClassPathElement.java | 2 +-
src/proguard/ant/ClassSpecificationElement.java | 2 +-
src/proguard/ant/ConfigurationElement.java | 2 +-
src/proguard/ant/ConfigurationTask.java | 2 +-
src/proguard/ant/FilterElement.java | 2 +-
src/proguard/ant/KeepSpecificationElement.java | 2 +-
src/proguard/ant/MemberSpecificationElement.java | 2 +-
src/proguard/ant/ProGuardTask.java | 2 +-
src/proguard/classfile/ClassConstants.java | 60 +-
src/proguard/classfile/ClassPool.java | 2 +-
src/proguard/classfile/Clazz.java | 7 +-
src/proguard/classfile/Field.java | 2 +-
src/proguard/classfile/JavaConstants.java | 2 +-
src/proguard/classfile/LibraryClass.java | 7 +-
src/proguard/classfile/LibraryField.java | 2 +-
src/proguard/classfile/LibraryMember.java | 2 +-
src/proguard/classfile/LibraryMethod.java | 12 +-
src/proguard/classfile/Member.java | 2 +-
src/proguard/classfile/Method.java | 2 +-
src/proguard/classfile/ProgramClass.java | 16 +-
src/proguard/classfile/ProgramField.java | 2 +-
src/proguard/classfile/ProgramMember.java | 2 +-
src/proguard/classfile/ProgramMethod.java | 12 +-
src/proguard/classfile/VisitorAccepter.java | 2 +-
src/proguard/classfile/attribute/Attribute.java | 2 +-
.../classfile/attribute/BootstrapMethodInfo.java | 2 +-
.../attribute/BootstrapMethodsAttribute.java | 2 +-
.../classfile/attribute/CodeAttribute.java | 2 +-
.../attribute/ConstantValueAttribute.java | 2 +-
.../classfile/attribute/DeprecatedAttribute.java | 2 +-
.../attribute/EnclosingMethodAttribute.java | 2 +-
.../classfile/attribute/ExceptionInfo.java | 2 +-
.../classfile/attribute/ExceptionsAttribute.java | 2 +-
...eAttribute.java => ExtendedLineNumberInfo.java} | 35 +-
.../classfile/attribute/InnerClassesAttribute.java | 2 +-
.../classfile/attribute/InnerClassesInfo.java | 2 +-
.../classfile/attribute/LineNumberInfo.java | 13 +-
.../attribute/LineNumberTableAttribute.java | 74 ++-
.../classfile/attribute/LocalVariableInfo.java | 2 +-
.../attribute/LocalVariableTableAttribute.java | 2 +-
.../classfile/attribute/LocalVariableTypeInfo.java | 2 +-
.../attribute/LocalVariableTypeTableAttribute.java | 2 +-
.../attribute/MethodParametersAttribute.java | 2 +-
.../classfile/attribute/ParameterInfo.java | 4 +-
.../classfile/attribute/SignatureAttribute.java | 12 +-
.../classfile/attribute/SourceDirAttribute.java | 2 +-
.../classfile/attribute/SourceFileAttribute.java | 2 +-
.../classfile/attribute/SyntheticAttribute.java | 2 +-
.../classfile/attribute/UnknownAttribute.java | 2 +-
.../classfile/attribute/annotation/Annotation.java | 2 +-
.../annotation/AnnotationDefaultAttribute.java | 2 +-
.../annotation/AnnotationElementValue.java | 2 +-
.../attribute/annotation/AnnotationsAttribute.java | 2 +-
.../attribute/annotation/ArrayElementValue.java | 2 +-
.../attribute/annotation/ClassElementValue.java | 2 +-
.../attribute/annotation/ConstantElementValue.java | 2 +-
.../attribute/annotation/ElementValue.java | 2 +-
.../annotation/EnumConstantElementValue.java | 2 +-
.../annotation/ParameterAnnotationsAttribute.java | 2 +-
.../RuntimeInvisibleAnnotationsAttribute.java | 2 +-
...timeInvisibleParameterAnnotationsAttribute.java | 2 +-
.../RuntimeInvisibleTypeAnnotationsAttribute.java | 2 +-
.../RuntimeVisibleAnnotationsAttribute.java | 2 +-
...untimeVisibleParameterAnnotationsAttribute.java | 2 +-
.../RuntimeVisibleTypeAnnotationsAttribute.java | 2 +-
.../attribute/annotation/TypeAnnotation.java | 2 +-
.../annotation/TypeAnnotationsAttribute.java | 2 +-
.../attribute/annotation/TypePathInfo.java | 2 +-
.../annotation/target/CatchTargetInfo.java | 2 +-
.../annotation/target/EmptyTargetInfo.java | 2 +-
.../target/FormalParameterTargetInfo.java | 2 +-
.../target/LocalVariableTargetElement.java | 2 +-
.../annotation/target/LocalVariableTargetInfo.java | 2 +-
.../annotation/target/OffsetTargetInfo.java | 2 +-
.../annotation/target/SuperTypeTargetInfo.java | 2 +-
.../attribute/annotation/target/TargetInfo.java | 2 +-
.../annotation/target/ThrowsTargetInfo.java | 2 +-
.../annotation/target/TypeArgumentTargetInfo.java | 2 +-
.../target/TypeParameterBoundTargetInfo.java | 2 +-
.../annotation/target/TypeParameterTargetInfo.java | 2 +-
.../visitor/LocalVariableTargetElementVisitor.java | 2 +-
.../target/visitor/TargetInfoVisitor.java | 2 +-
.../annotation/visitor/AllAnnotationVisitor.java | 2 +-
.../annotation/visitor/AllElementValueVisitor.java | 2 +-
.../annotation/visitor/AnnotatedClassVisitor.java | 2 +-
.../visitor/AnnotationToMemberVisitor.java | 2 +-
.../annotation/visitor/AnnotationTypeFilter.java | 2 +-
.../annotation/visitor/AnnotationVisitor.java | 2 +-
.../annotation/visitor/ElementValueVisitor.java | 2 +-
.../annotation/visitor/TypeAnnotationVisitor.java | 2 +-
.../annotation/visitor/TypePathInfoVisitor.java | 2 +-
.../attribute/preverification/DoubleType.java | 2 +-
.../attribute/preverification/FloatType.java | 2 +-
.../attribute/preverification/FullFrame.java | 2 +-
.../attribute/preverification/IntegerType.java | 2 +-
.../attribute/preverification/LessZeroFrame.java | 2 +-
.../attribute/preverification/LongType.java | 2 +-
.../attribute/preverification/MoreZeroFrame.java | 2 +-
.../attribute/preverification/NullType.java | 2 +-
.../attribute/preverification/ObjectType.java | 2 +-
.../attribute/preverification/SameOneFrame.java | 2 +-
.../attribute/preverification/SameZeroFrame.java | 2 +-
.../preverification/StackMapAttribute.java | 2 +-
.../attribute/preverification/StackMapFrame.java | 2 +-
.../preverification/StackMapTableAttribute.java | 2 +-
.../attribute/preverification/TopType.java | 2 +-
.../preverification/UninitializedThisType.java | 2 +-
.../preverification/UninitializedType.java | 2 +-
.../preverification/VerificationType.java | 2 +-
.../preverification/VerificationTypeFactory.java | 2 +-
.../visitor/StackMapFrameVisitor.java | 2 +-
.../visitor/VerificationTypeVisitor.java | 2 +-
.../attribute/visitor/AllAttributeVisitor.java | 2 +-
.../visitor/AllBootstrapMethodInfoVisitor.java | 2 +-
.../attribute/visitor/AllExceptionInfoVisitor.java | 2 +-
.../visitor/AllInnerClassesInfoVisitor.java | 2 +-
...oVisitor.java => AllLineNumberInfoVisitor.java} | 18 +-
.../attribute/visitor/AttributeNameFilter.java | 2 +-
.../attribute/visitor/AttributeVisitor.java | 2 +-
.../visitor/BootstrapMethodInfoVisitor.java | 2 +-
.../attribute/visitor/ExceptionInfoVisitor.java | 2 +-
.../attribute/visitor/InnerClassesInfoVisitor.java | 2 +-
.../attribute/visitor/LineNumberInfoVisitor.java | 2 +-
.../attribute/visitor/LineNumberRangeFinder.java | 89 +++
.../visitor/LocalVariableInfoVisitor.java | 2 +-
.../visitor/LocalVariableTypeInfoVisitor.java | 2 +-
.../attribute/visitor/MultiAttributeVisitor.java | 2 +-
.../attribute/visitor/NonEmptyAttributeFilter.java | 2 +-
.../attribute/visitor/ParameterInfoVisitor.java | 2 +-
.../attribute/visitor/RequiredAttributeFilter.java | 2 +-
.../attribute/visitor/StackSizeComputer.java | 2 +-
src/proguard/classfile/constant/ClassConstant.java | 2 +-
src/proguard/classfile/constant/Constant.java | 2 +-
.../classfile/constant/DoubleConstant.java | 2 +-
.../classfile/constant/FieldrefConstant.java | 2 +-
src/proguard/classfile/constant/FloatConstant.java | 2 +-
.../classfile/constant/IntegerConstant.java | 2 +-
.../constant/InterfaceMethodrefConstant.java | 2 +-
.../classfile/constant/InvokeDynamicConstant.java | 2 +-
src/proguard/classfile/constant/LongConstant.java | 2 +-
.../classfile/constant/MethodHandleConstant.java | 12 +-
.../classfile/constant/MethodTypeConstant.java | 2 +-
.../classfile/constant/MethodrefConstant.java | 2 +-
.../classfile/constant/NameAndTypeConstant.java | 2 +-
src/proguard/classfile/constant/RefConstant.java | 2 +-
.../classfile/constant/StringConstant.java | 2 +-
src/proguard/classfile/constant/Utf8Constant.java | 2 +-
.../constant/visitor/AllConstantVisitor.java | 2 +-
.../visitor/BootstrapMethodArgumentVisitor.java} | 36 +-
.../visitor/BootstrapMethodHandleTraveler.java | 2 +-
.../constant/visitor/ConstantTagFilter.java | 2 +-
.../constant/visitor/ConstantVisitor.java | 2 +-
.../visitor/ExceptClassConstantFilter.java | 2 +-
.../constant/visitor/MethodrefTraveler.java | 2 +-
src/proguard/classfile/editor/AccessFixer.java | 2 +-
src/proguard/classfile/editor/AnnotationAdder.java | 2 +-
.../editor/AnnotationsAttributeEditor.java | 2 +-
src/proguard/classfile/editor/AttributeAdder.java | 25 +-
src/proguard/classfile/editor/AttributeSorter.java | 2 +-
.../classfile/editor/AttributesEditor.java | 2 +-
.../classfile/editor/BootstrapMethodInfoAdder.java | 2 +-
.../classfile/editor/BootstrapMethodRemapper.java | 10 +-
.../editor/BootstrapMethodsAttributeAdder.java | 2 +-
.../editor/BootstrapMethodsAttributeEditor.java | 2 +-
.../classfile/editor/BridgeMethodFixer.java | 2 +-
src/proguard/classfile/editor/ClassEditor.java | 2 +-
.../classfile/editor/ClassElementSorter.java | 2 +-
.../classfile/editor/ClassMemberSorter.java | 2 +-
.../classfile/editor/ClassReferenceFixer.java | 9 +-
.../classfile/editor/CodeAttributeComposer.java | 148 ++++-
.../classfile/editor/CodeAttributeEditor.java | 10 +-
.../editor/CodeAttributeEditorResetter.java | 2 +-
.../classfile/editor/ComparableConstant.java | 6 +-
src/proguard/classfile/editor/ConstantAdder.java | 2 +-
.../classfile/editor/ConstantPoolEditor.java | 2 +-
.../classfile/editor/ConstantPoolRemapper.java | 16 +-
.../classfile/editor/ConstantPoolShrinker.java | 16 +-
.../classfile/editor/ConstantPoolSorter.java | 2 +-
.../classfile/editor/ElementValueAdder.java | 2 +-
.../classfile/editor/ElementValuesEditor.java | 2 +-
src/proguard/classfile/editor/ExceptionAdder.java | 2 +-
.../classfile/editor/ExceptionInfoAdder.java | 2 +-
.../editor/ExceptionsAttributeEditor.java | 2 +-
.../classfile/editor/InnerClassesAccessFixer.java | 2 +-
.../classfile/editor/InstructionAdder.java | 2 +-
.../classfile/editor/InstructionWriter.java | 2 +-
src/proguard/classfile/editor/InterfaceAdder.java | 2 +-
.../classfile/editor/InterfaceDeleter.java | 209 +++++++
src/proguard/classfile/editor/InterfaceSorter.java | 195 ++++--
.../classfile/editor/InterfacesEditor.java | 2 +-
.../classfile/editor/LineNumberInfoAdder.java | 46 +-
.../editor/LineNumberTableAttributeEditor.java | 2 +-
.../editor/LineNumberTableAttributeTrimmer.java | 78 +++
.../classfile/editor/LocalVariableInfoAdder.java | 2 +-
.../editor/LocalVariableTableAttributeEditor.java | 2 +-
.../editor/LocalVariableTypeInfoAdder.java | 2 +-
.../LocalVariableTypeTableAttributeEditor.java | 2 +-
src/proguard/classfile/editor/MemberAdder.java | 2 +-
.../classfile/editor/MemberReferenceFixer.java | 2 +-
.../classfile/editor/MethodInvocationFixer.java | 2 +-
.../classfile/editor/NameAndTypeShrinker.java | 16 +-
.../classfile/editor/NamedAttributeDeleter.java | 2 +-
.../ParameterAnnotationsAttributeEditor.java | 2 +-
.../classfile/editor/ParameterInfoAdder.java | 2 +-
.../classfile/editor/StackSizeUpdater.java | 2 +-
src/proguard/classfile/editor/SubclassAdder.java | 2 +-
src/proguard/classfile/editor/SubclassToAdder.java | 2 +-
src/proguard/classfile/editor/Utf8Shrinker.java | 16 +-
src/proguard/classfile/editor/VariableCleaner.java | 2 +-
src/proguard/classfile/editor/VariableEditor.java | 2 +-
.../classfile/editor/VariableRemapper.java | 2 +-
.../classfile/editor/VariableSizeUpdater.java | 2 +-
.../classfile/instruction/BranchInstruction.java | 7 +-
.../classfile/instruction/ConstantInstruction.java | 2 +-
.../classfile/instruction/Instruction.java | 2 +-
.../instruction/InstructionConstants.java | 2 +-
.../classfile/instruction/InstructionFactory.java | 2 +-
.../classfile/instruction/InstructionUtil.java | 2 +-
.../instruction/LookUpSwitchInstruction.java | 2 +-
.../classfile/instruction/SimpleInstruction.java | 2 +-
.../classfile/instruction/SwitchInstruction.java | 2 +-
.../instruction/TableSwitchInstruction.java | 2 +-
.../classfile/instruction/VariableInstruction.java | 2 +-
.../instruction/visitor/AllInstructionVisitor.java | 2 +-
.../visitor/InstructionConstantVisitor.java | 2 +-
.../instruction/visitor/InstructionCounter.java | 2 +-
.../instruction/visitor/InstructionVisitor.java | 2 +-
.../visitor/MultiInstructionVisitor.java | 2 +-
src/proguard/classfile/io/LibraryClassReader.java | 2 +-
src/proguard/classfile/io/ProgramClassReader.java | 2 +-
src/proguard/classfile/io/ProgramClassWriter.java | 2 +-
src/proguard/classfile/io/RuntimeDataInput.java | 2 +-
src/proguard/classfile/io/RuntimeDataOutput.java | 2 +-
src/proguard/classfile/package.html | 10 +-
src/proguard/classfile/util/AccessUtil.java | 6 +-
.../classfile/util/AllParameterVisitor.java | 2 +-
.../classfile/util/ClassReferenceInitializer.java | 2 +-
.../util/ClassSubHierarchyInitializer.java | 2 +-
.../util/ClassSuperHierarchyInitializer.java | 2 +-
src/proguard/classfile/util/ClassUtil.java | 2 +-
.../classfile/util/DescriptorClassEnumeration.java | 2 +-
.../util/DynamicClassReferenceInitializer.java | 2 +-
.../util/DynamicMemberReferenceInitializer.java | 2 +-
.../util/EnumFieldReferenceInitializer.java | 2 +-
.../classfile/util/ExternalTypeEnumeration.java | 2 +-
.../classfile/util/InstructionSequenceMatcher.java | 2 +-
.../classfile/util/InternalTypeEnumeration.java | 83 ++-
src/proguard/classfile/util/MemberFinder.java | 2 +-
src/proguard/classfile/util/MethodLinker.java | 2 +-
src/proguard/classfile/util/SimplifiedVisitor.java | 2 +-
.../classfile/util/StringReferenceInitializer.java | 2 +-
src/proguard/classfile/util/StringSharer.java | 2 +-
src/proguard/classfile/util/WarningPrinter.java | 2 +-
.../classfile/visitor/AllClassVisitor.java | 2 +-
.../classfile/visitor/AllFieldVisitor.java | 2 +-
.../classfile/visitor/AllMemberVisitor.java | 2 +-
.../classfile/visitor/AllMethodVisitor.java | 2 +-
.../classfile/visitor/BottomClassFilter.java | 2 +-
.../classfile/visitor/ClassAccessFilter.java | 2 +-
src/proguard/classfile/visitor/ClassCleaner.java | 53 +-
src/proguard/classfile/visitor/ClassCollector.java | 2 +-
src/proguard/classfile/visitor/ClassCounter.java | 2 +-
.../classfile/visitor/ClassHierarchyTraveler.java | 2 +-
.../classfile/visitor/ClassNameFilter.java | 2 +-
.../classfile/visitor/ClassPoolFiller.java | 2 +-
.../classfile/visitor/ClassPoolVisitor.java | 2 +-
.../classfile/visitor/ClassPresenceFilter.java | 2 +-
src/proguard/classfile/visitor/ClassPrinter.java | 5 +-
.../classfile/visitor/ClassVersionFilter.java | 2 +-
.../classfile/visitor/ClassVersionSetter.java | 2 +-
src/proguard/classfile/visitor/ClassVisitor.java | 2 +-
.../visitor/ConcreteClassDownTraveler.java | 2 +-
.../classfile/visitor/DotClassClassVisitor.java | 2 +-
.../visitor/DynamicReturnedClassVisitor.java | 2 +-
.../classfile/visitor/ExceptClassFilter.java | 2 +-
.../classfile/visitor/ExceptClassesFilter.java | 2 +-
.../classfile/visitor/ExceptionCounter.java | 2 +-
.../visitor/ExceptionExcludedOffsetFilter.java | 2 +-
.../visitor/ExceptionHandlerConstantVisitor.java | 2 +-
.../classfile/visitor/ExceptionHandlerFilter.java | 2 +-
.../classfile/visitor/ExceptionOffsetFilter.java | 2 +-
.../classfile/visitor/ExceptionRangeFilter.java | 2 +-
.../visitor/ImplementedClassConstantFilter.java | 2 +-
.../classfile/visitor/ImplementedClassFilter.java | 2 +-
.../visitor/ImplementingClassConstantFilter.java | 2 +-
.../visitor/InitializerMethodFilter.java} | 29 +-
.../classfile/visitor/LibraryClassFilter.java | 2 +-
.../classfile/visitor/LibraryMemberFilter.java | 2 +-
.../classfile/visitor/MemberAccessFilter.java | 2 +-
.../classfile/visitor/MemberClassAccessFilter.java | 2 +-
.../classfile/visitor/MemberCollector.java | 2 +-
src/proguard/classfile/visitor/MemberCounter.java | 2 +-
.../classfile/visitor/MemberDescriptorFilter.java | 2 +-
.../MemberDescriptorReferencedClassVisitor.java | 2 +-
.../classfile/visitor/MemberNameFilter.java | 2 +-
.../classfile/visitor/MemberToClassVisitor.java | 2 +-
src/proguard/classfile/visitor/MemberVisitor.java | 2 +-
.../visitor/MethodImplementationFilter.java | 2 +-
.../visitor/MethodImplementationTraveler.java | 2 +-
.../classfile/visitor/MultiClassPoolVisitor.java | 2 +-
.../classfile/visitor/MultiClassVisitor.java | 2 +-
.../classfile/visitor/MultiMemberVisitor.java | 2 +-
.../classfile/visitor/NamedClassVisitor.java | 2 +-
.../classfile/visitor/NamedFieldVisitor.java | 2 +-
.../classfile/visitor/NamedMethodVisitor.java | 2 +-
.../classfile/visitor/ParameterVisitor.java | 2 +-
.../classfile/visitor/ProgramClassFilter.java | 2 +-
.../classfile/visitor/ProgramMemberFilter.java | 2 +-
.../classfile/visitor/ReferencedClassVisitor.java | 2 +-
.../classfile/visitor/ReferencedMemberVisitor.java | 2 +-
.../classfile/visitor/SimilarMemberVisitor.java | 2 +-
.../classfile/visitor/SimpleClassPrinter.java | 2 +-
src/proguard/classfile/visitor/SubclassFilter.java | 2 +-
.../classfile/visitor/SubclassTraveler.java | 2 +-
.../classfile/visitor/VariableClassVisitor.java | 2 +-
.../classfile/visitor/VariableMemberVisitor.java | 2 +-
src/proguard/evaluation/BasicBranchUnit.java | 2 +-
src/proguard/evaluation/BasicInvocationUnit.java | 30 +-
src/proguard/evaluation/BranchUnit.java | 2 +-
.../evaluation/ClassConstantValueFactory.java | 2 +-
src/proguard/evaluation/ConstantValueFactory.java | 2 +-
src/proguard/evaluation/InvocationUnit.java | 2 +-
src/proguard/evaluation/Processor.java | 2 +-
src/proguard/evaluation/Stack.java | 6 +-
src/proguard/evaluation/TracedStack.java | 2 +-
src/proguard/evaluation/TracedVariables.java | 2 +-
src/proguard/evaluation/Variables.java | 8 +-
.../evaluation/value/ArrayReferenceValue.java | 2 +-
src/proguard/evaluation/value/Category1Value.java | 2 +-
src/proguard/evaluation/value/Category2Value.java | 2 +-
src/proguard/evaluation/value/ComparisonValue.java | 2 +-
.../evaluation/value/CompositeDoubleValue.java | 2 +-
.../evaluation/value/CompositeFloatValue.java | 2 +-
.../evaluation/value/CompositeIntegerValue.java | 2 +-
.../evaluation/value/CompositeLongValue.java | 2 +-
.../evaluation/value/ConvertedByteValue.java | 2 +-
.../evaluation/value/ConvertedCharacterValue.java | 2 +-
.../evaluation/value/ConvertedDoubleValue.java | 2 +-
.../evaluation/value/ConvertedFloatValue.java | 2 +-
.../evaluation/value/ConvertedIntegerValue.java | 2 +-
.../evaluation/value/ConvertedLongValue.java | 2 +-
.../evaluation/value/ConvertedShortValue.java | 2 +-
.../value/DetailedArrayReferenceValue.java | 2 +-
.../evaluation/value/DetailedValueFactory.java | 2 +-
src/proguard/evaluation/value/DoubleValue.java | 2 +-
src/proguard/evaluation/value/FloatValue.java | 2 +-
.../value/IdentifiedArrayReferenceValue.java | 2 +-
.../evaluation/value/IdentifiedDoubleValue.java | 2 +-
.../evaluation/value/IdentifiedFloatValue.java | 2 +-
.../evaluation/value/IdentifiedIntegerValue.java | 2 +-
.../evaluation/value/IdentifiedLongValue.java | 2 +-
.../evaluation/value/IdentifiedReferenceValue.java | 2 +-
.../evaluation/value/IdentifiedValueFactory.java | 2 +-
.../evaluation/value/InitialValueFactory.java | 2 +-
.../evaluation/value/InstructionOffsetValue.java | 2 +-
src/proguard/evaluation/value/IntegerValue.java | 2 +-
src/proguard/evaluation/value/LongValue.java | 2 +-
.../evaluation/value/NegatedDoubleValue.java | 2 +-
.../evaluation/value/NegatedFloatValue.java | 2 +-
.../evaluation/value/NegatedIntegerValue.java | 2 +-
.../evaluation/value/NegatedLongValue.java | 2 +-
.../evaluation/value/ParticularDoubleValue.java | 2 +-
.../evaluation/value/ParticularFloatValue.java | 2 +-
.../evaluation/value/ParticularIntegerValue.java | 2 +-
.../evaluation/value/ParticularLongValue.java | 2 +-
.../evaluation/value/ParticularValueFactory.java | 2 +-
src/proguard/evaluation/value/ReferenceValue.java | 2 +-
.../evaluation/value/SpecificDoubleValue.java | 2 +-
.../evaluation/value/SpecificFloatValue.java | 2 +-
.../evaluation/value/SpecificIntegerValue.java | 2 +-
.../evaluation/value/SpecificLongValue.java | 2 +-
src/proguard/evaluation/value/TopValue.java | 2 +-
.../evaluation/value/TypedReferenceValue.java | 6 +-
.../evaluation/value/UnknownDoubleValue.java | 2 +-
.../evaluation/value/UnknownFloatValue.java | 2 +-
.../evaluation/value/UnknownIntegerValue.java | 2 +-
.../evaluation/value/UnknownLongValue.java | 2 +-
src/proguard/evaluation/value/Value.java | 18 +-
src/proguard/evaluation/value/ValueFactory.java | 2 +-
src/proguard/gradle/ProGuardTask.java | 2 +-
src/proguard/gui/ClassPathPanel.java | 2 +-
src/proguard/gui/ClassSpecificationDialog.java | 2 +-
src/proguard/gui/ClassSpecificationsPanel.java | 2 +-
src/proguard/gui/ExtensionFileFilter.java | 2 +-
src/proguard/gui/FilterBuilder.java | 2 +-
src/proguard/gui/FilterDialog.java | 2 +-
src/proguard/gui/GUIResources.java | 2 +-
src/proguard/gui/GUIResources.properties | 10 +-
src/proguard/gui/KeepSpecificationsPanel.java | 2 +-
src/proguard/gui/ListPanel.java | 2 +-
src/proguard/gui/MemberSpecificationDialog.java | 2 +-
src/proguard/gui/MemberSpecificationsPanel.java | 2 +-
src/proguard/gui/MessageDialogRunnable.java | 2 +-
src/proguard/gui/OptimizationsDialog.java | 2 +-
src/proguard/gui/ProGuardGUI.java | 2 +-
src/proguard/gui/ProGuardRunnable.java | 2 +-
src/proguard/gui/ReTraceRunnable.java | 46 +-
src/proguard/gui/SwingUtil.java | 2 +-
src/proguard/gui/TabbedPane.java | 2 +-
src/proguard/gui/TextAreaOutputStream.java | 2 +-
...xtAreaOutputStream.java => TextAreaWriter.java} | 18 +-
src/proguard/gui/splash/BufferedSprite.java | 2 +-
src/proguard/gui/splash/CircleSprite.java | 2 +-
src/proguard/gui/splash/ClipSprite.java | 2 +-
src/proguard/gui/splash/ColorSprite.java | 2 +-
src/proguard/gui/splash/CompositeSprite.java | 2 +-
src/proguard/gui/splash/ConstantColor.java | 2 +-
src/proguard/gui/splash/ConstantDouble.java | 2 +-
src/proguard/gui/splash/ConstantFont.java | 2 +-
src/proguard/gui/splash/ConstantInt.java | 2 +-
src/proguard/gui/splash/ConstantString.java | 2 +-
src/proguard/gui/splash/ConstantTiming.java | 2 +-
src/proguard/gui/splash/FontSprite.java | 2 +-
src/proguard/gui/splash/ImageSprite.java | 2 +-
src/proguard/gui/splash/LinearColor.java | 2 +-
src/proguard/gui/splash/LinearDouble.java | 2 +-
src/proguard/gui/splash/LinearInt.java | 2 +-
src/proguard/gui/splash/LinearTiming.java | 2 +-
src/proguard/gui/splash/OverrideGraphics2D.java | 2 +-
src/proguard/gui/splash/RectangleSprite.java | 2 +-
src/proguard/gui/splash/SawToothTiming.java | 2 +-
src/proguard/gui/splash/ShadowedSprite.java | 2 +-
src/proguard/gui/splash/SineTiming.java | 2 +-
src/proguard/gui/splash/SmoothTiming.java | 2 +-
src/proguard/gui/splash/SplashPanel.java | 2 +-
src/proguard/gui/splash/Sprite.java | 2 +-
src/proguard/gui/splash/TextSprite.java | 2 +-
src/proguard/gui/splash/TimeSwitchSprite.java | 2 +-
src/proguard/gui/splash/Timing.java | 2 +-
src/proguard/gui/splash/TypeWriterString.java | 2 +-
src/proguard/gui/splash/VariableColor.java | 2 +-
src/proguard/gui/splash/VariableDouble.java | 2 +-
src/proguard/gui/splash/VariableFont.java | 2 +-
src/proguard/gui/splash/VariableInt.java | 2 +-
src/proguard/gui/splash/VariableSizeFont.java | 2 +-
src/proguard/gui/splash/VariableString.java | 2 +-
src/proguard/io/CascadingDataEntryWriter.java | 2 +-
src/proguard/io/ClassFilter.java | 2 +-
src/proguard/io/ClassReader.java | 2 +-
src/proguard/io/ClassRewriter.java | 2 +-
src/proguard/io/DataEntry.java | 2 +-
src/proguard/io/DataEntryClassWriter.java | 2 +-
src/proguard/io/DataEntryCopier.java | 2 +-
src/proguard/io/DataEntryDirectoryFilter.java | 2 +-
src/proguard/io/DataEntryFilter.java | 2 +-
src/proguard/io/DataEntryNameFilter.java | 2 +-
src/proguard/io/DataEntryObfuscator.java | 2 +-
src/proguard/io/DataEntryParentFilter.java | 2 +-
src/proguard/io/DataEntryPump.java | 2 +-
src/proguard/io/DataEntryReader.java | 2 +-
src/proguard/io/DataEntryRenamer.java | 2 +-
src/proguard/io/DataEntryRewriter.java | 2 +-
src/proguard/io/DataEntryWriter.java | 2 +-
src/proguard/io/DirectoryFilter.java | 2 +-
src/proguard/io/DirectoryPump.java | 2 +-
src/proguard/io/DirectoryWriter.java | 2 +-
src/proguard/io/FileDataEntry.java | 2 +-
src/proguard/io/FilteredDataEntryReader.java | 2 +-
src/proguard/io/FilteredDataEntryWriter.java | 2 +-
src/proguard/io/Finisher.java | 2 +-
src/proguard/io/JarReader.java | 2 +-
src/proguard/io/JarWriter.java | 2 +-
src/proguard/io/ManifestRewriter.java | 2 +-
src/proguard/io/NameFilter.java | 2 +-
src/proguard/io/ParentDataEntryWriter.java | 2 +-
src/proguard/io/RenamedDataEntry.java | 2 +-
src/proguard/io/ZipDataEntry.java | 2 +-
src/proguard/obfuscate/AttributeShrinker.java | 2 +-
src/proguard/obfuscate/AttributeUsageMarker.java | 2 +-
src/proguard/obfuscate/ClassObfuscator.java | 2 +-
src/proguard/obfuscate/ClassRenamer.java | 2 +-
src/proguard/obfuscate/DictionaryNameFactory.java | 2 +-
src/proguard/obfuscate/MapCleaner.java | 2 +-
src/proguard/obfuscate/MappingKeeper.java | 11 +-
src/proguard/obfuscate/MappingPrinter.java | 273 +++++++-
src/proguard/obfuscate/MappingProcessor.java | 33 +-
src/proguard/obfuscate/MappingReader.java | 79 ++-
src/proguard/obfuscate/MemberNameCleaner.java | 2 +-
src/proguard/obfuscate/MemberNameCollector.java | 2 +-
.../obfuscate/MemberNameConflictFixer.java | 2 +-
src/proguard/obfuscate/MemberNameFilter.java | 2 +-
src/proguard/obfuscate/MemberObfuscator.java | 4 +-
.../obfuscate/MemberSpecialNameFilter.java | 2 +-
src/proguard/obfuscate/MultiMappingProcessor.java | 13 +-
src/proguard/obfuscate/NameFactory.java | 2 +-
src/proguard/obfuscate/NameFactoryResetter.java | 2 +-
src/proguard/obfuscate/NameMarker.java | 2 +-
src/proguard/obfuscate/NumericNameFactory.java | 2 +-
src/proguard/obfuscate/Obfuscator.java | 2 +-
src/proguard/obfuscate/ParameterNameMarker.java | 2 +-
src/proguard/obfuscate/SimpleNameFactory.java | 2 +-
src/proguard/obfuscate/SourceFileRenamer.java | 2 +-
src/proguard/obfuscate/SpecialNameFactory.java | 2 +-
.../optimize/BootstrapMethodArgumentShrinker.java | 2 +-
src/proguard/optimize/ChangedCodePrinter.java | 2 +-
src/proguard/optimize/ConstantMemberFilter.java | 2 +-
src/proguard/optimize/ConstantParameterFilter.java | 2 +-
.../optimize/DuplicateInitializerFixer.java | 2 +-
.../DuplicateInitializerInvocationFixer.java | 10 +-
src/proguard/optimize/KeepMarker.java | 2 +-
src/proguard/optimize/KeptClassFilter.java | 2 +-
src/proguard/optimize/KeptMemberFilter.java | 2 +-
.../optimize/MemberDescriptorSpecializer.java | 2 +-
.../optimize/MethodDescriptorShrinker.java | 121 ++--
src/proguard/optimize/MethodStaticizer.java | 2 +-
.../optimize/OptimizationInfoMemberFilter.java | 2 +-
src/proguard/optimize/Optimizer.java | 23 +-
src/proguard/optimize/ParameterShrinker.java | 4 +-
src/proguard/optimize/TailRecursionSimplifier.java | 2 +-
src/proguard/optimize/WriteOnlyFieldFilter.java | 2 +-
.../optimize/evaluation/EvaluationShrinker.java | 8 +-
.../optimize/evaluation/EvaluationSimplifier.java | 50 +-
.../optimize/evaluation/LivenessAnalyzer.java | 2 +-
.../optimize/evaluation/LoadingInvocationUnit.java | 2 +-
.../optimize/evaluation/PartialEvaluator.java | 62 +-
.../evaluation/SimpleEnumArrayPropagator.java | 2 +-
.../evaluation/SimpleEnumClassChecker.java | 2 +-
.../evaluation/SimpleEnumClassSimplifier.java | 2 +-
.../evaluation/SimpleEnumDescriptorSimplifier.java | 468 ++++++++++----
.../optimize/evaluation/SimpleEnumUseChecker.java | 10 +-
.../evaluation/SimpleEnumUseSimplifier.java | 8 +-
.../optimize/evaluation/StoringInvocationUnit.java | 2 +-
.../optimize/evaluation/TracedBranchUnit.java | 2 +-
.../optimize/evaluation/VariableOptimizer.java | 2 +-
src/proguard/optimize/info/AccessMethodMarker.java | 2 +-
.../optimize/info/BackwardBranchMarker.java | 2 +-
.../optimize/info/CatchExceptionMarker.java | 2 +-
src/proguard/optimize/info/CaughtClassFilter.java | 2 +-
src/proguard/optimize/info/CaughtClassMarker.java | 2 +-
.../optimize/info/ClassOptimizationInfo.java | 2 +-
.../optimize/info/ClassOptimizationInfoSetter.java | 2 +-
src/proguard/optimize/info/DotClassFilter.java | 2 +-
src/proguard/optimize/info/DotClassMarker.java | 2 +-
.../optimize/info/DynamicInvocationMarker.java | 2 +-
.../optimize/info/ExceptionInstructionChecker.java | 2 +-
.../optimize/info/FieldOptimizationInfo.java | 2 +-
.../optimize/info/InstanceofClassFilter.java | 2 +-
.../optimize/info/InstanceofClassMarker.java | 2 +-
.../optimize/info/InstantiationClassFilter.java | 2 +-
.../optimize/info/InstantiationClassMarker.java | 2 +-
.../info/MemberOptimizationInfoSetter.java | 2 +-
.../optimize/info/MethodInvocationMarker.java | 2 +-
.../optimize/info/MethodOptimizationInfo.java | 2 +-
.../optimize/info/NoSideEffectMethodMarker.java | 2 +-
.../optimize/info/NonPrivateMemberMarker.java | 2 +-
.../PackageVisibleMemberContainingClassMarker.java | 2 +-
.../PackageVisibleMemberInvokingClassMarker.java | 2 +-
.../optimize/info/ParameterUsageMarker.java | 2 +-
.../optimize/info/ReadWriteFieldMarker.java | 2 +-
.../info/SideEffectInstructionChecker.java | 87 ++-
.../optimize/info/SideEffectMethodFilter.java | 2 +-
.../optimize/info/SideEffectMethodMarker.java | 2 +-
src/proguard/optimize/info/SimpleEnumFilter.java | 2 +-
src/proguard/optimize/info/SimpleEnumMarker.java | 2 +-
.../StaticInitializerContainingClassFilter.java | 2 +-
.../StaticInitializerContainingClassMarker.java | 2 +-
.../optimize/info/SuperInvocationMarker.java | 2 +-
.../optimize/info/VariableUsageMarker.java | 2 +-
.../optimize/peephole/BranchTargetFinder.java | 2 +-
src/proguard/optimize/peephole/ClassFinalizer.java | 2 +-
src/proguard/optimize/peephole/ClassMerger.java | 8 +-
.../optimize/peephole/GotoCommonCodeReplacer.java | 2 +-
.../optimize/peephole/GotoGotoReplacer.java | 2 +-
.../optimize/peephole/GotoReturnReplacer.java | 2 +-
.../optimize/peephole/HorizontalClassMerger.java | 5 +-
.../peephole/InstructionSequenceConstants.java | 2 +-
.../peephole/InstructionSequenceReplacer.java | 2 +-
.../peephole/InstructionSequencesReplacer.java | 2 +-
.../optimize/peephole/LineNumberLinearizer.java | 250 ++++++++
.../optimize/peephole/MemberPrivatizer.java | 2 +-
.../optimize/peephole/MethodFinalizer.java | 2 +-
src/proguard/optimize/peephole/MethodInliner.java | 93 ++-
src/proguard/optimize/peephole/NopRemover.java | 2 +-
.../optimize/peephole/PeepholeOptimizer.java | 2 +-
.../optimize/peephole/ReachableCodeMarker.java | 2 +-
.../RetargetedInnerClassAttributeRemover.java | 2 +-
.../optimize/peephole/TargetClassChanger.java | 57 +-
.../optimize/peephole/UnreachableCodeRemover.java | 2 +-
.../peephole/UnreachableExceptionRemover.java | 2 +-
.../optimize/peephole/VariableShrinker.java | 2 +-
.../optimize/peephole/VerticalClassMerger.java | 2 +-
src/proguard/preverify/CodePreverifier.java | 2 +-
src/proguard/preverify/CodeSubroutineInliner.java | 2 +-
src/proguard/preverify/Preverifier.java | 2 +-
src/proguard/preverify/SubroutineInliner.java | 2 +-
src/proguard/retrace/FrameInfo.java | 108 ++++
src/proguard/retrace/FramePattern.java | 303 +++++++++
src/proguard/retrace/FrameRemapper.java | 432 +++++++++++++
src/proguard/retrace/ReTrace.java | 686 ++++-----------------
src/proguard/shrink/AnnotationUsageMarker.java | 2 +-
src/proguard/shrink/ClassShrinker.java | 242 +++-----
src/proguard/shrink/InnerUsageMarker.java | 2 +-
src/proguard/shrink/InterfaceUsageMarker.java | 4 +-
.../shrink/LocalVariableTypeUsageMarker.java | 5 +-
src/proguard/shrink/ShortestUsageMark.java | 2 +-
src/proguard/shrink/ShortestUsageMarker.java | 2 +-
src/proguard/shrink/ShortestUsagePrinter.java | 2 +-
src/proguard/shrink/Shrinker.java | 4 +-
src/proguard/shrink/SignatureUsageMarker.java | 120 ----
src/proguard/shrink/UsageMarker.java | 75 ++-
src/proguard/shrink/UsagePrinter.java | 2 +-
src/proguard/shrink/UsedClassFilter.java | 2 +-
src/proguard/shrink/UsedMemberFilter.java | 2 +-
src/proguard/util/AndMatcher.java | 2 +-
src/proguard/util/ArrayUtil.java | 2 +-
src/proguard/util/ClassNameParser.java | 2 +-
src/proguard/util/ConstantMatcher.java | 2 +-
src/proguard/util/EmptyStringMatcher.java | 2 +-
src/proguard/util/ExtensionMatcher.java | 2 +-
src/proguard/util/FileNameParser.java | 2 +-
src/proguard/util/FixedStringMatcher.java | 2 +-
src/proguard/util/ListMatcher.java | 2 +-
src/proguard/util/ListParser.java | 2 +-
src/proguard/util/ListUtil.java | 2 +-
src/proguard/util/NameParser.java | 2 +-
src/proguard/util/NotMatcher.java | 2 +-
src/proguard/util/ObjectUtil.java | 2 +-
src/proguard/util/OrMatcher.java | 2 +-
src/proguard/util/SettableMatcher.java | 2 +-
src/proguard/util/StringMatcher.java | 2 +-
src/proguard/util/StringParser.java | 2 +-
src/proguard/util/VariableStringMatcher.java | 2 +-
src/proguard/wtk/ProGuardObfuscator.java | 2 +-
674 files changed, 4350 insertions(+), 2141 deletions(-)
diff --git a/README b/README
index f621ab5..875468c 100644
--- a/README
+++ b/README
@@ -3,19 +3,19 @@ ProGuard, Java class file shrinker, optimizer, obfuscator, and preverifier
This distribution contains the following directories:
-- bin : simple wrapper scripts to run ProGuard, its GUI, and ReTrace
-- lib : the main jars, compiled and ready to use with "java -jar ...."
-- docs : the complete documentation, licenses, etc. in html format
-- examples : some example configuration files
-- src : the source code
-- build : various alternative build scripts
+- bin : simple wrapper scripts to run ProGuard, its GUI, and ReTrace
+- lib : the main jars, compiled and ready to use with "java -jar ...."
+- docs : the complete documentation, licenses, etc. in html format
+- examples : some example configuration files
+- src : the source code
+- buildscripts : various alternative build scripts
The best place to start is docs/index.html
Example
-=======
+-------
If you want to give ProGuard a spin right away, try processing the ProGuard
jar itself:
@@ -30,4 +30,4 @@ Enjoy!
http://proguard.sourceforge.net/
-Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
diff --git a/build/README b/buildscripts/README
similarity index 90%
rename from build/README
rename to buildscripts/README
index 89d3904..e57f758 100644
--- a/build/README
+++ b/buildscripts/README
@@ -31,10 +31,10 @@ This directory contains a number of alternative ways to build ProGuard:
javac -sourcepath src -d classes -classpath wtklib/kenv.zip \
src/proguard/wtk/ProGuardObfuscator.java
-Note that you'll have to install Ant and the JME WTK yourself.
+Note that you need to install Ant, Gradle, and the JME WTK yourself.
Enjoy!
http://proguard.sourceforge.net/
-Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
diff --git a/build/build.properties b/buildscripts/build.properties
similarity index 100%
rename from build/build.properties
rename to buildscripts/build.properties
diff --git a/build/build.sh b/buildscripts/build.sh
similarity index 91%
rename from build/build.sh
rename to buildscripts/build.sh
index a2d9138..925891a 100755
--- a/build/build.sh
+++ b/buildscripts/build.sh
@@ -30,10 +30,11 @@ WTK_PLUGIN=proguard/wtk/ProGuardObfuscator
ANT_JAR=$ANT_HOME/lib/ant.jar
GRADLE_PATH=\
-$GRADLE_HOME/lib/plugins/gradle-plugins-1.8.jar:\
-$GRADLE_HOME/lib/gradle-base-services-1.8.jar:\
-$GRADLE_HOME/lib/gradle-core-1.8.jar:\
-$GRADLE_HOME/lib/groovy-all-1.8.6.jar
+$GRADLE_HOME/lib/plugins/gradle-plugins-2.2.1.jar:\
+$GRADLE_HOME/lib/gradle-base-services-2.2.1.jar:\
+$GRADLE_HOME/lib/gradle-base-services-groovy-2.2.1.jar:\
+$GRADLE_HOME/lib/gradle-core-2.2.1.jar:\
+$GRADLE_HOME/lib/groovy-all-2.3.6.jar
WTK_JAR=$WTK_HOME/wtklib/kenv.zip
PROGUARD_JAR=$LIB/proguard.jar
diff --git a/build/build.xml b/buildscripts/build.xml
similarity index 95%
rename from build/build.xml
rename to buildscripts/build.xml
index 53c6f9c..2542aa6 100644
--- a/build/build.xml
+++ b/buildscripts/build.xml
@@ -9,10 +9,11 @@
<property name = "classes" value = "classes"/>
<property name = "lib" value = "lib"/>
- <property name = "gradle.jar1" value = "${gradle.home}/lib/plugins/gradle-plugins-1.8.jar"/>
- <property name = "gradle.jar2" value = "${gradle.home}/lib/gradle-base-services-1.8.jar"/>
- <property name = "gradle.jar3" value = "${gradle.home}/lib/gradle-core-1.8.jar"/>
- <property name = "gradle.jar4" value = "${gradle.home}/lib/groovy-all-1.8.6.jar"/>
+ <property name = "gradle.jar1" value = "${gradle.home}/lib/plugins/gradle-plugins-2.2.1.jar"/>
+ <property name = "gradle.jar2" value = "${gradle.home}/lib/gradle-base-services-2.2.1.jar"/>
+ <property name = "gradle.jar3" value = "${gradle.home}/lib/gradle-base-services-groovy-2.2.1.jar"/>
+ <property name = "gradle.jar4" value = "${gradle.home}/lib/gradle-core-2.2.1.jar"/>
+ <property name = "gradle.jar5" value = "${gradle.home}/lib/groovy-all-2.3.6.jar"/>
<property name = "wtk.jar" value = "${wtk.home}/wtklib/kenv.zip"/>
<target name = "all" depends = "basic,options"/>
@@ -128,6 +129,7 @@
<available file="${gradle.jar2}"/>
<available file="${gradle.jar3}"/>
<available file="${gradle.jar4}"/>
+ <available file="${gradle.jar5}"/>
</and>
</not>
</condition>
@@ -145,6 +147,7 @@
<path location="${gradle.jar2}"/>
<path location="${gradle.jar3}"/>
<path location="${gradle.jar4}"/>
+ <path location="${gradle.jar5}"/>
</classpath>
</javac>
diff --git a/build/makefile b/buildscripts/makefile
similarity index 78%
rename from build/makefile
rename to buildscripts/makefile
index 85e4841..9cbffb2 100644
--- a/build/makefile
+++ b/buildscripts/makefile
@@ -4,16 +4,17 @@ ANT_HOME = /usr/local/java/ant
GRADLE_HOME = /usr/local/java/gradle
WTK_HOME = /usr/local/java/wtk
-PROGUARD_HOME := $(subst ./..,..,$(subst /build/..,/,$(dir $(MAKEFILE_LIST))..))
+PROGUARD_HOME := $(subst ./..,..,$(subst /buildscripts/..,/,$(dir $(MAKEFILE_LIST))..))
SRC = $(PROGUARD_HOME)/src
CLASSES = $(PROGUARD_HOME)/classes
LIB = $(PROGUARD_HOME)/lib
ANT_JAR = $(ANT_HOME)/lib/ant.jar
-GRADLE_JARS = $(GRADLE_HOME)/lib/plugins/gradle-plugins-1.8.jar \
- $(GRADLE_HOME)/lib/gradle-base-services-1.8.jar \
- $(GRADLE_HOME)/lib/gradle-core-1.8.jar \
- $(GRADLE_HOME)/lib/groovy-all-1.8.6.jar
+GRADLE_JARS = $(GRADLE_HOME)/lib/plugins/gradle-plugins-2.2.1.jar \
+ $(GRADLE_HOME)/lib/gradle-base-services-2.2.1.jar \
+ $(GRADLE_HOME)/lib/gradle-base-services-groovy-2.2.1.jar \
+ $(GRADLE_HOME)/lib/gradle-core-2.2.1.jar \
+ $(GRADLE_HOME)/lib/groovy-all-2.3.6.jar
WTK_JAR = $(WTK_HOME)/wtklib/kenv.zip
NOTHING:=
@@ -98,10 +99,9 @@ $(CLASSES)/%.properties $(CLASSES)/%.png $(CLASSES)/%.gif $(CLASSES)/%.pro:
cp $(subst $(CLASSES),$(SRC),$@) $@
%.jar %.zip:
- echo "Please make sure the path to $@ is set"
- echo "correctly in this $(strip $(MAKEFILE_LIST))."
- echo "Alternatively, if you don't need the corresponding option,"
- echo "you can run `make' with the option -k."
- find $@
+ @echo "Please make sure the path to $@ is set"
+ @echo "correctly in this $(strip $(MAKEFILE_LIST))."
+ @echo "Alternatively, if you don't need the corresponding option,"
+ @echo "you can run `make' with the option -k."
.PHONY: all basic options proguard proguardgui retrace anttask wtkplugin clean $(TARGETS) $(OPTIONAL_TARGETS)
diff --git a/build/maven/ant/pom.xml b/buildscripts/maven/ant/pom.xml
similarity index 98%
rename from build/maven/ant/pom.xml
rename to buildscripts/maven/ant/pom.xml
index 263a933..14146e1 100644
--- a/build/maven/ant/pom.xml
+++ b/buildscripts/maven/ant/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
- <version>5.0</version>
+ <version>5.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>proguard-anttask</artifactId>
diff --git a/build/maven/base/pom.xml b/buildscripts/maven/base/pom.xml
similarity index 98%
rename from build/maven/base/pom.xml
rename to buildscripts/maven/base/pom.xml
index c00c76e..17a6b6b 100644
--- a/build/maven/base/pom.xml
+++ b/buildscripts/maven/base/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
- <version>5.0</version>
+ <version>5.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>proguard-base</artifactId>
diff --git a/build/maven/gradle/pom.xml b/buildscripts/maven/gradle/pom.xml
similarity index 88%
rename from build/maven/gradle/pom.xml
rename to buildscripts/maven/gradle/pom.xml
index ce0bea1..f379152 100644
--- a/build/maven/gradle/pom.xml
+++ b/buildscripts/maven/gradle/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
- <version>5.0</version>
+ <version>5.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>proguard-gradle</artifactId>
@@ -60,19 +60,25 @@
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-core</artifactId>
- <version>1.8</version>
+ <version>2.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-base-services</artifactId>
- <version>1.8</version>
+ <version>2.2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gradle</groupId>
+ <artifactId>gradle-base-services-groovy</artifactId>
+ <version>2.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
- <version>2.0.6</version>
+ <version>2.3.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/build/maven/gui/pom.xml b/buildscripts/maven/gui/pom.xml
similarity index 98%
rename from build/maven/gui/pom.xml
rename to buildscripts/maven/gui/pom.xml
index e8c1003..0de06a1 100644
--- a/build/maven/gui/pom.xml
+++ b/buildscripts/maven/gui/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
- <version>5.0</version>
+ <version>5.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>proguard-gui</artifactId>
diff --git a/build/maven/pom.xml b/buildscripts/maven/pom.xml
similarity index 97%
rename from build/maven/pom.xml
rename to buildscripts/maven/pom.xml
index 8ef072c..10fb4d1 100644
--- a/build/maven/pom.xml
+++ b/buildscripts/maven/pom.xml
@@ -7,7 +7,7 @@
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
- <version>5.0</version>
+ <version>5.2.1</version>
<packaging>pom</packaging>
<name>[${project.groupId}] ${project.artifactId}</name>
<description>ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier.</description>
@@ -22,8 +22,8 @@
<id>lafortune</id>
<name>Eric Lafortune</name>
<url>http://www.lafortune.eu/</url>
- <organization>Saikoa</organization>
- <organizationUrl>http://www.saikoa.com/</organizationUrl>
+ <organization>GuardSquare</organization>
+ <organizationUrl>http://www.guardsquare.com/</organizationUrl>
<roles>
<role>Project Administrator</role>
<role>Developer</role>
diff --git a/build/maven/retrace/pom.xml b/buildscripts/maven/retrace/pom.xml
similarity index 98%
rename from build/maven/retrace/pom.xml
rename to buildscripts/maven/retrace/pom.xml
index 7802c57..e87c6ef 100644
--- a/build/maven/retrace/pom.xml
+++ b/buildscripts/maven/retrace/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
- <version>5.0</version>
+ <version>5.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>proguard-retrace</artifactId>
diff --git a/build/maven/wtk/pom.xml b/buildscripts/maven/wtk/pom.xml
similarity index 98%
rename from build/maven/wtk/pom.xml
rename to buildscripts/maven/wtk/pom.xml
index 12ec9cf..c31e376 100644
--- a/build/maven/wtk/pom.xml
+++ b/buildscripts/maven/wtk/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
- <version>5.0</version>
+ <version>5.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>proguard-wtk-plugin</artifactId>
diff --git a/src/proguard/ArgumentWordReader.java b/src/proguard/ArgumentWordReader.java
index 3d04af3..6a200e0 100644
--- a/src/proguard/ArgumentWordReader.java
+++ b/src/proguard/ArgumentWordReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/AssumeNoSideEffectsChecker.java b/src/proguard/AssumeNoSideEffectsChecker.java
index 5932b70..7e949b1 100644
--- a/src/proguard/AssumeNoSideEffectsChecker.java
+++ b/src/proguard/AssumeNoSideEffectsChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ClassMemberChecker.java b/src/proguard/ClassMemberChecker.java
index 249105e..6e84240 100644
--- a/src/proguard/ClassMemberChecker.java
+++ b/src/proguard/ClassMemberChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ClassPath.java b/src/proguard/ClassPath.java
index 092a78d..6f77aa8 100644
--- a/src/proguard/ClassPath.java
+++ b/src/proguard/ClassPath.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ClassPathEntry.java b/src/proguard/ClassPathEntry.java
index faceb1f..4a74e19 100644
--- a/src/proguard/ClassPathEntry.java
+++ b/src/proguard/ClassPathEntry.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ClassSpecification.java b/src/proguard/ClassSpecification.java
index c2b6bfd..8aa83cf 100644
--- a/src/proguard/ClassSpecification.java
+++ b/src/proguard/ClassSpecification.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ClassSpecificationVisitorFactory.java b/src/proguard/ClassSpecificationVisitorFactory.java
index b403dde..1360764 100644
--- a/src/proguard/ClassSpecificationVisitorFactory.java
+++ b/src/proguard/ClassSpecificationVisitorFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/Configuration.java b/src/proguard/Configuration.java
index 0b855a5..81b8105 100644
--- a/src/proguard/Configuration.java
+++ b/src/proguard/Configuration.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ConfigurationChecker.java b/src/proguard/ConfigurationChecker.java
index 84d4663..3c921aa 100644
--- a/src/proguard/ConfigurationChecker.java
+++ b/src/proguard/ConfigurationChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ConfigurationConstants.java b/src/proguard/ConfigurationConstants.java
index a67eee3..438523b 100644
--- a/src/proguard/ConfigurationConstants.java
+++ b/src/proguard/ConfigurationConstants.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ConfigurationParser.java b/src/proguard/ConfigurationParser.java
index 72949cf..f0aaae1 100644
--- a/src/proguard/ConfigurationParser.java
+++ b/src/proguard/ConfigurationParser.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ConfigurationWriter.java b/src/proguard/ConfigurationWriter.java
index d87f47e..cc9e848 100644
--- a/src/proguard/ConfigurationWriter.java
+++ b/src/proguard/ConfigurationWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/DataEntryReaderFactory.java b/src/proguard/DataEntryReaderFactory.java
index 57f3faa..fe57843 100644
--- a/src/proguard/DataEntryReaderFactory.java
+++ b/src/proguard/DataEntryReaderFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/DataEntryWriterFactory.java b/src/proguard/DataEntryWriterFactory.java
index d76e596..4cc1255 100644
--- a/src/proguard/DataEntryWriterFactory.java
+++ b/src/proguard/DataEntryWriterFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/DescriptorKeepChecker.java b/src/proguard/DescriptorKeepChecker.java
index 1b46dce..72b9dca 100644
--- a/src/proguard/DescriptorKeepChecker.java
+++ b/src/proguard/DescriptorKeepChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/DuplicateClassPrinter.java b/src/proguard/DuplicateClassPrinter.java
index b849d7a..c9874a8 100644
--- a/src/proguard/DuplicateClassPrinter.java
+++ b/src/proguard/DuplicateClassPrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/FileWordReader.java b/src/proguard/FileWordReader.java
index 86d7110..a53c16b 100644
--- a/src/proguard/FileWordReader.java
+++ b/src/proguard/FileWordReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/FullyQualifiedClassNameChecker.java b/src/proguard/FullyQualifiedClassNameChecker.java
index 6b6a3ad..e186620 100644
--- a/src/proguard/FullyQualifiedClassNameChecker.java
+++ b/src/proguard/FullyQualifiedClassNameChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/GPL.java b/src/proguard/GPL.java
index 5c7ebc7..5fb18a1 100644
--- a/src/proguard/GPL.java
+++ b/src/proguard/GPL.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/GetAnnotationChecker.java b/src/proguard/GetAnnotationChecker.java
index bf6787d..a186767 100644
--- a/src/proguard/GetAnnotationChecker.java
+++ b/src/proguard/GetAnnotationChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/GetEnclosingClassChecker.java b/src/proguard/GetEnclosingClassChecker.java
index a21bc1a..48df0f1 100644
--- a/src/proguard/GetEnclosingClassChecker.java
+++ b/src/proguard/GetEnclosingClassChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/GetEnclosingMethodChecker.java b/src/proguard/GetEnclosingMethodChecker.java
index e833042..c6dcc19 100644
--- a/src/proguard/GetEnclosingMethodChecker.java
+++ b/src/proguard/GetEnclosingMethodChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/GetSignatureChecker.java b/src/proguard/GetSignatureChecker.java
index 510d833..8fa568c 100644
--- a/src/proguard/GetSignatureChecker.java
+++ b/src/proguard/GetSignatureChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/Initializer.java b/src/proguard/Initializer.java
index 6159c7b..fb398f4 100644
--- a/src/proguard/Initializer.java
+++ b/src/proguard/Initializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/InputReader.java b/src/proguard/InputReader.java
index 503ce7e..39bd280 100644
--- a/src/proguard/InputReader.java
+++ b/src/proguard/InputReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/KeepClassMemberChecker.java b/src/proguard/KeepClassMemberChecker.java
index ec976af..b8b4d46 100644
--- a/src/proguard/KeepClassMemberChecker.java
+++ b/src/proguard/KeepClassMemberChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/KeepClassSpecification.java b/src/proguard/KeepClassSpecification.java
index 6c46271..2eef1f8 100644
--- a/src/proguard/KeepClassSpecification.java
+++ b/src/proguard/KeepClassSpecification.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/LibraryKeepChecker.java b/src/proguard/LibraryKeepChecker.java
index 3209539..2d66ffc 100644
--- a/src/proguard/LibraryKeepChecker.java
+++ b/src/proguard/LibraryKeepChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/LineWordReader.java b/src/proguard/LineWordReader.java
index b39f2fe..a5153ad 100644
--- a/src/proguard/LineWordReader.java
+++ b/src/proguard/LineWordReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/MemberSpecification.java b/src/proguard/MemberSpecification.java
index 9e4d671..2868e7b 100644
--- a/src/proguard/MemberSpecification.java
+++ b/src/proguard/MemberSpecification.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/OutputWriter.java b/src/proguard/OutputWriter.java
index 3feb1c4..bfda162 100644
--- a/src/proguard/OutputWriter.java
+++ b/src/proguard/OutputWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ParseException.java b/src/proguard/ParseException.java
index 4cb5e70..fea62ba 100644
--- a/src/proguard/ParseException.java
+++ b/src/proguard/ParseException.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ProGuard.java b/src/proguard/ProGuard.java
index ae373eb..d6e9204 100644
--- a/src/proguard/ProGuard.java
+++ b/src/proguard/ProGuard.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -26,6 +26,7 @@ import proguard.classfile.editor.*;
import proguard.classfile.visitor.*;
import proguard.obfuscate.Obfuscator;
import proguard.optimize.Optimizer;
+import proguard.optimize.peephole.LineNumberLinearizer;
import proguard.preverify.*;
import proguard.shrink.Shrinker;
@@ -38,7 +39,7 @@ import java.io.*;
*/
public class ProGuard
{
- public static final String VERSION = "ProGuard, version 5.0";
+ public static final String VERSION = "ProGuard, version 5.2.1";
private final Configuration configuration;
private ClassPool programClassPool = new ClassPool();
@@ -141,11 +142,21 @@ public class ProGuard
}
}
+ if (configuration.optimize)
+ {
+ linearizeLineNumbers();
+ }
+
if (configuration.obfuscate)
{
obfuscate();
}
+ if (configuration.optimize)
+ {
+ trimLineNumbers();
+ }
+
if (configuration.preverify)
{
preverify();
@@ -346,6 +357,26 @@ public class ProGuard
/**
+ * Disambiguates the line numbers of all program classes, after
+ * optimizations like method inlining and class merging.
+ */
+ private void linearizeLineNumbers()
+ {
+ programClassPool.classesAccept(new LineNumberLinearizer());
+ }
+
+
+ /**
+ * Trims the line number table attributes of all program classes.
+ */
+ private void trimLineNumbers()
+ {
+ programClassPool.classesAccept(new AllAttributeVisitor(true,
+ new LineNumberTableAttributeTrimmer()));
+ }
+
+
+ /**
* Clears any JSE preverification information from the program classes.
*/
private void clearPreverification()
diff --git a/src/proguard/SeedPrinter.java b/src/proguard/SeedPrinter.java
index 7418aee..1eb03ec 100644
--- a/src/proguard/SeedPrinter.java
+++ b/src/proguard/SeedPrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/SubclassedClassFilter.java b/src/proguard/SubclassedClassFilter.java
index e851a2b..bd14289 100644
--- a/src/proguard/SubclassedClassFilter.java
+++ b/src/proguard/SubclassedClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/Targeter.java b/src/proguard/Targeter.java
index b0e71c1..9a21440 100644
--- a/src/proguard/Targeter.java
+++ b/src/proguard/Targeter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/UpToDateChecker.java b/src/proguard/UpToDateChecker.java
index f0b2b81..7de68cc 100644
--- a/src/proguard/UpToDateChecker.java
+++ b/src/proguard/UpToDateChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/WordReader.java b/src/proguard/WordReader.java
index f375057..4f20617 100644
--- a/src/proguard/WordReader.java
+++ b/src/proguard/WordReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/ClassPathElement.java b/src/proguard/ant/ClassPathElement.java
index ef5b510..fcea97f 100644
--- a/src/proguard/ant/ClassPathElement.java
+++ b/src/proguard/ant/ClassPathElement.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/ClassSpecificationElement.java b/src/proguard/ant/ClassSpecificationElement.java
index 146bf09..c909ed0 100644
--- a/src/proguard/ant/ClassSpecificationElement.java
+++ b/src/proguard/ant/ClassSpecificationElement.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/ConfigurationElement.java b/src/proguard/ant/ConfigurationElement.java
index f6e7be8..b8efa72 100644
--- a/src/proguard/ant/ConfigurationElement.java
+++ b/src/proguard/ant/ConfigurationElement.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/ConfigurationTask.java b/src/proguard/ant/ConfigurationTask.java
index 0bd1b35..e89fe71 100644
--- a/src/proguard/ant/ConfigurationTask.java
+++ b/src/proguard/ant/ConfigurationTask.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/FilterElement.java b/src/proguard/ant/FilterElement.java
index b31313f..f227a05 100644
--- a/src/proguard/ant/FilterElement.java
+++ b/src/proguard/ant/FilterElement.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/KeepSpecificationElement.java b/src/proguard/ant/KeepSpecificationElement.java
index 06c3ff0..0afb815 100644
--- a/src/proguard/ant/KeepSpecificationElement.java
+++ b/src/proguard/ant/KeepSpecificationElement.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/MemberSpecificationElement.java b/src/proguard/ant/MemberSpecificationElement.java
index 2cfa697..202b54e 100644
--- a/src/proguard/ant/MemberSpecificationElement.java
+++ b/src/proguard/ant/MemberSpecificationElement.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/ant/ProGuardTask.java b/src/proguard/ant/ProGuardTask.java
index f26f1b2..889d7b4 100644
--- a/src/proguard/ant/ProGuardTask.java
+++ b/src/proguard/ant/ProGuardTask.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/ClassConstants.java b/src/proguard/classfile/ClassConstants.java
index d8ee924..eb83634 100644
--- a/src/proguard/classfile/ClassConstants.java
+++ b/src/proguard/classfile/ClassConstants.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -197,20 +197,35 @@ public class ClassConstants
public static final char METHOD_ARGUMENTS_OPEN = '(';
public static final char METHOD_ARGUMENTS_CLOSE = ')';
- public static final String PACKAGE_JAVA_LANG = "java/lang/";
- public static final String NAME_JAVA_LANG_OBJECT = "java/lang/Object";
- public static final String TYPE_JAVA_LANG_OBJECT = "Ljava/lang/Object;";
- public static final String NAME_JAVA_LANG_CLONEABLE = "java/lang/Cloneable";
- public static final String NAME_JAVA_LANG_THROWABLE = "java/lang/Throwable";
- public static final String NAME_JAVA_LANG_CLASS = "java/lang/Class";
- public static final String NAME_JAVA_LANG_STRING = "java/lang/String";
- public static final String NAME_JAVA_LANG_STRING_BUFFER = "java/lang/StringBuffer";
- public static final String NAME_JAVA_LANG_STRING_BUILDER = "java/lang/StringBuilder";
- public static final String NAME_JAVA_LANG_REFLECT_FIELD = "java/lang/reflect/Field";
- public static final String NAME_JAVA_LANG_REFLECT_METHOD = "java/lang/reflect/Method";
- public static final String NAME_JAVA_LANG_INVOKE_METHOD_HANDLE = "java/lang/invoke/MethodHandle";
- public static final String NAME_JAVA_LANG_INVOKE_METHOD_TYPE = "java/lang/invoke/MethodType";
- public static final String NAME_JAVA_IO_SERIALIZABLE = "java/io/Serializable";
+ public static final String PACKAGE_JAVA_LANG = "java/lang/";
+ public static final String NAME_JAVA_LANG_OBJECT = "java/lang/Object";
+ public static final String TYPE_JAVA_LANG_OBJECT = "Ljava/lang/Object;";
+ public static final String NAME_JAVA_LANG_CLONEABLE = "java/lang/Cloneable";
+ public static final String NAME_JAVA_LANG_THROWABLE = "java/lang/Throwable";
+ public static final String NAME_JAVA_LANG_CLASS = "java/lang/Class";
+ public static final String NAME_JAVA_LANG_STRING = "java/lang/String";
+ public static final String NAME_JAVA_LANG_STRING_BUFFER = "java/lang/StringBuffer";
+ public static final String NAME_JAVA_LANG_STRING_BUILDER = "java/lang/StringBuilder";
+ public static final String NAME_JAVA_LANG_INVOKE_METHOD_HANDLE = "java/lang/invoke/MethodHandle";
+ public static final String NAME_JAVA_LANG_INVOKE_METHOD_TYPE = "java/lang/invoke/MethodType";
+ public static final String NAME_JAVA_LANG_VOID = "java/lang/Void";
+ public static final String NAME_JAVA_LANG_BOOLEAN = "java/lang/Boolean";
+ public static final String NAME_JAVA_LANG_BYTE = "java/lang/Byte";
+ public static final String NAME_JAVA_LANG_SHORT = "java/lang/Short";
+ public static final String NAME_JAVA_LANG_CHARACTER = "java/lang/Character";
+ public static final String NAME_JAVA_LANG_INTEGER = "java/lang/Integer";
+ public static final String NAME_JAVA_LANG_LONG = "java/lang/Long";
+ public static final String NAME_JAVA_LANG_FLOAT = "java/lang/Float";
+ public static final String NAME_JAVA_LANG_DOUBLE = "java/lang/Double";
+ public static final String NAME_JAVA_LANG_MATH = "java/lang/Math";
+ public static final String NAME_JAVA_LANG_SYSTEM = "java/lang/System";
+ public static final String NAME_JAVA_LANG_RUNTIME = "java/lang/Runtime";
+ public static final String NAME_JAVA_LANG_REFLECT_ARRAY = "java/lang/reflect/Array";
+ public static final String NAME_JAVA_LANG_REFLECT_FIELD = "java/lang/reflect/Field";
+ public static final String NAME_JAVA_LANG_REFLECT_METHOD = "java/lang/reflect/Method";
+ public static final String NAME_JAVA_LANG_REFLECT_CONSTRUCTOR = "java/lang/reflect/Constructor";
+ public static final String NAME_JAVA_LANG_REFLECT_ACCESSIBLE_OBJECT = "java/lang/reflect/AccessibleObject";
+ public static final String NAME_JAVA_IO_SERIALIZABLE = "java/io/Serializable";
public static final String NAME_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMIC_INTEGER_FIELD_UPDATER = "java/util/concurrent/atomic/AtomicIntegerFieldUpdater";
public static final String NAME_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMIC_LONG_FIELD_UPDATER = "java/util/concurrent/atomic/AtomicLongFieldUpdater";
@@ -319,11 +334,12 @@ public class ClassConstants
public static final char TYPE_GENERIC_BOUND = ':';
public static final char TYPE_GENERIC_END = '>';
- public static final int TYPICAL_CONSTANT_POOL_SIZE = 256;
- public static final int TYPICAL_FIELD_COUNT = 64;
- public static final int TYPICAL_METHOD_COUNT = 64;
- public static final int TYPICAL_CODE_LENGTH = 1024;
- public static final int TYPICAL_EXCEPTION_TABLE_LENGTH = 16;
- public static final int TYPICAL_VARIABLES_SIZE = 64;
- public static final int TYPICAL_STACK_SIZE = 16;
+ public static final int TYPICAL_CONSTANT_POOL_SIZE = 256;
+ public static final int TYPICAL_FIELD_COUNT = 64;
+ public static final int TYPICAL_METHOD_COUNT = 64;
+ public static final int TYPICAL_CODE_LENGTH = 1024;
+ public static final int TYPICAL_LINE_NUMBER_TABLE_LENGTH = 1024;
+ public static final int TYPICAL_EXCEPTION_TABLE_LENGTH = 16;
+ public static final int TYPICAL_VARIABLES_SIZE = 64;
+ public static final int TYPICAL_STACK_SIZE = 16;
}
diff --git a/src/proguard/classfile/ClassPool.java b/src/proguard/classfile/ClassPool.java
index da874b5..c9ee0e3 100644
--- a/src/proguard/classfile/ClassPool.java
+++ b/src/proguard/classfile/ClassPool.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/Clazz.java b/src/proguard/classfile/Clazz.java
index e33596d..ec5c2a6 100644
--- a/src/proguard/classfile/Clazz.java
+++ b/src/proguard/classfile/Clazz.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -91,6 +91,11 @@ public interface Clazz extends VisitorAccepter
public String getType(int constantIndex);
/**
+ * Returns the class name of the RefConstant at the specified index.
+ */
+ public String getRefClassName(int constantIndex);
+
+ /**
* Returns the name of the RefConstant at the specified index.
*/
public String getRefName(int constantIndex);
diff --git a/src/proguard/classfile/Field.java b/src/proguard/classfile/Field.java
index b3865a9..5410408 100644
--- a/src/proguard/classfile/Field.java
+++ b/src/proguard/classfile/Field.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/JavaConstants.java b/src/proguard/classfile/JavaConstants.java
index ad8eeca..57ff0e8 100644
--- a/src/proguard/classfile/JavaConstants.java
+++ b/src/proguard/classfile/JavaConstants.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/LibraryClass.java b/src/proguard/classfile/LibraryClass.java
index 3ff82eb..bc5a1f2 100644
--- a/src/proguard/classfile/LibraryClass.java
+++ b/src/proguard/classfile/LibraryClass.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -137,6 +137,11 @@ public class LibraryClass implements Clazz
}
+ public String getRefClassName(int constantIndex)
+ {
+ throw new UnsupportedOperationException("Library class ["+thisClassName+"] doesn't store constant pool");
+ }
+
public String getRefName(int constantIndex)
{
throw new UnsupportedOperationException("Library class ["+thisClassName+"] doesn't store constant pool");
diff --git a/src/proguard/classfile/LibraryField.java b/src/proguard/classfile/LibraryField.java
index 2e28d37..e3a3fac 100644
--- a/src/proguard/classfile/LibraryField.java
+++ b/src/proguard/classfile/LibraryField.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/LibraryMember.java b/src/proguard/classfile/LibraryMember.java
index 1c27e1b..941efcf 100644
--- a/src/proguard/classfile/LibraryMember.java
+++ b/src/proguard/classfile/LibraryMember.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/LibraryMethod.java b/src/proguard/classfile/LibraryMethod.java
index 0ef7b01..2010ac7 100644
--- a/src/proguard/classfile/LibraryMethod.java
+++ b/src/proguard/classfile/LibraryMethod.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -30,10 +30,12 @@ import proguard.classfile.visitor.*;
public class LibraryMethod extends LibraryMember implements Method
{
/**
- * An extra field pointing to the Clazz objects referenced in the
- * descriptor string. This field is filled out by the <code>{@link
- * proguard.classfile.util.ClassReferenceInitializer ClassReferenceInitializer}</code>.
- * References to primitive types are ignored.
+ * An extra field containing all the classes referenced in the
+ * descriptor string. This field is filled out by the {@link
+ * proguard.classfile.util.ClassReferenceInitializer ClassReferenceInitializer}.
+ * The size of the array is the number of classes in the descriptor.
+ * Primitive types and arrays of primitive types are ignored.
+ * Unknown classes are represented as null values.
*/
public Clazz[] referencedClasses;
diff --git a/src/proguard/classfile/Member.java b/src/proguard/classfile/Member.java
index d94cd80..e2237e3 100644
--- a/src/proguard/classfile/Member.java
+++ b/src/proguard/classfile/Member.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/Method.java b/src/proguard/classfile/Method.java
index 76eaf4f..7b2055f 100644
--- a/src/proguard/classfile/Method.java
+++ b/src/proguard/classfile/Method.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/ProgramClass.java b/src/proguard/classfile/ProgramClass.java
index 9a46763..21228b2 100644
--- a/src/proguard/classfile/ProgramClass.java
+++ b/src/proguard/classfile/ProgramClass.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -141,7 +141,7 @@ public class ProgramClass implements Clazz
}
catch (ClassCastException ex)
{
- throw ((IllegalStateException)new IllegalStateException("Expected ClassConstant at index ["+constantIndex+"] in class ["+getName()+"]").initCause(ex));
+ throw ((IllegalStateException)new IllegalStateException("Expected ClassConstant at index ["+constantIndex+"]").initCause(ex));
}
}
@@ -170,6 +170,18 @@ public class ProgramClass implements Clazz
}
+ public String getRefClassName(int constantIndex)
+ {
+ try
+ {
+ return ((RefConstant)constantPool[constantIndex]).getClassName(this);
+ }
+ catch (ClassCastException ex)
+ {
+ throw ((IllegalStateException)new IllegalStateException("Expected RefConstant at index ["+constantIndex+"] in class ["+getName()+"]").initCause(ex));
+ }
+ }
+
public String getRefName(int constantIndex)
{
try
diff --git a/src/proguard/classfile/ProgramField.java b/src/proguard/classfile/ProgramField.java
index c1ed101..893f804 100644
--- a/src/proguard/classfile/ProgramField.java
+++ b/src/proguard/classfile/ProgramField.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/ProgramMember.java b/src/proguard/classfile/ProgramMember.java
index 6a9b1f2..c466ea1 100644
--- a/src/proguard/classfile/ProgramMember.java
+++ b/src/proguard/classfile/ProgramMember.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/ProgramMethod.java b/src/proguard/classfile/ProgramMethod.java
index 80e35e5..1f738dd 100644
--- a/src/proguard/classfile/ProgramMethod.java
+++ b/src/proguard/classfile/ProgramMethod.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -32,10 +32,12 @@ import proguard.classfile.visitor.*;
public class ProgramMethod extends ProgramMember implements Method
{
/**
- * An extra field pointing to the Clazz objects referenced in the
- * descriptor string. This field is filled out by the <code>{@link
- * proguard.classfile.util.ClassReferenceInitializer ClassReferenceInitializer}</code>.
- * References to primitive types are ignored.
+ * An extra field containing all the classes referenced in the
+ * descriptor string. This field is filled out by the {@link
+ * proguard.classfile.util.ClassReferenceInitializer ClassReferenceInitializer}.
+ * The size of the array is the number of classes in the descriptor.
+ * Primitive types and arrays of primitive types are ignored.
+ * Unknown classes are represented as null values.
*/
public Clazz[] referencedClasses;
diff --git a/src/proguard/classfile/VisitorAccepter.java b/src/proguard/classfile/VisitorAccepter.java
index 8fae922..ea13358 100644
--- a/src/proguard/classfile/VisitorAccepter.java
+++ b/src/proguard/classfile/VisitorAccepter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/Attribute.java b/src/proguard/classfile/attribute/Attribute.java
index 06845e0..9c5cdab 100644
--- a/src/proguard/classfile/attribute/Attribute.java
+++ b/src/proguard/classfile/attribute/Attribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/BootstrapMethodInfo.java b/src/proguard/classfile/attribute/BootstrapMethodInfo.java
index e819362..7669d40 100755
--- a/src/proguard/classfile/attribute/BootstrapMethodInfo.java
+++ b/src/proguard/classfile/attribute/BootstrapMethodInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/BootstrapMethodsAttribute.java b/src/proguard/classfile/attribute/BootstrapMethodsAttribute.java
index 20b8965..2b47189 100755
--- a/src/proguard/classfile/attribute/BootstrapMethodsAttribute.java
+++ b/src/proguard/classfile/attribute/BootstrapMethodsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/CodeAttribute.java b/src/proguard/classfile/attribute/CodeAttribute.java
index 6bcaa0a..4c76707 100644
--- a/src/proguard/classfile/attribute/CodeAttribute.java
+++ b/src/proguard/classfile/attribute/CodeAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/ConstantValueAttribute.java b/src/proguard/classfile/attribute/ConstantValueAttribute.java
index b90f393..84ede21 100644
--- a/src/proguard/classfile/attribute/ConstantValueAttribute.java
+++ b/src/proguard/classfile/attribute/ConstantValueAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/DeprecatedAttribute.java b/src/proguard/classfile/attribute/DeprecatedAttribute.java
index c1920e9..e65a693 100644
--- a/src/proguard/classfile/attribute/DeprecatedAttribute.java
+++ b/src/proguard/classfile/attribute/DeprecatedAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/EnclosingMethodAttribute.java b/src/proguard/classfile/attribute/EnclosingMethodAttribute.java
index 8a31f03..74a7830 100644
--- a/src/proguard/classfile/attribute/EnclosingMethodAttribute.java
+++ b/src/proguard/classfile/attribute/EnclosingMethodAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/ExceptionInfo.java b/src/proguard/classfile/attribute/ExceptionInfo.java
index 2bb1118..3904244 100644
--- a/src/proguard/classfile/attribute/ExceptionInfo.java
+++ b/src/proguard/classfile/attribute/ExceptionInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/ExceptionsAttribute.java b/src/proguard/classfile/attribute/ExceptionsAttribute.java
index 5ae5c3d..ee75fe7 100644
--- a/src/proguard/classfile/attribute/ExceptionsAttribute.java
+++ b/src/proguard/classfile/attribute/ExceptionsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/SourceFileAttribute.java b/src/proguard/classfile/attribute/ExtendedLineNumberInfo.java
similarity index 54%
copy from src/proguard/classfile/attribute/SourceFileAttribute.java
copy to src/proguard/classfile/attribute/ExtendedLineNumberInfo.java
index e10b784..aa6aa70 100644
--- a/src/proguard/classfile/attribute/SourceFileAttribute.java
+++ b/src/proguard/classfile/attribute/ExtendedLineNumberInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -20,43 +20,44 @@
*/
package proguard.classfile.attribute;
-import proguard.classfile.Clazz;
-import proguard.classfile.attribute.visitor.AttributeVisitor;
-
/**
- * This Attribute represents a source file attribute.
+ * This line number table entry contains additional information about its
+ * source. This information can not be represented in class files, but it
+ * can be used internally to represent lines in inlined or merged code.
*
* @author Eric Lafortune
*/
-public class SourceFileAttribute extends Attribute
+public class ExtendedLineNumberInfo
+extends LineNumberInfo
{
- public int u2sourceFileIndex;
+ public String source;
/**
- * Creates an uninitialized SourceFileAttribute.
+ * Creates an uninitialized ExtendedLineNumberInfo.
*/
- public SourceFileAttribute()
+ public ExtendedLineNumberInfo()
{
}
/**
- * Creates an initialized SourceFileAttribute.
+ * Creates an initialized ExtendedLineNumberInfo.
*/
- public SourceFileAttribute(int u2attributeNameIndex,
- int u2sourceFileIndex)
+ public ExtendedLineNumberInfo(int u2startPC,
+ int u2lineNumber,
+ String source)
{
- super(u2attributeNameIndex);
+ super(u2startPC, u2lineNumber);
- this.u2sourceFileIndex = u2sourceFileIndex;
+ this.source = source;
}
- // Implementations for Attribute.
+ // Implementations for LineNumberInfo.
- public void accept(Clazz clazz, AttributeVisitor attributeVisitor)
+ public String getSource()
{
- attributeVisitor.visitSourceFileAttribute(clazz, this);
+ return source;
}
}
diff --git a/src/proguard/classfile/attribute/InnerClassesAttribute.java b/src/proguard/classfile/attribute/InnerClassesAttribute.java
index f0c9e1e..6bbbefd 100644
--- a/src/proguard/classfile/attribute/InnerClassesAttribute.java
+++ b/src/proguard/classfile/attribute/InnerClassesAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/InnerClassesInfo.java b/src/proguard/classfile/attribute/InnerClassesInfo.java
index 7a1eb67..2a26d8c 100644
--- a/src/proguard/classfile/attribute/InnerClassesInfo.java
+++ b/src/proguard/classfile/attribute/InnerClassesInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/LineNumberInfo.java b/src/proguard/classfile/attribute/LineNumberInfo.java
index 0dd527c..3a40f7a 100644
--- a/src/proguard/classfile/attribute/LineNumberInfo.java
+++ b/src/proguard/classfile/attribute/LineNumberInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -47,4 +47,15 @@ public class LineNumberInfo
this.u2startPC = u2startPC;
this.u2lineNumber = u2lineNumber;
}
+
+
+ /**
+ * Returns a description of the source of the line, if known, or null
+ * otherwise. Standard line number entries don't contain information
+ * about their source; it is assumed to be the same source file.
+ */
+ public String getSource()
+ {
+ return null;
+ }
}
diff --git a/src/proguard/classfile/attribute/LineNumberTableAttribute.java b/src/proguard/classfile/attribute/LineNumberTableAttribute.java
index 7bd3e00..a51fd65 100644
--- a/src/proguard/classfile/attribute/LineNumberTableAttribute.java
+++ b/src/proguard/classfile/attribute/LineNumberTableAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -62,64 +62,88 @@ public class LineNumberTableAttribute extends Attribute
*/
public int getLineNumber(int pc)
{
- for (int index = u2lineNumberTableLength-1 ; index >= 0 ; index--)
+ LineNumberInfo info = getLineNumberInfo(pc);
+
+ return info == null ? 0 : info.u2lineNumber;
+ }
+
+
+ /**
+ * Returns the source corresponding to the given byte code program
+ * counter.
+ */
+ public String getSource(int pc)
+ {
+ LineNumberInfo info = getLineNumberInfo(pc);
+
+ return info == null ? null : info.getSource();
+ }
+
+
+ /**
+ * Returns the line number info corresponding to the given byte code
+ * program counter.
+ */
+ public LineNumberInfo getLineNumberInfo(int pc)
+ {
+ for (int index = u2lineNumberTableLength-1; index >= 0; index--)
{
LineNumberInfo info = lineNumberTable[index];
if (pc >= info.u2startPC)
{
- return info.u2lineNumber;
+ return info;
}
}
return u2lineNumberTableLength > 0 ?
- lineNumberTable[0].u2lineNumber :
- 0;
+ lineNumberTable[0] :
+ null;
}
/**
- * Returns the lowest line number, or 0 if there aren't any line numbers.
+ * Returns the lowest line number with the default null source,
+ * or 0 if there aren't any such line numbers.
*/
public int getLowestLineNumber()
{
- if (u2lineNumberTableLength == 0)
- {
- return 0;
- }
-
int lowestLineNumber = Integer.MAX_VALUE;
for (int index = 0; index < u2lineNumberTableLength; index++)
{
- int lineNumber = lineNumberTable[index].u2lineNumber;
- if (lineNumber < lowestLineNumber)
+ LineNumberInfo info = lineNumberTable[index];
+ if (info.getSource() == null)
{
- lowestLineNumber = lineNumber;
+ int lineNumber = info.u2lineNumber;
+ if (lineNumber < lowestLineNumber)
+ {
+ lowestLineNumber = lineNumber;
+ }
}
}
- return lowestLineNumber;
+ return lowestLineNumber == Integer.MAX_VALUE ? 0 : lowestLineNumber;
}
/**
- * Returns the highest line number, or 0 if there aren't any line numbers.
+ * Returns the highest line number with the default null source,
+ * or 0 if there aren't any such line numbers.
*/
public int getHighestLineNumber()
{
- if (u2lineNumberTableLength == 0)
- {
- return 0;
- }
-
- int highestLineNumber = Integer.MIN_VALUE;
+ int highestLineNumber = 0;
for (int index = 0; index < u2lineNumberTableLength; index++)
{
- int lineNumber = lineNumberTable[index].u2lineNumber;
- if (lineNumber > highestLineNumber)
+ LineNumberInfo info = lineNumberTable[index];
+ if (info.getSource() == null)
{
- highestLineNumber = lineNumber;
+ int lineNumber = info.u2lineNumber;
+ if (lineNumber > highestLineNumber)
+ {
+ highestLineNumber = lineNumber;
+ }
}
}
diff --git a/src/proguard/classfile/attribute/LocalVariableInfo.java b/src/proguard/classfile/attribute/LocalVariableInfo.java
index 88035ce..87da0bb 100644
--- a/src/proguard/classfile/attribute/LocalVariableInfo.java
+++ b/src/proguard/classfile/attribute/LocalVariableInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/LocalVariableTableAttribute.java b/src/proguard/classfile/attribute/LocalVariableTableAttribute.java
index a48e890..60d412b 100644
--- a/src/proguard/classfile/attribute/LocalVariableTableAttribute.java
+++ b/src/proguard/classfile/attribute/LocalVariableTableAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/LocalVariableTypeInfo.java b/src/proguard/classfile/attribute/LocalVariableTypeInfo.java
index c0fc405..6e3870b 100644
--- a/src/proguard/classfile/attribute/LocalVariableTypeInfo.java
+++ b/src/proguard/classfile/attribute/LocalVariableTypeInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/LocalVariableTypeTableAttribute.java b/src/proguard/classfile/attribute/LocalVariableTypeTableAttribute.java
index 62643bc..e1eb1c3 100644
--- a/src/proguard/classfile/attribute/LocalVariableTypeTableAttribute.java
+++ b/src/proguard/classfile/attribute/LocalVariableTypeTableAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/MethodParametersAttribute.java b/src/proguard/classfile/attribute/MethodParametersAttribute.java
index 5e832d2..83a83d7 100644
--- a/src/proguard/classfile/attribute/MethodParametersAttribute.java
+++ b/src/proguard/classfile/attribute/MethodParametersAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/ParameterInfo.java b/src/proguard/classfile/attribute/ParameterInfo.java
index c501f87..3af78d5 100644
--- a/src/proguard/classfile/attribute/ParameterInfo.java
+++ b/src/proguard/classfile/attribute/ParameterInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -63,7 +63,7 @@ public class ParameterInfo implements VisitorAccepter
*/
public String getName(Clazz clazz)
{
- return clazz.getString(u2accessFlags);
+ return clazz.getString(u2nameIndex);
}
diff --git a/src/proguard/classfile/attribute/SignatureAttribute.java b/src/proguard/classfile/attribute/SignatureAttribute.java
index 120fa96..d98cc3c 100644
--- a/src/proguard/classfile/attribute/SignatureAttribute.java
+++ b/src/proguard/classfile/attribute/SignatureAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -34,10 +34,12 @@ public class SignatureAttribute extends Attribute
public int u2signatureIndex;
/**
- * An extra field pointing to the Clazz objects referenced in the
- * signature string. This field is filled out by the <code>{@link
- * proguard.classfile.util.ClassReferenceInitializer ClassReferenceInitializer}</code>.
- * References to primitive types are ignored.
+ * An extra field containing all the classes referenced in the
+ * signature string. This field is filled out by the {@link
+ * proguard.classfile.util.ClassReferenceInitializer ClassReferenceInitializer}.
+ * The size of the array is the number of classes in the signature.
+ * Primitive types and arrays of primitive types are ignored.
+ * Unknown classes are represented as null values.
*/
public Clazz[] referencedClasses;
diff --git a/src/proguard/classfile/attribute/SourceDirAttribute.java b/src/proguard/classfile/attribute/SourceDirAttribute.java
index 100c840..c104950 100644
--- a/src/proguard/classfile/attribute/SourceDirAttribute.java
+++ b/src/proguard/classfile/attribute/SourceDirAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/SourceFileAttribute.java b/src/proguard/classfile/attribute/SourceFileAttribute.java
index e10b784..a7e46c4 100644
--- a/src/proguard/classfile/attribute/SourceFileAttribute.java
+++ b/src/proguard/classfile/attribute/SourceFileAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/SyntheticAttribute.java b/src/proguard/classfile/attribute/SyntheticAttribute.java
index a308545..483e2a6 100644
--- a/src/proguard/classfile/attribute/SyntheticAttribute.java
+++ b/src/proguard/classfile/attribute/SyntheticAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/UnknownAttribute.java b/src/proguard/classfile/attribute/UnknownAttribute.java
index f928f25..9cdcfe9 100644
--- a/src/proguard/classfile/attribute/UnknownAttribute.java
+++ b/src/proguard/classfile/attribute/UnknownAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/Annotation.java b/src/proguard/classfile/attribute/annotation/Annotation.java
index 3e24a9e..753e275 100644
--- a/src/proguard/classfile/attribute/annotation/Annotation.java
+++ b/src/proguard/classfile/attribute/annotation/Annotation.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/AnnotationDefaultAttribute.java b/src/proguard/classfile/attribute/annotation/AnnotationDefaultAttribute.java
index 1b06e82..f742db2 100644
--- a/src/proguard/classfile/attribute/annotation/AnnotationDefaultAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/AnnotationDefaultAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/AnnotationElementValue.java b/src/proguard/classfile/attribute/annotation/AnnotationElementValue.java
index 1e6365c..ac075ef 100644
--- a/src/proguard/classfile/attribute/annotation/AnnotationElementValue.java
+++ b/src/proguard/classfile/attribute/annotation/AnnotationElementValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/AnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/AnnotationsAttribute.java
index dcb7cf6..2ff7446 100644
--- a/src/proguard/classfile/attribute/annotation/AnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/AnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/ArrayElementValue.java b/src/proguard/classfile/attribute/annotation/ArrayElementValue.java
index 4d814c0..d34f757 100644
--- a/src/proguard/classfile/attribute/annotation/ArrayElementValue.java
+++ b/src/proguard/classfile/attribute/annotation/ArrayElementValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/ClassElementValue.java b/src/proguard/classfile/attribute/annotation/ClassElementValue.java
index 0e5de1e..02bb494 100644
--- a/src/proguard/classfile/attribute/annotation/ClassElementValue.java
+++ b/src/proguard/classfile/attribute/annotation/ClassElementValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/ConstantElementValue.java b/src/proguard/classfile/attribute/annotation/ConstantElementValue.java
index 5ff51db..d639c7f 100644
--- a/src/proguard/classfile/attribute/annotation/ConstantElementValue.java
+++ b/src/proguard/classfile/attribute/annotation/ConstantElementValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/ElementValue.java b/src/proguard/classfile/attribute/annotation/ElementValue.java
index 9c0f2c9..c29a67f 100644
--- a/src/proguard/classfile/attribute/annotation/ElementValue.java
+++ b/src/proguard/classfile/attribute/annotation/ElementValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/EnumConstantElementValue.java b/src/proguard/classfile/attribute/annotation/EnumConstantElementValue.java
index 1105100..6742fab 100644
--- a/src/proguard/classfile/attribute/annotation/EnumConstantElementValue.java
+++ b/src/proguard/classfile/attribute/annotation/EnumConstantElementValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/ParameterAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/ParameterAnnotationsAttribute.java
index 4b0cb1c..140b829 100644
--- a/src/proguard/classfile/attribute/annotation/ParameterAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/ParameterAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/RuntimeInvisibleAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/RuntimeInvisibleAnnotationsAttribute.java
index 84d9d61..17c5e58 100644
--- a/src/proguard/classfile/attribute/annotation/RuntimeInvisibleAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/RuntimeInvisibleAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/RuntimeInvisibleParameterAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/RuntimeInvisibleParameterAnnotationsAttribute.java
index 0a5e1d7..8824615 100644
--- a/src/proguard/classfile/attribute/annotation/RuntimeInvisibleParameterAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/RuntimeInvisibleParameterAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/RuntimeInvisibleTypeAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/RuntimeInvisibleTypeAnnotationsAttribute.java
index 2e1ca95..8840073 100644
--- a/src/proguard/classfile/attribute/annotation/RuntimeInvisibleTypeAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/RuntimeInvisibleTypeAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/RuntimeVisibleAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/RuntimeVisibleAnnotationsAttribute.java
index 89acf04..dd2550a 100644
--- a/src/proguard/classfile/attribute/annotation/RuntimeVisibleAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/RuntimeVisibleAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/RuntimeVisibleParameterAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/RuntimeVisibleParameterAnnotationsAttribute.java
index cc273c2..593743c 100644
--- a/src/proguard/classfile/attribute/annotation/RuntimeVisibleParameterAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/RuntimeVisibleParameterAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/RuntimeVisibleTypeAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/RuntimeVisibleTypeAnnotationsAttribute.java
index 084827a..c0e01fc 100644
--- a/src/proguard/classfile/attribute/annotation/RuntimeVisibleTypeAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/RuntimeVisibleTypeAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/TypeAnnotation.java b/src/proguard/classfile/attribute/annotation/TypeAnnotation.java
index 86e4ddf..fa555ab 100644
--- a/src/proguard/classfile/attribute/annotation/TypeAnnotation.java
+++ b/src/proguard/classfile/attribute/annotation/TypeAnnotation.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/TypeAnnotationsAttribute.java b/src/proguard/classfile/attribute/annotation/TypeAnnotationsAttribute.java
index 7606e05..85dd3e5 100644
--- a/src/proguard/classfile/attribute/annotation/TypeAnnotationsAttribute.java
+++ b/src/proguard/classfile/attribute/annotation/TypeAnnotationsAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/TypePathInfo.java b/src/proguard/classfile/attribute/annotation/TypePathInfo.java
index 9b40f7c..9557a38 100644
--- a/src/proguard/classfile/attribute/annotation/TypePathInfo.java
+++ b/src/proguard/classfile/attribute/annotation/TypePathInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/CatchTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/CatchTargetInfo.java
index 9421b9c..11e6f09 100644
--- a/src/proguard/classfile/attribute/annotation/target/CatchTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/CatchTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/EmptyTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/EmptyTargetInfo.java
index fb0d794..9cefe19 100644
--- a/src/proguard/classfile/attribute/annotation/target/EmptyTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/EmptyTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/FormalParameterTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/FormalParameterTargetInfo.java
index 04bd9c5..f55c4b1 100644
--- a/src/proguard/classfile/attribute/annotation/target/FormalParameterTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/FormalParameterTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetElement.java b/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetElement.java
index bcf41dc..8388125 100644
--- a/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetElement.java
+++ b/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetElement.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetInfo.java
index dd9246c..35d8dc6 100644
--- a/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/LocalVariableTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/OffsetTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/OffsetTargetInfo.java
index 312046b..7a63429 100644
--- a/src/proguard/classfile/attribute/annotation/target/OffsetTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/OffsetTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/SuperTypeTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/SuperTypeTargetInfo.java
index 0db7ea4..250fd52 100644
--- a/src/proguard/classfile/attribute/annotation/target/SuperTypeTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/SuperTypeTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/TargetInfo.java b/src/proguard/classfile/attribute/annotation/target/TargetInfo.java
index efee2e2..6037aac 100644
--- a/src/proguard/classfile/attribute/annotation/target/TargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/TargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/ThrowsTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/ThrowsTargetInfo.java
index d5b2db7..795681f 100644
--- a/src/proguard/classfile/attribute/annotation/target/ThrowsTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/ThrowsTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/TypeArgumentTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/TypeArgumentTargetInfo.java
index 4aef72e..7017af5 100644
--- a/src/proguard/classfile/attribute/annotation/target/TypeArgumentTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/TypeArgumentTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/TypeParameterBoundTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/TypeParameterBoundTargetInfo.java
index 0f485ee..a1ec8b0 100644
--- a/src/proguard/classfile/attribute/annotation/target/TypeParameterBoundTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/TypeParameterBoundTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/TypeParameterTargetInfo.java b/src/proguard/classfile/attribute/annotation/target/TypeParameterTargetInfo.java
index 3150a26..333f33d 100644
--- a/src/proguard/classfile/attribute/annotation/target/TypeParameterTargetInfo.java
+++ b/src/proguard/classfile/attribute/annotation/target/TypeParameterTargetInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/visitor/LocalVariableTargetElementVisitor.java b/src/proguard/classfile/attribute/annotation/target/visitor/LocalVariableTargetElementVisitor.java
index 62fe148..238a75a 100644
--- a/src/proguard/classfile/attribute/annotation/target/visitor/LocalVariableTargetElementVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/target/visitor/LocalVariableTargetElementVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/target/visitor/TargetInfoVisitor.java b/src/proguard/classfile/attribute/annotation/target/visitor/TargetInfoVisitor.java
index 33e7d32..036ea22 100644
--- a/src/proguard/classfile/attribute/annotation/target/visitor/TargetInfoVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/target/visitor/TargetInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/AllAnnotationVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/AllAnnotationVisitor.java
index b4513d7..bc85f8e 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/AllAnnotationVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/AllAnnotationVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/AllElementValueVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/AllElementValueVisitor.java
index 4413082..fdf198b 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/AllElementValueVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/AllElementValueVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/AnnotatedClassVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/AnnotatedClassVisitor.java
index 241e9e6..3fa8b41 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/AnnotatedClassVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/AnnotatedClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/AnnotationToMemberVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/AnnotationToMemberVisitor.java
index 6bb2454..c039b59 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/AnnotationToMemberVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/AnnotationToMemberVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/AnnotationTypeFilter.java b/src/proguard/classfile/attribute/annotation/visitor/AnnotationTypeFilter.java
index ad7b316..151469d 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/AnnotationTypeFilter.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/AnnotationTypeFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/AnnotationVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/AnnotationVisitor.java
index 3225c97..439ead5 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/AnnotationVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/AnnotationVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/ElementValueVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/ElementValueVisitor.java
index 453c14b..b5a096e 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/ElementValueVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/ElementValueVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/TypeAnnotationVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/TypeAnnotationVisitor.java
index 3a01887..b7f6256 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/TypeAnnotationVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/TypeAnnotationVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/annotation/visitor/TypePathInfoVisitor.java b/src/proguard/classfile/attribute/annotation/visitor/TypePathInfoVisitor.java
index ab7d51b..55a7c4b 100644
--- a/src/proguard/classfile/attribute/annotation/visitor/TypePathInfoVisitor.java
+++ b/src/proguard/classfile/attribute/annotation/visitor/TypePathInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/DoubleType.java b/src/proguard/classfile/attribute/preverification/DoubleType.java
index 1f0478d..7be9e28 100644
--- a/src/proguard/classfile/attribute/preverification/DoubleType.java
+++ b/src/proguard/classfile/attribute/preverification/DoubleType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/FloatType.java b/src/proguard/classfile/attribute/preverification/FloatType.java
index ee0fe94..d13569b 100644
--- a/src/proguard/classfile/attribute/preverification/FloatType.java
+++ b/src/proguard/classfile/attribute/preverification/FloatType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/FullFrame.java b/src/proguard/classfile/attribute/preverification/FullFrame.java
index 09890f2..b6ed998 100644
--- a/src/proguard/classfile/attribute/preverification/FullFrame.java
+++ b/src/proguard/classfile/attribute/preverification/FullFrame.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/IntegerType.java b/src/proguard/classfile/attribute/preverification/IntegerType.java
index 9d8144a..bdf33a2 100644
--- a/src/proguard/classfile/attribute/preverification/IntegerType.java
+++ b/src/proguard/classfile/attribute/preverification/IntegerType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/LessZeroFrame.java b/src/proguard/classfile/attribute/preverification/LessZeroFrame.java
index 681c9ab..c92d926 100644
--- a/src/proguard/classfile/attribute/preverification/LessZeroFrame.java
+++ b/src/proguard/classfile/attribute/preverification/LessZeroFrame.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/LongType.java b/src/proguard/classfile/attribute/preverification/LongType.java
index dafac5a..8ab1beb 100644
--- a/src/proguard/classfile/attribute/preverification/LongType.java
+++ b/src/proguard/classfile/attribute/preverification/LongType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/MoreZeroFrame.java b/src/proguard/classfile/attribute/preverification/MoreZeroFrame.java
index be4e08d..0142894 100644
--- a/src/proguard/classfile/attribute/preverification/MoreZeroFrame.java
+++ b/src/proguard/classfile/attribute/preverification/MoreZeroFrame.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/NullType.java b/src/proguard/classfile/attribute/preverification/NullType.java
index 00b27a7..445b7e2 100644
--- a/src/proguard/classfile/attribute/preverification/NullType.java
+++ b/src/proguard/classfile/attribute/preverification/NullType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/ObjectType.java b/src/proguard/classfile/attribute/preverification/ObjectType.java
index 6b54277..783f11d 100644
--- a/src/proguard/classfile/attribute/preverification/ObjectType.java
+++ b/src/proguard/classfile/attribute/preverification/ObjectType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/SameOneFrame.java b/src/proguard/classfile/attribute/preverification/SameOneFrame.java
index 63b9058..2da10c6 100644
--- a/src/proguard/classfile/attribute/preverification/SameOneFrame.java
+++ b/src/proguard/classfile/attribute/preverification/SameOneFrame.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/SameZeroFrame.java b/src/proguard/classfile/attribute/preverification/SameZeroFrame.java
index 694ed2a..a702035 100644
--- a/src/proguard/classfile/attribute/preverification/SameZeroFrame.java
+++ b/src/proguard/classfile/attribute/preverification/SameZeroFrame.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/StackMapAttribute.java b/src/proguard/classfile/attribute/preverification/StackMapAttribute.java
index 9b7bbfd..403669e 100644
--- a/src/proguard/classfile/attribute/preverification/StackMapAttribute.java
+++ b/src/proguard/classfile/attribute/preverification/StackMapAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/StackMapFrame.java b/src/proguard/classfile/attribute/preverification/StackMapFrame.java
index 9b2f43b..899e0d2 100644
--- a/src/proguard/classfile/attribute/preverification/StackMapFrame.java
+++ b/src/proguard/classfile/attribute/preverification/StackMapFrame.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/StackMapTableAttribute.java b/src/proguard/classfile/attribute/preverification/StackMapTableAttribute.java
index a6f9ca6..abb503c 100644
--- a/src/proguard/classfile/attribute/preverification/StackMapTableAttribute.java
+++ b/src/proguard/classfile/attribute/preverification/StackMapTableAttribute.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/TopType.java b/src/proguard/classfile/attribute/preverification/TopType.java
index 9804c53..8ce6afd 100644
--- a/src/proguard/classfile/attribute/preverification/TopType.java
+++ b/src/proguard/classfile/attribute/preverification/TopType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/UninitializedThisType.java b/src/proguard/classfile/attribute/preverification/UninitializedThisType.java
index fcbcd7d..61c34b1 100644
--- a/src/proguard/classfile/attribute/preverification/UninitializedThisType.java
+++ b/src/proguard/classfile/attribute/preverification/UninitializedThisType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/UninitializedType.java b/src/proguard/classfile/attribute/preverification/UninitializedType.java
index 1b9de74..23cc690 100644
--- a/src/proguard/classfile/attribute/preverification/UninitializedType.java
+++ b/src/proguard/classfile/attribute/preverification/UninitializedType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/VerificationType.java b/src/proguard/classfile/attribute/preverification/VerificationType.java
index 22ad72f..c6f2f2c 100644
--- a/src/proguard/classfile/attribute/preverification/VerificationType.java
+++ b/src/proguard/classfile/attribute/preverification/VerificationType.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/VerificationTypeFactory.java b/src/proguard/classfile/attribute/preverification/VerificationTypeFactory.java
index 71d2c3e..56417bb 100644
--- a/src/proguard/classfile/attribute/preverification/VerificationTypeFactory.java
+++ b/src/proguard/classfile/attribute/preverification/VerificationTypeFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/visitor/StackMapFrameVisitor.java b/src/proguard/classfile/attribute/preverification/visitor/StackMapFrameVisitor.java
index f269f6e..d9164fe 100644
--- a/src/proguard/classfile/attribute/preverification/visitor/StackMapFrameVisitor.java
+++ b/src/proguard/classfile/attribute/preverification/visitor/StackMapFrameVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/preverification/visitor/VerificationTypeVisitor.java b/src/proguard/classfile/attribute/preverification/visitor/VerificationTypeVisitor.java
index cf39ca2..1d6d498 100644
--- a/src/proguard/classfile/attribute/preverification/visitor/VerificationTypeVisitor.java
+++ b/src/proguard/classfile/attribute/preverification/visitor/VerificationTypeVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/AllAttributeVisitor.java b/src/proguard/classfile/attribute/visitor/AllAttributeVisitor.java
index 701451e..7e49633 100644
--- a/src/proguard/classfile/attribute/visitor/AllAttributeVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/AllAttributeVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/AllBootstrapMethodInfoVisitor.java b/src/proguard/classfile/attribute/visitor/AllBootstrapMethodInfoVisitor.java
index 6110325..7b6be2e 100644
--- a/src/proguard/classfile/attribute/visitor/AllBootstrapMethodInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/AllBootstrapMethodInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java b/src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java
index 9b6c9de..e8aaf8b 100644
--- a/src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/AllInnerClassesInfoVisitor.java b/src/proguard/classfile/attribute/visitor/AllInnerClassesInfoVisitor.java
index b1005c8..6cc289c 100644
--- a/src/proguard/classfile/attribute/visitor/AllInnerClassesInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/AllInnerClassesInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java b/src/proguard/classfile/attribute/visitor/AllLineNumberInfoVisitor.java
similarity index 64%
copy from src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java
copy to src/proguard/classfile/attribute/visitor/AllLineNumberInfoVisitor.java
index 9b6c9de..153b0a5 100644
--- a/src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/AllLineNumberInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -25,21 +25,21 @@ import proguard.classfile.attribute.*;
import proguard.classfile.util.SimplifiedVisitor;
/**
- * This AttributeVisitor lets a given ExceptionInfoVisitor visit all exceptions
- * objects of the CodeAttribute objects it visits.
+ * This AttributeVisitor lets a given LineNumberInfoVisitor visit all line numbers
+ * of the LineNumberTableAttribute objects it visits.
*
* @author Eric Lafortune
*/
-public class AllExceptionInfoVisitor
+public class AllLineNumberInfoVisitor
extends SimplifiedVisitor
implements AttributeVisitor
{
- private final ExceptionInfoVisitor exceptionInfoVisitor;
+ private final LineNumberInfoVisitor lineNumberInfoVisitor;
- public AllExceptionInfoVisitor(ExceptionInfoVisitor exceptionInfoVisitor)
+ public AllLineNumberInfoVisitor(LineNumberInfoVisitor lineNumberInfoVisitor)
{
- this.exceptionInfoVisitor = exceptionInfoVisitor;
+ this.lineNumberInfoVisitor = lineNumberInfoVisitor;
}
@@ -48,8 +48,8 @@ implements AttributeVisitor
public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}
- public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
+ public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
{
- codeAttribute.exceptionsAccept(clazz, method, exceptionInfoVisitor);
+ lineNumberTableAttribute.lineNumbersAccept(clazz, method, codeAttribute, lineNumberInfoVisitor);
}
}
diff --git a/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java b/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java
index 14c1edc..cd4cc27 100644
--- a/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java
+++ b/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/AttributeVisitor.java b/src/proguard/classfile/attribute/visitor/AttributeVisitor.java
index a9fc6b6..937ff2c 100644
--- a/src/proguard/classfile/attribute/visitor/AttributeVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/AttributeVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java b/src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java
index fb2a9d6..65b1ffe 100755
--- a/src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/ExceptionInfoVisitor.java b/src/proguard/classfile/attribute/visitor/ExceptionInfoVisitor.java
index 953dc06..e7e0fbd 100644
--- a/src/proguard/classfile/attribute/visitor/ExceptionInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/ExceptionInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/InnerClassesInfoVisitor.java b/src/proguard/classfile/attribute/visitor/InnerClassesInfoVisitor.java
index f9e1a03..d6f0d74 100644
--- a/src/proguard/classfile/attribute/visitor/InnerClassesInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/InnerClassesInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/LineNumberInfoVisitor.java b/src/proguard/classfile/attribute/visitor/LineNumberInfoVisitor.java
index 5a6400d..5d2dbd0 100644
--- a/src/proguard/classfile/attribute/visitor/LineNumberInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/LineNumberInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/LineNumberRangeFinder.java b/src/proguard/classfile/attribute/visitor/LineNumberRangeFinder.java
new file mode 100644
index 0000000..fec14f0
--- /dev/null
+++ b/src/proguard/classfile/attribute/visitor/LineNumberRangeFinder.java
@@ -0,0 +1,89 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.classfile.attribute.visitor;
+
+import proguard.classfile.*;
+import proguard.classfile.attribute.*;
+
+/**
+ * This LineNumberInfoVisitor remembers the lowest and the highest line
+ * numbers that it finds in all the line numbers that it visits. It
+ * ignores the sources of the line numbers.
+ */
+public class LineNumberRangeFinder
+implements LineNumberInfoVisitor
+{
+ private int lowestLineNumber = Integer.MAX_VALUE;
+ private int highestLineNumber = 0;
+ private boolean hasSource;
+
+
+ /**
+ * Returns the lowest line number that has been visited so far.
+ */
+ public int getLowestLineNumber()
+ {
+ return lowestLineNumber;
+ }
+
+
+ /**
+ * Returns the highest line number that has been visited so far.
+ */
+ public int getHighestLineNumber()
+ {
+ return highestLineNumber;
+ }
+
+
+ /**
+ * Returns whether any of the visited line numbers has a non-null source.
+ */
+ public boolean hasSource()
+ {
+ return hasSource;
+ }
+
+
+ // Implementations for LineNumberInfoVisitor.
+
+ public void visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
+ {
+ int lineNumber = lineNumberInfo.u2lineNumber;
+
+ // Remember the lowest line number.
+ if (lowestLineNumber > lineNumber)
+ {
+ lowestLineNumber = lineNumber;
+ }
+
+ // Remember the highest line number.
+ if (highestLineNumber < lineNumber)
+ {
+ highestLineNumber = lineNumber;
+ }
+
+ if (lineNumberInfo.getSource() != null)
+ {
+ hasSource = true;
+ }
+ }
+}
diff --git a/src/proguard/classfile/attribute/visitor/LocalVariableInfoVisitor.java b/src/proguard/classfile/attribute/visitor/LocalVariableInfoVisitor.java
index dd17bea..a6b5c0c 100644
--- a/src/proguard/classfile/attribute/visitor/LocalVariableInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/LocalVariableInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/LocalVariableTypeInfoVisitor.java b/src/proguard/classfile/attribute/visitor/LocalVariableTypeInfoVisitor.java
index c37e9d7..5166983 100644
--- a/src/proguard/classfile/attribute/visitor/LocalVariableTypeInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/LocalVariableTypeInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/MultiAttributeVisitor.java b/src/proguard/classfile/attribute/visitor/MultiAttributeVisitor.java
index 968f852..5e9cf75 100644
--- a/src/proguard/classfile/attribute/visitor/MultiAttributeVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/MultiAttributeVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/NonEmptyAttributeFilter.java b/src/proguard/classfile/attribute/visitor/NonEmptyAttributeFilter.java
index 4a54f75..108d9bb 100644
--- a/src/proguard/classfile/attribute/visitor/NonEmptyAttributeFilter.java
+++ b/src/proguard/classfile/attribute/visitor/NonEmptyAttributeFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/ParameterInfoVisitor.java b/src/proguard/classfile/attribute/visitor/ParameterInfoVisitor.java
index 9f91c5b..30caf17 100644
--- a/src/proguard/classfile/attribute/visitor/ParameterInfoVisitor.java
+++ b/src/proguard/classfile/attribute/visitor/ParameterInfoVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/RequiredAttributeFilter.java b/src/proguard/classfile/attribute/visitor/RequiredAttributeFilter.java
index 176846d..ee176df 100644
--- a/src/proguard/classfile/attribute/visitor/RequiredAttributeFilter.java
+++ b/src/proguard/classfile/attribute/visitor/RequiredAttributeFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/StackSizeComputer.java b/src/proguard/classfile/attribute/visitor/StackSizeComputer.java
index d5cd99d..3f9eaf8 100644
--- a/src/proguard/classfile/attribute/visitor/StackSizeComputer.java
+++ b/src/proguard/classfile/attribute/visitor/StackSizeComputer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/ClassConstant.java b/src/proguard/classfile/constant/ClassConstant.java
index fedfefe..7919548 100644
--- a/src/proguard/classfile/constant/ClassConstant.java
+++ b/src/proguard/classfile/constant/ClassConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/Constant.java b/src/proguard/classfile/constant/Constant.java
index 72d495a..da2cb5b 100644
--- a/src/proguard/classfile/constant/Constant.java
+++ b/src/proguard/classfile/constant/Constant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/DoubleConstant.java b/src/proguard/classfile/constant/DoubleConstant.java
index 9a6f292..7d1bd3b 100644
--- a/src/proguard/classfile/constant/DoubleConstant.java
+++ b/src/proguard/classfile/constant/DoubleConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/FieldrefConstant.java b/src/proguard/classfile/constant/FieldrefConstant.java
index 5755b75..6cc61f3 100644
--- a/src/proguard/classfile/constant/FieldrefConstant.java
+++ b/src/proguard/classfile/constant/FieldrefConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/FloatConstant.java b/src/proguard/classfile/constant/FloatConstant.java
index 7d89b39..48196a8 100644
--- a/src/proguard/classfile/constant/FloatConstant.java
+++ b/src/proguard/classfile/constant/FloatConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/IntegerConstant.java b/src/proguard/classfile/constant/IntegerConstant.java
index 9b244ee..536cf3a 100644
--- a/src/proguard/classfile/constant/IntegerConstant.java
+++ b/src/proguard/classfile/constant/IntegerConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/InterfaceMethodrefConstant.java b/src/proguard/classfile/constant/InterfaceMethodrefConstant.java
index 6d4901d..f77f9b8 100644
--- a/src/proguard/classfile/constant/InterfaceMethodrefConstant.java
+++ b/src/proguard/classfile/constant/InterfaceMethodrefConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/InvokeDynamicConstant.java b/src/proguard/classfile/constant/InvokeDynamicConstant.java
index 1ad3954..c11dc26 100755
--- a/src/proguard/classfile/constant/InvokeDynamicConstant.java
+++ b/src/proguard/classfile/constant/InvokeDynamicConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/LongConstant.java b/src/proguard/classfile/constant/LongConstant.java
index 2fd1daf..d187747 100644
--- a/src/proguard/classfile/constant/LongConstant.java
+++ b/src/proguard/classfile/constant/LongConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/MethodHandleConstant.java b/src/proguard/classfile/constant/MethodHandleConstant.java
index c5d4e82..71a8cd2 100755
--- a/src/proguard/classfile/constant/MethodHandleConstant.java
+++ b/src/proguard/classfile/constant/MethodHandleConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -38,7 +38,7 @@ public class MethodHandleConstant extends Constant
* An extra field pointing to the java.lang.invoke.MethodHandle Clazz object.
* This field is typically filled out by the <code>{@link
* proguard.classfile.util.ClassReferenceInitializer
- * ClassReferenceInitializer}</code>..
+ * ClassReferenceInitializer}</code>.
*/
public Clazz javaLangInvokeMethodHandleClass;
@@ -94,6 +94,14 @@ public class MethodHandleConstant extends Constant
/**
+ * Returns the class name.
+ */
+ public String getClassName(Clazz clazz)
+ {
+ return clazz.getRefClassName(u2referenceIndex);
+ }
+
+ /**
* Returns the method/field name.
*/
public String getName(Clazz clazz)
diff --git a/src/proguard/classfile/constant/MethodTypeConstant.java b/src/proguard/classfile/constant/MethodTypeConstant.java
index 5efd0fe..4766a6b 100644
--- a/src/proguard/classfile/constant/MethodTypeConstant.java
+++ b/src/proguard/classfile/constant/MethodTypeConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/MethodrefConstant.java b/src/proguard/classfile/constant/MethodrefConstant.java
index cb43efc..60b8397 100644
--- a/src/proguard/classfile/constant/MethodrefConstant.java
+++ b/src/proguard/classfile/constant/MethodrefConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/NameAndTypeConstant.java b/src/proguard/classfile/constant/NameAndTypeConstant.java
index c82e57e..358433b 100644
--- a/src/proguard/classfile/constant/NameAndTypeConstant.java
+++ b/src/proguard/classfile/constant/NameAndTypeConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/RefConstant.java b/src/proguard/classfile/constant/RefConstant.java
index 50ac976..b20f6b0 100644
--- a/src/proguard/classfile/constant/RefConstant.java
+++ b/src/proguard/classfile/constant/RefConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/StringConstant.java b/src/proguard/classfile/constant/StringConstant.java
index c3475a5..30111cd 100644
--- a/src/proguard/classfile/constant/StringConstant.java
+++ b/src/proguard/classfile/constant/StringConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/Utf8Constant.java b/src/proguard/classfile/constant/Utf8Constant.java
index 4eaf304..51e72c5 100644
--- a/src/proguard/classfile/constant/Utf8Constant.java
+++ b/src/proguard/classfile/constant/Utf8Constant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/visitor/AllConstantVisitor.java b/src/proguard/classfile/constant/visitor/AllConstantVisitor.java
index 940ad45..9c9c459 100644
--- a/src/proguard/classfile/constant/visitor/AllConstantVisitor.java
+++ b/src/proguard/classfile/constant/visitor/AllConstantVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java b/src/proguard/classfile/constant/visitor/BootstrapMethodArgumentVisitor.java
old mode 100755
new mode 100644
similarity index 52%
copy from src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java
copy to src/proguard/classfile/constant/visitor/BootstrapMethodArgumentVisitor.java
index fb2a9d6..ceb97f8
--- a/src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java
+++ b/src/proguard/classfile/constant/visitor/BootstrapMethodArgumentVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -18,21 +18,39 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-package proguard.classfile.attribute.visitor;
+package proguard.classfile.constant.visitor;
import proguard.classfile.Clazz;
import proguard.classfile.attribute.BootstrapMethodInfo;
-
+import proguard.classfile.attribute.visitor.BootstrapMethodInfoVisitor;
/**
- * This interface specifies the methods for a visitor of
- * <code>BootstrapMethodInfo</code> objects. Note that there is only a single
- * implementation of <code>BootstrapMethodInfo</code>, such that this interface
- * is not strictly necessary as a visitor.
+ * This BootstrapMethodInfoVisitor lets a given ConstantVisitor visit all
+ * constant pool entries of the bootstrap methods it visits.
+ *
*
* @author Eric Lafortune
*/
-public interface BootstrapMethodInfoVisitor
+public class BootstrapMethodArgumentVisitor
+implements BootstrapMethodInfoVisitor
{
- public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo);
+ private ConstantVisitor constantVisitor;
+
+ /**
+ * Creates a new BootstrapMethodArgumentVisitor that will delegate to the
+ * given constant visitor.
+ */
+ public BootstrapMethodArgumentVisitor(ConstantVisitor constantVisitor)
+ {
+ this.constantVisitor = constantVisitor;
+ }
+
+
+ // Implementations for BootstrapMethodInfoVisitor.
+
+ public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo)
+ {
+ // Check bootstrap method.
+ bootstrapMethodInfo.methodArgumentsAccept(clazz, constantVisitor);
+ }
}
diff --git a/src/proguard/classfile/constant/visitor/BootstrapMethodHandleTraveler.java b/src/proguard/classfile/constant/visitor/BootstrapMethodHandleTraveler.java
index cfd6c1a..037dc25 100644
--- a/src/proguard/classfile/constant/visitor/BootstrapMethodHandleTraveler.java
+++ b/src/proguard/classfile/constant/visitor/BootstrapMethodHandleTraveler.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/visitor/ConstantTagFilter.java b/src/proguard/classfile/constant/visitor/ConstantTagFilter.java
index ffff4b3..7826236 100644
--- a/src/proguard/classfile/constant/visitor/ConstantTagFilter.java
+++ b/src/proguard/classfile/constant/visitor/ConstantTagFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/visitor/ConstantVisitor.java b/src/proguard/classfile/constant/visitor/ConstantVisitor.java
index 11528b8..36cbbe7 100644
--- a/src/proguard/classfile/constant/visitor/ConstantVisitor.java
+++ b/src/proguard/classfile/constant/visitor/ConstantVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/visitor/ExceptClassConstantFilter.java b/src/proguard/classfile/constant/visitor/ExceptClassConstantFilter.java
index 82f180d..6124f42 100644
--- a/src/proguard/classfile/constant/visitor/ExceptClassConstantFilter.java
+++ b/src/proguard/classfile/constant/visitor/ExceptClassConstantFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/constant/visitor/MethodrefTraveler.java b/src/proguard/classfile/constant/visitor/MethodrefTraveler.java
index f5fffbc..c4fcc3c 100644
--- a/src/proguard/classfile/constant/visitor/MethodrefTraveler.java
+++ b/src/proguard/classfile/constant/visitor/MethodrefTraveler.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/AccessFixer.java b/src/proguard/classfile/editor/AccessFixer.java
index 3c41159..25f6144 100644
--- a/src/proguard/classfile/editor/AccessFixer.java
+++ b/src/proguard/classfile/editor/AccessFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/AnnotationAdder.java b/src/proguard/classfile/editor/AnnotationAdder.java
index 3a3fad0..11a0ec1 100644
--- a/src/proguard/classfile/editor/AnnotationAdder.java
+++ b/src/proguard/classfile/editor/AnnotationAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/AnnotationsAttributeEditor.java b/src/proguard/classfile/editor/AnnotationsAttributeEditor.java
index 53cee40..cbc9c50 100644
--- a/src/proguard/classfile/editor/AnnotationsAttributeEditor.java
+++ b/src/proguard/classfile/editor/AnnotationsAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/AttributeAdder.java b/src/proguard/classfile/editor/AttributeAdder.java
index 9abea45..28e61f9 100644
--- a/src/proguard/classfile/editor/AttributeAdder.java
+++ b/src/proguard/classfile/editor/AttributeAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -27,7 +27,6 @@ import proguard.classfile.attribute.preverification.*;
import proguard.classfile.attribute.visitor.AttributeVisitor;
import proguard.classfile.util.SimplifiedVisitor;
-import java.lang.reflect.Array;
import java.util.Arrays;
/**
@@ -293,6 +292,20 @@ implements AttributeVisitor
new ExceptionInfoAdder(targetClass,
codeAttributeComposer));
+ // Add a line number if there wasn't a line number table before,
+ // so we keep track of the source.
+ if (codeAttribute.getAttribute(clazz, ClassConstants.ATTR_LineNumberTable) == null)
+ {
+ String source =
+ clazz.getName() + '.' +
+ method.getName(clazz) +
+ method.getDescriptor(clazz) +
+ ":0:0";
+
+ codeAttributeComposer.insertLineNumber(
+ new ExtendedLineNumberInfo(0, 0, source));
+ }
+
codeAttributeComposer.endCodeFragment();
// Add the attributes.
@@ -334,10 +347,10 @@ implements AttributeVisitor
new LineNumberInfo[lineNumberTableAttribute.u2lineNumberTableLength]);
// Add the line numbers.
- lineNumberTableAttribute.lineNumbersAccept(clazz,
- method,
- codeAttribute,
- new LineNumberInfoAdder(newLineNumberTableAttribute));
+ lineNumberTableAttribute.accept(clazz,
+ method,
+ codeAttribute,
+ new LineNumberInfoAdder(newLineNumberTableAttribute));
// Add it to the target.
attributesEditor.addAttribute(newLineNumberTableAttribute);
diff --git a/src/proguard/classfile/editor/AttributeSorter.java b/src/proguard/classfile/editor/AttributeSorter.java
index 8f1f414..13d0064 100644
--- a/src/proguard/classfile/editor/AttributeSorter.java
+++ b/src/proguard/classfile/editor/AttributeSorter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/AttributesEditor.java b/src/proguard/classfile/editor/AttributesEditor.java
index ce38a6b..7d19e7a 100644
--- a/src/proguard/classfile/editor/AttributesEditor.java
+++ b/src/proguard/classfile/editor/AttributesEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/BootstrapMethodInfoAdder.java b/src/proguard/classfile/editor/BootstrapMethodInfoAdder.java
index 260a561..16ef936 100644
--- a/src/proguard/classfile/editor/BootstrapMethodInfoAdder.java
+++ b/src/proguard/classfile/editor/BootstrapMethodInfoAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/BootstrapMethodRemapper.java b/src/proguard/classfile/editor/BootstrapMethodRemapper.java
index 49aab02..ca61795 100644
--- a/src/proguard/classfile/editor/BootstrapMethodRemapper.java
+++ b/src/proguard/classfile/editor/BootstrapMethodRemapper.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -77,6 +77,12 @@ implements ConstantVisitor
*/
private int remapConstantIndex(int constantIndex)
{
- return constantIndexMap[constantIndex];
+ int remappedConstantIndex = constantIndexMap[constantIndex];
+ if (remappedConstantIndex < 0)
+ {
+ throw new IllegalArgumentException("Can't remap constant index ["+constantIndex+"]");
+ }
+
+ return remappedConstantIndex;
}
}
diff --git a/src/proguard/classfile/editor/BootstrapMethodsAttributeAdder.java b/src/proguard/classfile/editor/BootstrapMethodsAttributeAdder.java
index 1488b9b..b4c3f93 100644
--- a/src/proguard/classfile/editor/BootstrapMethodsAttributeAdder.java
+++ b/src/proguard/classfile/editor/BootstrapMethodsAttributeAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/BootstrapMethodsAttributeEditor.java b/src/proguard/classfile/editor/BootstrapMethodsAttributeEditor.java
index d00d47a..6fb94d2 100644
--- a/src/proguard/classfile/editor/BootstrapMethodsAttributeEditor.java
+++ b/src/proguard/classfile/editor/BootstrapMethodsAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/BridgeMethodFixer.java b/src/proguard/classfile/editor/BridgeMethodFixer.java
index 5699b8e..001bd76 100644
--- a/src/proguard/classfile/editor/BridgeMethodFixer.java
+++ b/src/proguard/classfile/editor/BridgeMethodFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ClassEditor.java b/src/proguard/classfile/editor/ClassEditor.java
index 4d9055b..49b6cc3 100644
--- a/src/proguard/classfile/editor/ClassEditor.java
+++ b/src/proguard/classfile/editor/ClassEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ClassElementSorter.java b/src/proguard/classfile/editor/ClassElementSorter.java
index c514471..97c3c6d 100644
--- a/src/proguard/classfile/editor/ClassElementSorter.java
+++ b/src/proguard/classfile/editor/ClassElementSorter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ClassMemberSorter.java b/src/proguard/classfile/editor/ClassMemberSorter.java
index 7ebe12e..c586754 100644
--- a/src/proguard/classfile/editor/ClassMemberSorter.java
+++ b/src/proguard/classfile/editor/ClassMemberSorter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ClassReferenceFixer.java b/src/proguard/classfile/editor/ClassReferenceFixer.java
index 9eff4a3..dcae147 100644
--- a/src/proguard/classfile/editor/ClassReferenceFixer.java
+++ b/src/proguard/classfile/editor/ClassReferenceFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -203,7 +203,12 @@ implements ClassVisitor,
// Update the String entry if required.
if (!newInternalClassName.equals(internalClassName))
{
- String newExternalClassName = ClassUtil.externalClassName(newInternalClassName);
+ // Only convert to an external class name if the original was
+ // an external class name too.
+ String newExternalClassName =
+ externalClassName.indexOf(JavaConstants.PACKAGE_SEPARATOR) >= 0 ?
+ ClassUtil.externalClassName(newInternalClassName) :
+ newInternalClassName;
// Refer to a new Utf8 entry.
stringConstant.u2stringIndex =
diff --git a/src/proguard/classfile/editor/CodeAttributeComposer.java b/src/proguard/classfile/editor/CodeAttributeComposer.java
index eaa8015..085755e 100644
--- a/src/proguard/classfile/editor/CodeAttributeComposer.java
+++ b/src/proguard/classfile/editor/CodeAttributeComposer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -28,6 +28,7 @@ import proguard.classfile.attribute.visitor.*;
import proguard.classfile.instruction.*;
import proguard.classfile.instruction.visitor.InstructionVisitor;
import proguard.classfile.util.SimplifiedVisitor;
+import proguard.classfile.visitor.ClassPrinter;
import proguard.util.ArrayUtil;
import java.util.Arrays;
@@ -67,6 +68,7 @@ implements AttributeVisitor,
private int maximumCodeLength;
private int codeLength;
private int exceptionTableLength;
+ private int lineNumberTableLength;
private int level = -1;
private byte[] code = new byte[ClassConstants.TYPICAL_CODE_LENGTH];
@@ -76,7 +78,8 @@ implements AttributeVisitor,
private final int[] codeFragmentLengths = new int[MAXIMUM_LEVELS];
private final int[][] instructionOffsetMap = new int[MAXIMUM_LEVELS][ClassConstants.TYPICAL_CODE_LENGTH + 1];
- private ExceptionInfo[] exceptionTable = new ExceptionInfo[ClassConstants.TYPICAL_EXCEPTION_TABLE_LENGTH];
+ private ExceptionInfo[] exceptionTable = new ExceptionInfo[ClassConstants.TYPICAL_EXCEPTION_TABLE_LENGTH];
+ private LineNumberInfo[] lineNumberTable = new LineNumberInfo[ClassConstants.TYPICAL_LINE_NUMBER_TABLE_LENGTH];
private int expectedStackMapFrameOffset;
@@ -124,10 +127,11 @@ implements AttributeVisitor,
*/
public void reset()
{
- maximumCodeLength = 0;
- codeLength = 0;
- exceptionTableLength = 0;
- level = -1;
+ maximumCodeLength = 0;
+ codeLength = 0;
+ exceptionTableLength = 0;
+ lineNumberTableLength = 0;
+ level = -1;
// Make sure the instruction writer has at least the same buffer size
// as the local arrays.
@@ -340,6 +344,89 @@ implements AttributeVisitor,
/**
+ * Inserts the given line number at the appropriate position in the line
+ * number table.
+ * @param lineNumberInfo the line number to be inserted.
+ * @return the index where the line number was actually inserted.
+ */
+ public int insertLineNumber(LineNumberInfo lineNumberInfo)
+ {
+ return insertLineNumber(0, lineNumberInfo);
+ }
+
+
+ /**
+ * Inserts the given line number at the appropriate position in the line
+ * number table.
+ * @param minimumIndex the minimum index where the line number may be
+ * inserted.
+ * @param lineNumberInfo the line number to be inserted.
+ * @return the index where the line number was inserted.
+ */
+ public int insertLineNumber(int minimumIndex, LineNumberInfo lineNumberInfo)
+ {
+ if (DEBUG)
+ {
+ print(" ", "Line number ["+lineNumberInfo.u2startPC+"]");
+ }
+
+ // Remap the line number right away.
+ visitLineNumberInfo(null, null, null, lineNumberInfo);
+
+ if (DEBUG)
+ {
+ System.out.println(" -> ["+lineNumberInfo.u2startPC+"] line "+lineNumberInfo.u2lineNumber+(lineNumberInfo.getSource()==null ? "":" ["+lineNumberInfo.getSource()+"]"));
+ }
+
+ lineNumberTable =
+ (LineNumberInfo[])ArrayUtil.extendArray(lineNumberTable,
+ lineNumberTableLength + 1);
+
+ // Find the insertion index, starting from the end.
+ // Don't insert before a negative line number, in case of a tie.
+ int index = lineNumberTableLength++;
+ while (index > minimumIndex &&
+ (lineNumberTable[index - 1].u2startPC > lineNumberInfo.u2startPC ||
+ lineNumberTable[index - 1].u2startPC >= lineNumberInfo.u2startPC &&
+ lineNumberTable[index - 1].u2lineNumber >= 0))
+ {
+ lineNumberTable[index] = lineNumberTable[--index];
+ }
+
+ lineNumberTable[index] = lineNumberInfo;
+
+ return index;
+ }
+
+
+ /**
+ * Appends the given line number to the line number table.
+ * @param lineNumberInfo the line number to be appended.
+ */
+ public void appendLineNumber(LineNumberInfo lineNumberInfo)
+ {
+ if (DEBUG)
+ {
+ print(" ", "Line number ["+lineNumberInfo.u2startPC+"]");
+ }
+
+ // Remap the line number right away.
+ visitLineNumberInfo(null, null, null, lineNumberInfo);
+
+ if (DEBUG)
+ {
+ System.out.println(" -> ["+lineNumberInfo.u2startPC+"] line "+lineNumberInfo.u2lineNumber+(lineNumberInfo.getSource()==null ? "":" ["+lineNumberInfo.getSource()+"]"));
+ }
+
+ // Add the line number.
+ lineNumberTable =
+ (LineNumberInfo[])ArrayUtil.add(lineNumberTable,
+ lineNumberTableLength++,
+ lineNumberInfo);
+ }
+
+
+ /**
* Wraps up the current code fragment, continuing with the previous one on
* the stack.
*/
@@ -458,7 +545,19 @@ implements AttributeVisitor,
stackSizeUpdater.visitCodeAttribute(clazz, method, codeAttribute);
variableSizeUpdater.visitCodeAttribute(clazz, method, codeAttribute);
- // Remap the line number table and the local variable table.
+ // Add a new line number table for the line numbers, if necessary.
+ if (lineNumberTableLength > 0 &&
+ codeAttribute.getAttribute(clazz, ClassConstants.ATTR_LineNumberTable) == null)
+ {
+ int attributeNameIndex =
+ new ConstantPoolEditor((ProgramClass)clazz)
+ .addUtf8Constant(ClassConstants.ATTR_LineNumberTable);
+
+ new AttributesEditor((ProgramClass)clazz, (ProgramMember)method, codeAttribute, false)
+ .addAttribute(new LineNumberTableAttribute(attributeNameIndex, 0, null));
+ }
+
+ // Copy the line number table and the local variable table.
codeAttribute.attributesAccept(clazz, method, this);
// Remap the exception table (done before).
@@ -473,6 +572,11 @@ implements AttributeVisitor,
instructionWriter.visitCodeAttribute(clazz, method, codeAttribute);
level--;
+
+ if (DEBUG)
+ {
+ codeAttribute.accept(clazz, method, new ClassPrinter());
+ }
}
@@ -494,17 +598,29 @@ implements AttributeVisitor,
public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
{
- // Remap all line number table entries.
- lineNumberTableAttribute.lineNumbersAccept(clazz, method, codeAttribute, this);
-
- // Remove line numbers with empty code blocks.
- lineNumberTableAttribute.u2lineNumberTableLength =
- removeEmptyLineNumbers(lineNumberTableAttribute.lineNumberTable,
- lineNumberTableAttribute.u2lineNumberTableLength,
- codeAttribute.u4codeLength);
+ // Didn't we get line number new definitions?
+ if (lineNumberTableLength == 0)
+ {
+ // Remap all line number table entries of the existing table.
+ lineNumberTableAttribute.lineNumbersAccept(clazz, method, codeAttribute, this);
+ }
+ else
+ {
+ // Remove line numbers with empty code blocks.
+ // Actually, we'll do this elsewhere, to allow processing the
+ // line numbers of inlined methods.
+ //lineNumberTableLength =
+ // removeEmptyLineNumbers(lineNumberTable,
+ // lineNumberTableLength,
+ // codeAttribute.u4codeLength);
+
+ // Copy the line number table.
+ lineNumberTableAttribute.lineNumberTable = new LineNumberInfo[lineNumberTableLength];
+ lineNumberTableAttribute.u2lineNumberTableLength = lineNumberTableLength;
+ System.arraycopy(lineNumberTable, 0, lineNumberTableAttribute.lineNumberTable, 0, lineNumberTableLength);
+ }
}
-
public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)
{
// Remap all local variable table entries.
diff --git a/src/proguard/classfile/editor/CodeAttributeEditor.java b/src/proguard/classfile/editor/CodeAttributeEditor.java
index 41b7471..e33e7de 100644
--- a/src/proguard/classfile/editor/CodeAttributeEditor.java
+++ b/src/proguard/classfile/editor/CodeAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -496,10 +496,10 @@ implements AttributeVisitor,
lineNumberTableAttribute.lineNumbersAccept(clazz, method, codeAttribute, this);
// Remove line numbers with empty code blocks.
- lineNumberTableAttribute.u2lineNumberTableLength =
- removeEmptyLineNumbers(lineNumberTableAttribute.lineNumberTable,
- lineNumberTableAttribute.u2lineNumberTableLength,
- codeAttribute.u4codeLength);
+// lineNumberTableAttribute.u2lineNumberTableLength =
+// removeEmptyLineNumbers(lineNumberTableAttribute.lineNumberTable,
+// lineNumberTableAttribute.u2lineNumberTableLength,
+// codeAttribute.u4codeLength);
}
diff --git a/src/proguard/classfile/editor/CodeAttributeEditorResetter.java b/src/proguard/classfile/editor/CodeAttributeEditorResetter.java
index 88e700b..bc40ea0 100644
--- a/src/proguard/classfile/editor/CodeAttributeEditorResetter.java
+++ b/src/proguard/classfile/editor/CodeAttributeEditorResetter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ComparableConstant.java b/src/proguard/classfile/editor/ComparableConstant.java
index 5c25497..0c380fc 100644
--- a/src/proguard/classfile/editor/ComparableConstant.java
+++ b/src/proguard/classfile/editor/ComparableConstant.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -187,8 +187,10 @@ implements Comparable, ConstantVisitor
result = kind < otherKind ? -1 :
kind > otherKind ? 1 :
- compare(methodHandleConstant.getName(clazz),
+ compare(methodHandleConstant.getClassName(clazz),
+ methodHandleConstant.getName(clazz),
methodHandleConstant.getType(clazz),
+ otherMethodHandleConstant.getClassName(clazz),
otherMethodHandleConstant.getName(clazz),
otherMethodHandleConstant.getType(clazz));
}
diff --git a/src/proguard/classfile/editor/ConstantAdder.java b/src/proguard/classfile/editor/ConstantAdder.java
index 9f326ad..7d9abdd 100644
--- a/src/proguard/classfile/editor/ConstantAdder.java
+++ b/src/proguard/classfile/editor/ConstantAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ConstantPoolEditor.java b/src/proguard/classfile/editor/ConstantPoolEditor.java
index 23f34fe..736d00a 100644
--- a/src/proguard/classfile/editor/ConstantPoolEditor.java
+++ b/src/proguard/classfile/editor/ConstantPoolEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ConstantPoolRemapper.java b/src/proguard/classfile/editor/ConstantPoolRemapper.java
index 6bb90fb..551c33c 100644
--- a/src/proguard/classfile/editor/ConstantPoolRemapper.java
+++ b/src/proguard/classfile/editor/ConstantPoolRemapper.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -589,7 +589,7 @@ implements ClassVisitor,
{
localVariableTypeInfo.u2nameIndex =
remapConstantIndex(localVariableTypeInfo.u2nameIndex);
- localVariableTypeInfo.u2signatureIndex =
+ localVariableTypeInfo.u2signatureIndex =
remapConstantIndex(localVariableTypeInfo.u2signatureIndex);
}
@@ -657,8 +657,6 @@ implements ClassVisitor,
}
- // Small utility methods.
-
/**
* Remaps all constant pool indices in the given array.
*/
@@ -670,6 +668,8 @@ implements ClassVisitor,
}
}
+ // Small utility methods.
+
/**
* Returns the new constant pool index of the entry at the
@@ -677,6 +677,12 @@ implements ClassVisitor,
*/
private int remapConstantIndex(int constantIndex)
{
- return constantIndexMap[constantIndex];
+ int remappedConstantIndex = constantIndexMap[constantIndex];
+ if (remappedConstantIndex < 0)
+ {
+ throw new IllegalArgumentException("Can't remap constant index ["+constantIndex+"]");
+ }
+
+ return remappedConstantIndex;
}
}
diff --git a/src/proguard/classfile/editor/ConstantPoolShrinker.java b/src/proguard/classfile/editor/ConstantPoolShrinker.java
index 4ad0462..601efed 100644
--- a/src/proguard/classfile/editor/ConstantPoolShrinker.java
+++ b/src/proguard/classfile/editor/ConstantPoolShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -572,11 +572,10 @@ implements ClassVisitor,
// Shift the used constant pool entries together.
for (int index = 1; index < length; index++)
{
- constantIndexMap[index] = counter;
-
Constant constant = constantPool[index];
- // Don't update the flag if this is the second half of a long entry.
+ // Is the constant being used? Don't update the flag if this is the
+ // second half of a long entry.
if (constant != null)
{
isUsed = isUsed(constant);
@@ -584,8 +583,17 @@ implements ClassVisitor,
if (isUsed)
{
+ // Remember the new index.
+ constantIndexMap[index] = counter;
+
+ // Shift the constant pool entry.
constantPool[counter++] = constant;
}
+ else
+ {
+ // Remember an invalid index.
+ constantIndexMap[index] = -1;
+ }
}
// Clear the remaining constant pool elements.
diff --git a/src/proguard/classfile/editor/ConstantPoolSorter.java b/src/proguard/classfile/editor/ConstantPoolSorter.java
index 742bed2..3ee7675 100644
--- a/src/proguard/classfile/editor/ConstantPoolSorter.java
+++ b/src/proguard/classfile/editor/ConstantPoolSorter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ElementValueAdder.java b/src/proguard/classfile/editor/ElementValueAdder.java
index 5a99b01..0fb6b19 100644
--- a/src/proguard/classfile/editor/ElementValueAdder.java
+++ b/src/proguard/classfile/editor/ElementValueAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ElementValuesEditor.java b/src/proguard/classfile/editor/ElementValuesEditor.java
index c4add27..2ac4442 100644
--- a/src/proguard/classfile/editor/ElementValuesEditor.java
+++ b/src/proguard/classfile/editor/ElementValuesEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ExceptionAdder.java b/src/proguard/classfile/editor/ExceptionAdder.java
index 2ba0bb6..5241f1a 100644
--- a/src/proguard/classfile/editor/ExceptionAdder.java
+++ b/src/proguard/classfile/editor/ExceptionAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ExceptionInfoAdder.java b/src/proguard/classfile/editor/ExceptionInfoAdder.java
index 4798f84..c47c3ca 100644
--- a/src/proguard/classfile/editor/ExceptionInfoAdder.java
+++ b/src/proguard/classfile/editor/ExceptionInfoAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ExceptionsAttributeEditor.java b/src/proguard/classfile/editor/ExceptionsAttributeEditor.java
index 8dd2e3c..07e606f 100644
--- a/src/proguard/classfile/editor/ExceptionsAttributeEditor.java
+++ b/src/proguard/classfile/editor/ExceptionsAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/InnerClassesAccessFixer.java b/src/proguard/classfile/editor/InnerClassesAccessFixer.java
index fdfdce5..aac6bea 100644
--- a/src/proguard/classfile/editor/InnerClassesAccessFixer.java
+++ b/src/proguard/classfile/editor/InnerClassesAccessFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/InstructionAdder.java b/src/proguard/classfile/editor/InstructionAdder.java
index 4a20e59..61c7772 100644
--- a/src/proguard/classfile/editor/InstructionAdder.java
+++ b/src/proguard/classfile/editor/InstructionAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/InstructionWriter.java b/src/proguard/classfile/editor/InstructionWriter.java
index cafdd87..fcb8d87 100644
--- a/src/proguard/classfile/editor/InstructionWriter.java
+++ b/src/proguard/classfile/editor/InstructionWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/InterfaceAdder.java b/src/proguard/classfile/editor/InterfaceAdder.java
index a7113b4..c73299d 100644
--- a/src/proguard/classfile/editor/InterfaceAdder.java
+++ b/src/proguard/classfile/editor/InterfaceAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/InterfaceDeleter.java b/src/proguard/classfile/editor/InterfaceDeleter.java
new file mode 100644
index 0000000..246edb9
--- /dev/null
+++ b/src/proguard/classfile/editor/InterfaceDeleter.java
@@ -0,0 +1,209 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.classfile.editor;
+
+import proguard.classfile.*;
+import proguard.classfile.attribute.*;
+import proguard.classfile.attribute.visitor.AttributeVisitor;
+import proguard.classfile.constant.Utf8Constant;
+import proguard.classfile.util.*;
+import proguard.classfile.visitor.ClassVisitor;
+
+import java.util.Arrays;
+
+/**
+ * This ClassVisitor removes specified interfaces from the classes and class
+ * signatures that it visits.
+ *
+ * @author Eric Lafortune
+ */
+public class InterfaceDeleter
+extends SimplifiedVisitor
+implements ClassVisitor,
+ AttributeVisitor
+{
+ private static final boolean DEBUG = false;
+
+
+ private final boolean[] delete;
+
+
+ /**
+ * Creates a new InterfaceDeleter to remove the specified interfaces.
+ * @param delete an array that corresponds to the interfaces of a class
+ * and that specifies the ones to be removed.
+ */
+ public InterfaceDeleter(boolean[] delete)
+ {
+ this.delete = delete;
+ }
+
+
+ // Implementations for ClassVisitor.
+
+ public void visitProgramClass(ProgramClass programClass)
+ {
+ int[] interfaces = programClass.u2interfaces;
+ int interfacesCount = programClass.u2interfacesCount;
+
+ if (DEBUG)
+ {
+ System.out.println("InterfaceDeleter: "+programClass.getName()+" ("+interfacesCount+" interfaces)");
+ }
+
+ // Copy the interfaces that aren't deleted.
+ int newInterfacesCount = 0;
+ for (int index = 0; index < interfacesCount; index++)
+ {
+ if (DEBUG)
+ {
+ System.out.println("InterfaceDeleter: "+(delete[index]?"- ":"+ ")+programClass.getInterfaceName(index));
+ }
+
+ if (!delete[index])
+ {
+ interfaces[newInterfacesCount++] = interfaces[index];
+ }
+ }
+
+ // Update the signature.
+ if (newInterfacesCount < interfacesCount)
+ {
+ programClass.u2interfacesCount = newInterfacesCount;
+
+ programClass.attributesAccept(this);
+ }
+ }
+
+
+ // Implementations for AttributeVisitor.
+
+ public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}
+
+
+ public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
+ {
+ Clazz[] referencedClasses = signatureAttribute.referencedClasses;
+ if (referencedClasses != null)
+ {
+ // Process the generic definitions, superclass, and implemented
+ // interfaces.
+ InternalTypeEnumeration internalTypeEnumeration =
+ new InternalTypeEnumeration(signatureAttribute.getSignature(clazz));
+
+ // Recompose the signature types in a string buffer.
+ StringBuffer newSignatureBuffer = new StringBuffer();
+
+ // Also update the array with referenced classes.
+ int referencedClassIndex = 0;
+ int newReferencedClassIndex = 0;
+
+ // Copy the variable type declarations.
+ if (internalTypeEnumeration.hasFormalTypeParameters())
+ {
+ String type = internalTypeEnumeration.formalTypeParameters();
+
+ // Append the type.
+ newSignatureBuffer.append(type);
+
+ // Copy any referenced classes.
+ int classCount =
+ new DescriptorClassEnumeration(type).classCount();
+
+ for (int counter = 0; counter < classCount; counter++)
+ {
+ referencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
+
+ if (DEBUG)
+ {
+ System.out.println("InterfaceDeleter: type parameters = " + type);
+ }
+ }
+
+ // Copy the super class type.
+ if (internalTypeEnumeration.hasMoreTypes())
+ {
+ String type = internalTypeEnumeration.nextType();
+
+ // Append the type.
+ newSignatureBuffer.append(type);
+
+ // Copy any referenced classes.
+ int classCount =
+ new DescriptorClassEnumeration(type).classCount();
+
+ for (int counter = 0; counter < classCount; counter++)
+ {
+ referencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
+
+ if (DEBUG)
+ {
+ System.out.println("InterfaceDeleter: super class type = " + type);
+ }
+ }
+
+ // Copy the interface types.
+ int index = 0;
+ while (internalTypeEnumeration.hasMoreTypes())
+ {
+ String type = internalTypeEnumeration.nextType();
+
+ int classCount =
+ new DescriptorClassEnumeration(type).classCount();
+
+ if (DEBUG)
+ {
+ System.out.println("InterfaceDeleter: interface type " + (delete[index] ? "- " : "+ ") + type + " (" + classCount + " referenced classes)");
+ }
+
+ if (!delete[index++])
+ {
+ // Append the type.
+ newSignatureBuffer.append(type);
+
+ // Copy any referenced classes.
+ for (int counter = 0; counter < classCount; counter++)
+ {
+ referencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
+ }
+ else
+ {
+ referencedClassIndex += classCount;
+ }
+ }
+
+ // Update the signature.
+ ((Utf8Constant)((ProgramClass)clazz).constantPool[signatureAttribute.u2signatureIndex]).setString(newSignatureBuffer.toString());
+
+ // Clear the remaining referenced classes.
+ Arrays.fill(referencedClasses,
+ newReferencedClassIndex,
+ referencedClassIndex,
+ null);
+ }
+ }
+}
diff --git a/src/proguard/classfile/editor/InterfaceSorter.java b/src/proguard/classfile/editor/InterfaceSorter.java
index 27d08ed..2e5c50f 100644
--- a/src/proguard/classfile/editor/InterfaceSorter.java
+++ b/src/proguard/classfile/editor/InterfaceSorter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -39,6 +39,9 @@ extends SimplifiedVisitor
implements ClassVisitor,
AttributeVisitor
{
+ private static final boolean DEBUG = false;
+
+
// Implementations for ClassVisitor.
public void visitProgramClass(ProgramClass programClass)
@@ -51,27 +54,29 @@ implements ClassVisitor,
// Sort the interfaces.
Arrays.sort(interfaces, 0, interfacesCount);
+ // Update the signature.
+ programClass.attributesAccept(this);
+
// Remove any duplicate entries.
- int newInterfacesCount = 0;
- int previousInterfaceIndex = 0;
- for (int index = 0; index < interfacesCount; index++)
+ boolean[] delete = null;
+ for (int index = 1; index < interfacesCount; index++)
{
- int interfaceIndex = interfaces[index];
-
- // Isn't this a duplicate of the previous interface?
- if (interfaceIndex != previousInterfaceIndex)
+ if (interfaces[index] == interfaces[index - 1])
{
- interfaces[newInterfacesCount++] = interfaceIndex;
+ // Lazily create the array.
+ if (delete == null)
+ {
+ delete = new boolean[interfacesCount];
+ }
- // Remember the interface.
- previousInterfaceIndex = interfaceIndex;
+ delete[index] = true;
}
}
- programClass.u2interfacesCount = newInterfacesCount;
-
- // Update the signature, if any
- programClass.attributesAccept(this);
+ if (delete != null)
+ {
+ new InterfaceDeleter(delete).visitProgramClass(programClass);
+ }
}
}
@@ -83,69 +88,159 @@ implements ClassVisitor,
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
{
- // Process the generic definitions, superclass, and implemented
- // interfaces.
- String signature = signatureAttribute.getSignature(clazz);
+ Clazz[] referencedClasses = signatureAttribute.referencedClasses;
+ Clazz[] newReferencedClasses = referencedClasses == null ? null :
+ new Clazz[referencedClasses.length];
+
+ // Recompose the signature types in a string buffer.
+ StringBuffer newSignatureBuffer = new StringBuffer();
- // Count the signature types.
+ // Also update the array with referenced classes.
+ int referencedClassIndex = 0;
+ int newReferencedClassIndex = 0;
+
+ // Process the generic definitions and superclass.
InternalTypeEnumeration internalTypeEnumeration =
- new InternalTypeEnumeration(signature);
+ new InternalTypeEnumeration(signatureAttribute.getSignature(clazz));
- int count = 0;
- int interfacesCount = -1;
- while (internalTypeEnumeration.hasMoreTypes())
+ // Copy the variable type declarations.
+ if (internalTypeEnumeration.hasFormalTypeParameters())
{
- String internalType = internalTypeEnumeration.nextType();
+ String type = internalTypeEnumeration.formalTypeParameters();
+
+ // Append the type.
+ newSignatureBuffer.append(type);
+
+ // Copy any referenced classes.
+ if (newReferencedClasses != null)
+ {
+ int classCount =
+ new DescriptorClassEnumeration(type).classCount();
- count++;
+ for (int counter = 0; counter < classCount; counter++)
+ {
+ newReferencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
+ }
- if (ClassUtil.isInternalClassType(internalType))
+ if (DEBUG)
{
- interfacesCount++;
+ System.out.println("InterfaceDeleter: type parameters = " + type);
}
}
- // Put the signature types in an array.
- internalTypeEnumeration =
- new InternalTypeEnumeration(signature);
+ // Copy the super class type.
+ if (internalTypeEnumeration.hasMoreTypes())
+ {
+ String type = internalTypeEnumeration.nextType();
- String[] internalTypes = new String[count];
+ // Append the type.
+ newSignatureBuffer.append(type);
- for (int index = 0; index < count; index++)
- {
- String internalType = internalTypeEnumeration.nextType();
+ // Copy any referenced classes.
+ if (newReferencedClasses != null)
+ {
+ int classCount =
+ new DescriptorClassEnumeration(type).classCount();
- internalTypes[index] = internalType;
- }
+ for (int counter = 0; counter < classCount; counter++)
+ {
+ newReferencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
+ }
- // Sort the interface types in the array.
- Arrays.sort(internalTypes, count - interfacesCount, count);
+ if (DEBUG)
+ {
+ System.out.println("InterfaceSorter: super class type = " + type);
+ }
+ }
- // Recompose the signature types in a string.
- StringBuffer newSignatureBuffer = new StringBuffer();
+ int firstReferencedInterfaceIndex = referencedClassIndex;
- for (int index = 0; index < count; index++)
+ // Copy the interface types, based on the sorted interface classes.
+ // This has the advantage that we will disregard any interface types
+ // that are not in the interface classes, like in some versions of
+ // the Scala runtime library.
+ for (int interfaceIndex = 0; interfaceIndex < clazz.getInterfaceCount(); interfaceIndex++)
{
- // Is this not an interface type, or an interface type that isn't
- // a duplicate of the previous interface type?
- if (index < count - interfacesCount ||
- !internalTypes[index].equals(internalTypes[index-1]))
+ // Consider the interface class name.
+ String interfaceName = clazz.getInterfaceName(interfaceIndex);
+
+ referencedClassIndex = firstReferencedInterfaceIndex;
+
+ // Find the corresponding interface type.
+ InternalTypeEnumeration internalInterfaceTypeEnumeration =
+ new InternalTypeEnumeration(signatureAttribute.getSignature(clazz));
+
+ // Skip the superclass type.
+ internalInterfaceTypeEnumeration.nextType();
+
+ while (internalInterfaceTypeEnumeration.hasMoreTypes())
{
- newSignatureBuffer.append(internalTypes[index]);
+ String type = internalInterfaceTypeEnumeration.nextType();
+
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(type);
+
+ int classCount =
+ classEnumeration.classCount();
+
+ classEnumeration.nextFluff();
+
+ if (interfaceName.equals(classEnumeration.nextClassName()))
+ {
+ // Append the type.
+ newSignatureBuffer.append(type);
+
+ // Copy any referenced classes.
+ if (newReferencedClasses != null)
+ {
+ for (int counter = 0; counter < classCount; counter++)
+ {
+ newReferencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
+ }
+
+ if (DEBUG)
+ {
+ System.out.println("InterfaceSorter: interface type = " + type);
+ }
+ }
+ else
+ {
+ // Skip all referenced classes.
+ referencedClassIndex += classCount;
+ }
}
}
String newSignature = newSignatureBuffer.toString();
// Did the signature change?
- if (!newSignature.equals(signature))
+ if (!newSignature.equals(signatureAttribute.getSignature(clazz)))
{
// Update the signature.
((Utf8Constant)((ProgramClass)clazz).constantPool[signatureAttribute.u2signatureIndex]).setString(newSignatureBuffer.toString());
- // Clear the referenced classes.
- // TODO: Properly update the referenced classes.
- signatureAttribute.referencedClasses = null;
+ // Update the referenced classes.
+ signatureAttribute.referencedClasses = newReferencedClasses;
+
+ if (DEBUG)
+ {
+ System.out.println("InterfaceSorter: result = "+newSignature);
+ System.out.println("InterfaceSorter: referenced classes:");
+
+ if (newReferencedClasses != null)
+ {
+ for (int index = 0; index < newReferencedClasses.length; index++)
+ {
+ System.out.println(" #"+index+" "+newReferencedClasses[index]);
+ }
+ }
+ }
}
}
}
diff --git a/src/proguard/classfile/editor/InterfacesEditor.java b/src/proguard/classfile/editor/InterfacesEditor.java
index 4de2b2b..c9c0e3a 100644
--- a/src/proguard/classfile/editor/InterfacesEditor.java
+++ b/src/proguard/classfile/editor/InterfacesEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/LineNumberInfoAdder.java b/src/proguard/classfile/editor/LineNumberInfoAdder.java
index c53fc26..3078118 100644
--- a/src/proguard/classfile/editor/LineNumberInfoAdder.java
+++ b/src/proguard/classfile/editor/LineNumberInfoAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -22,17 +22,23 @@ package proguard.classfile.editor;
import proguard.classfile.*;
import proguard.classfile.attribute.*;
-import proguard.classfile.attribute.visitor.LineNumberInfoVisitor;
+import proguard.classfile.attribute.visitor.*;
+import proguard.classfile.util.SimplifiedVisitor;
/**
- * This LineNumberInfoVisitor adds all line numbers that it visits to the given
- * target line number attribute.
+ * This AttributeVisitor adds the line numbers of all line number attributes
+ * that it visits to the given target line number attribute. It ensures that
+ * the sources of the line numbers are preserved or set.
*/
public class LineNumberInfoAdder
-implements LineNumberInfoVisitor
+extends SimplifiedVisitor
+implements AttributeVisitor,
+ LineNumberInfoVisitor
{
private final LineNumberTableAttributeEditor lineNumberTableAttributeEditor;
+ private String source;
+
/**
* Creates a new LineNumberInfoAdder that will copy line numbers into the
@@ -44,14 +50,40 @@ implements LineNumberInfoVisitor
}
+ // Implementations for AttributeVisitor.
+
+ public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}
+
+
+ public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
+ {
+ // Remember the source.
+ source =
+ clazz.getName() + '.' +
+ method.getName(clazz) +
+ method.getDescriptor(clazz) + ':' +
+ lineNumberTableAttribute.getLowestLineNumber() + ':' +
+ lineNumberTableAttribute.getHighestLineNumber();
+
+ // Copy all line numbers.
+ lineNumberTableAttribute.lineNumbersAccept(clazz, method, codeAttribute, this);
+ }
+
+
// Implementations for LineNumberInfoVisitor.
public void visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
{
+ // Make sure we have a source.
+ String newSource = lineNumberInfo.getSource() != null ?
+ lineNumberInfo.getSource() :
+ source;
+
// Create a new line number.
LineNumberInfo newLineNumberInfo =
- new LineNumberInfo(lineNumberInfo.u2startPC,
- lineNumberInfo.u2lineNumber);
+ new ExtendedLineNumberInfo(lineNumberInfo.u2startPC,
+ lineNumberInfo.u2lineNumber,
+ newSource);
// Add it to the target.
lineNumberTableAttributeEditor.addLineNumberInfo(newLineNumberInfo);
diff --git a/src/proguard/classfile/editor/LineNumberTableAttributeEditor.java b/src/proguard/classfile/editor/LineNumberTableAttributeEditor.java
index 5c2cdf3..686ad1e 100644
--- a/src/proguard/classfile/editor/LineNumberTableAttributeEditor.java
+++ b/src/proguard/classfile/editor/LineNumberTableAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/LineNumberTableAttributeTrimmer.java b/src/proguard/classfile/editor/LineNumberTableAttributeTrimmer.java
new file mode 100644
index 0000000..9c5db64
--- /dev/null
+++ b/src/proguard/classfile/editor/LineNumberTableAttributeTrimmer.java
@@ -0,0 +1,78 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.classfile.editor;
+
+import proguard.classfile.*;
+import proguard.classfile.attribute.*;
+import proguard.classfile.attribute.visitor.AttributeVisitor;
+import proguard.classfile.util.SimplifiedVisitor;
+
+import java.util.Arrays;
+
+/**
+ * This AttributeVisitor trims the line number table attributes that it visits.
+ *
+ * @author Eric Lafortune
+ */
+public class LineNumberTableAttributeTrimmer
+extends SimplifiedVisitor
+implements AttributeVisitor
+{
+ // Implementations for AttributeVisitor.
+
+ public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}
+
+
+ public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
+ {
+ LineNumberInfo[] lineNumberTable = lineNumberTableAttribute.lineNumberTable;
+ int lineNumberTableLength = lineNumberTableAttribute.u2lineNumberTableLength;
+
+ // Overwrite all empty line number entries.
+ int newIndex = 0;
+ for (int index = 0; index < lineNumberTableLength; index++)
+ {
+ LineNumberInfo lineNumberInfo = lineNumberTable[index];
+
+ int startPC = lineNumberInfo.u2startPC;
+ int lineNumber = lineNumberInfo.u2lineNumber;
+
+ // The offset must lie inside the code.
+ // The offset must be smaller than the next one.
+ // The line number should be different from the previous one.
+ if (startPC < codeAttribute.u4codeLength &&
+
+ (index == lineNumberTableLength - 1 ||
+ startPC < lineNumberTable[index + 1].u2startPC) &&
+
+ (index == 0 ||
+ lineNumber != lineNumberTable[index - 1].u2lineNumber))
+ {
+ lineNumberTable[newIndex++] = lineNumberInfo;
+ }
+ }
+
+ // Clear the unused array entries.
+ Arrays.fill(lineNumberTable, newIndex, lineNumberTableAttribute.u2lineNumberTableLength, null);
+
+ lineNumberTableAttribute.u2lineNumberTableLength = newIndex;
+ }
+}
diff --git a/src/proguard/classfile/editor/LocalVariableInfoAdder.java b/src/proguard/classfile/editor/LocalVariableInfoAdder.java
index cfbb570..cacbf26 100644
--- a/src/proguard/classfile/editor/LocalVariableInfoAdder.java
+++ b/src/proguard/classfile/editor/LocalVariableInfoAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/LocalVariableTableAttributeEditor.java b/src/proguard/classfile/editor/LocalVariableTableAttributeEditor.java
index d26f937..c3e1f92 100644
--- a/src/proguard/classfile/editor/LocalVariableTableAttributeEditor.java
+++ b/src/proguard/classfile/editor/LocalVariableTableAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/LocalVariableTypeInfoAdder.java b/src/proguard/classfile/editor/LocalVariableTypeInfoAdder.java
index 94a5f2a..99b6147 100644
--- a/src/proguard/classfile/editor/LocalVariableTypeInfoAdder.java
+++ b/src/proguard/classfile/editor/LocalVariableTypeInfoAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java b/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java
index 724b7b0..1874d40 100644
--- a/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java
+++ b/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/MemberAdder.java b/src/proguard/classfile/editor/MemberAdder.java
index 2a93016..c04e0d8 100644
--- a/src/proguard/classfile/editor/MemberAdder.java
+++ b/src/proguard/classfile/editor/MemberAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/MemberReferenceFixer.java b/src/proguard/classfile/editor/MemberReferenceFixer.java
index 3a32963..33de146 100644
--- a/src/proguard/classfile/editor/MemberReferenceFixer.java
+++ b/src/proguard/classfile/editor/MemberReferenceFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/MethodInvocationFixer.java b/src/proguard/classfile/editor/MethodInvocationFixer.java
index 81b33ea..1147c00 100644
--- a/src/proguard/classfile/editor/MethodInvocationFixer.java
+++ b/src/proguard/classfile/editor/MethodInvocationFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/NameAndTypeShrinker.java b/src/proguard/classfile/editor/NameAndTypeShrinker.java
index e4d46e1..bc45815 100644
--- a/src/proguard/classfile/editor/NameAndTypeShrinker.java
+++ b/src/proguard/classfile/editor/NameAndTypeShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -162,11 +162,10 @@ implements ClassVisitor,
// Shift the used constant pool entries together.
for (int index = 1; index < length; index++)
{
- constantIndexMap[index] = counter;
-
Constant constant = constantPool[index];
- // Don't update the flag if this is the second half of a long entry.
+ // Is the constant being used? Don't update the flag if this is the
+ // second half of a long entry.
if (constant != null)
{
isUsed = constant.getTag() != ClassConstants.CONSTANT_NameAndType ||
@@ -175,8 +174,17 @@ implements ClassVisitor,
if (isUsed)
{
+ // Remember the new index.
+ constantIndexMap[index] = counter;
+
+ // Shift the constant pool entry.
constantPool[counter++] = constant;
}
+ else
+ {
+ // Remember an invalid index.
+ constantIndexMap[index] = -1;
+ }
}
// Clear the remaining constant pool elements.
diff --git a/src/proguard/classfile/editor/NamedAttributeDeleter.java b/src/proguard/classfile/editor/NamedAttributeDeleter.java
index c02ba84..7507307 100644
--- a/src/proguard/classfile/editor/NamedAttributeDeleter.java
+++ b/src/proguard/classfile/editor/NamedAttributeDeleter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ParameterAnnotationsAttributeEditor.java b/src/proguard/classfile/editor/ParameterAnnotationsAttributeEditor.java
index b7d29f7..0036310 100644
--- a/src/proguard/classfile/editor/ParameterAnnotationsAttributeEditor.java
+++ b/src/proguard/classfile/editor/ParameterAnnotationsAttributeEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/ParameterInfoAdder.java b/src/proguard/classfile/editor/ParameterInfoAdder.java
index 50d35b2..62cfa14 100644
--- a/src/proguard/classfile/editor/ParameterInfoAdder.java
+++ b/src/proguard/classfile/editor/ParameterInfoAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/StackSizeUpdater.java b/src/proguard/classfile/editor/StackSizeUpdater.java
index d49e53c..44f39d9 100644
--- a/src/proguard/classfile/editor/StackSizeUpdater.java
+++ b/src/proguard/classfile/editor/StackSizeUpdater.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/SubclassAdder.java b/src/proguard/classfile/editor/SubclassAdder.java
index d7f179a..fd92f80 100644
--- a/src/proguard/classfile/editor/SubclassAdder.java
+++ b/src/proguard/classfile/editor/SubclassAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/SubclassToAdder.java b/src/proguard/classfile/editor/SubclassToAdder.java
index dc6de07..1d7025f 100644
--- a/src/proguard/classfile/editor/SubclassToAdder.java
+++ b/src/proguard/classfile/editor/SubclassToAdder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/Utf8Shrinker.java b/src/proguard/classfile/editor/Utf8Shrinker.java
index 6bf6a9d..57ceb8b 100644
--- a/src/proguard/classfile/editor/Utf8Shrinker.java
+++ b/src/proguard/classfile/editor/Utf8Shrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -450,11 +450,10 @@ implements ClassVisitor,
// Shift the used constant pool entries together.
for (int index = 1; index < length; index++)
{
- constantIndexMap[index] = counter;
-
Constant constant = constantPool[index];
- // Don't update the flag if this is the second half of a long entry.
+ // Is the constant being used? Don't update the flag if this is the
+ // second half of a long entry.
if (constant != null)
{
isUsed = constant.getTag() != ClassConstants.CONSTANT_Utf8 ||
@@ -463,8 +462,17 @@ implements ClassVisitor,
if (isUsed)
{
+ // Remember the new index.
+ constantIndexMap[index] = counter;
+
+ // Shift the constant pool entry.
constantPool[counter++] = constant;
}
+ else
+ {
+ // Remember an invalid index.
+ constantIndexMap[index] = -1;
+ }
}
// Clear the remaining constant pool elements.
diff --git a/src/proguard/classfile/editor/VariableCleaner.java b/src/proguard/classfile/editor/VariableCleaner.java
index be67e05..5fd26c6 100644
--- a/src/proguard/classfile/editor/VariableCleaner.java
+++ b/src/proguard/classfile/editor/VariableCleaner.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/VariableEditor.java b/src/proguard/classfile/editor/VariableEditor.java
index 2fd5471..758b8df 100644
--- a/src/proguard/classfile/editor/VariableEditor.java
+++ b/src/proguard/classfile/editor/VariableEditor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/VariableRemapper.java b/src/proguard/classfile/editor/VariableRemapper.java
index 1ca1cb5..52939d5 100644
--- a/src/proguard/classfile/editor/VariableRemapper.java
+++ b/src/proguard/classfile/editor/VariableRemapper.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/editor/VariableSizeUpdater.java b/src/proguard/classfile/editor/VariableSizeUpdater.java
index f364f92..32c4b50 100644
--- a/src/proguard/classfile/editor/VariableSizeUpdater.java
+++ b/src/proguard/classfile/editor/VariableSizeUpdater.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/BranchInstruction.java b/src/proguard/classfile/instruction/BranchInstruction.java
index 8099186..d66539c 100644
--- a/src/proguard/classfile/instruction/BranchInstruction.java
+++ b/src/proguard/classfile/instruction/BranchInstruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -94,8 +94,9 @@ public class BranchInstruction extends Instruction
}
else
{
- // Should we replace the ordinary branch by a wide branch?
- if (opcode == InstructionConstants.OP_GOTO)
+ // Can we provide a wide branch?
+ if (opcode == InstructionConstants.OP_GOTO ||
+ opcode == InstructionConstants.OP_GOTO_W)
{
opcode = InstructionConstants.OP_GOTO_W;
}
diff --git a/src/proguard/classfile/instruction/ConstantInstruction.java b/src/proguard/classfile/instruction/ConstantInstruction.java
index 42db94f..f8b0f61 100644
--- a/src/proguard/classfile/instruction/ConstantInstruction.java
+++ b/src/proguard/classfile/instruction/ConstantInstruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/Instruction.java b/src/proguard/classfile/instruction/Instruction.java
index ecdc05c..60fa5c3 100644
--- a/src/proguard/classfile/instruction/Instruction.java
+++ b/src/proguard/classfile/instruction/Instruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/InstructionConstants.java b/src/proguard/classfile/instruction/InstructionConstants.java
index 0cc1928..5816a58 100644
--- a/src/proguard/classfile/instruction/InstructionConstants.java
+++ b/src/proguard/classfile/instruction/InstructionConstants.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/InstructionFactory.java b/src/proguard/classfile/instruction/InstructionFactory.java
index 6e08141..cc01797 100644
--- a/src/proguard/classfile/instruction/InstructionFactory.java
+++ b/src/proguard/classfile/instruction/InstructionFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/InstructionUtil.java b/src/proguard/classfile/instruction/InstructionUtil.java
index f7d8888..bb0b207 100644
--- a/src/proguard/classfile/instruction/InstructionUtil.java
+++ b/src/proguard/classfile/instruction/InstructionUtil.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/LookUpSwitchInstruction.java b/src/proguard/classfile/instruction/LookUpSwitchInstruction.java
index fa18f3d..9710370 100644
--- a/src/proguard/classfile/instruction/LookUpSwitchInstruction.java
+++ b/src/proguard/classfile/instruction/LookUpSwitchInstruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/SimpleInstruction.java b/src/proguard/classfile/instruction/SimpleInstruction.java
index aecb56c..489ffec 100644
--- a/src/proguard/classfile/instruction/SimpleInstruction.java
+++ b/src/proguard/classfile/instruction/SimpleInstruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/SwitchInstruction.java b/src/proguard/classfile/instruction/SwitchInstruction.java
index c4a0f9a..a629ee3 100644
--- a/src/proguard/classfile/instruction/SwitchInstruction.java
+++ b/src/proguard/classfile/instruction/SwitchInstruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/TableSwitchInstruction.java b/src/proguard/classfile/instruction/TableSwitchInstruction.java
index 6abff8f..9e8123b 100644
--- a/src/proguard/classfile/instruction/TableSwitchInstruction.java
+++ b/src/proguard/classfile/instruction/TableSwitchInstruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/VariableInstruction.java b/src/proguard/classfile/instruction/VariableInstruction.java
index 1574240..43eb88f 100644
--- a/src/proguard/classfile/instruction/VariableInstruction.java
+++ b/src/proguard/classfile/instruction/VariableInstruction.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/visitor/AllInstructionVisitor.java b/src/proguard/classfile/instruction/visitor/AllInstructionVisitor.java
index 5b606cd..26b19ea 100644
--- a/src/proguard/classfile/instruction/visitor/AllInstructionVisitor.java
+++ b/src/proguard/classfile/instruction/visitor/AllInstructionVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/visitor/InstructionConstantVisitor.java b/src/proguard/classfile/instruction/visitor/InstructionConstantVisitor.java
index bdc0ac5..f962bb8 100644
--- a/src/proguard/classfile/instruction/visitor/InstructionConstantVisitor.java
+++ b/src/proguard/classfile/instruction/visitor/InstructionConstantVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/visitor/InstructionCounter.java b/src/proguard/classfile/instruction/visitor/InstructionCounter.java
index 6d2609d..8c5dc1c 100644
--- a/src/proguard/classfile/instruction/visitor/InstructionCounter.java
+++ b/src/proguard/classfile/instruction/visitor/InstructionCounter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/visitor/InstructionVisitor.java b/src/proguard/classfile/instruction/visitor/InstructionVisitor.java
index a200f9f..8955e0b 100644
--- a/src/proguard/classfile/instruction/visitor/InstructionVisitor.java
+++ b/src/proguard/classfile/instruction/visitor/InstructionVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/instruction/visitor/MultiInstructionVisitor.java b/src/proguard/classfile/instruction/visitor/MultiInstructionVisitor.java
index 7d2eb0b..15b9dc6 100644
--- a/src/proguard/classfile/instruction/visitor/MultiInstructionVisitor.java
+++ b/src/proguard/classfile/instruction/visitor/MultiInstructionVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/io/LibraryClassReader.java b/src/proguard/classfile/io/LibraryClassReader.java
index a9a4e8e..c2a1601 100644
--- a/src/proguard/classfile/io/LibraryClassReader.java
+++ b/src/proguard/classfile/io/LibraryClassReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/io/ProgramClassReader.java b/src/proguard/classfile/io/ProgramClassReader.java
index d6a8c36..1713423 100644
--- a/src/proguard/classfile/io/ProgramClassReader.java
+++ b/src/proguard/classfile/io/ProgramClassReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/io/ProgramClassWriter.java b/src/proguard/classfile/io/ProgramClassWriter.java
index bcc3403..f1c1ea0 100644
--- a/src/proguard/classfile/io/ProgramClassWriter.java
+++ b/src/proguard/classfile/io/ProgramClassWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/io/RuntimeDataInput.java b/src/proguard/classfile/io/RuntimeDataInput.java
index 905d828..c09141e 100644
--- a/src/proguard/classfile/io/RuntimeDataInput.java
+++ b/src/proguard/classfile/io/RuntimeDataInput.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/io/RuntimeDataOutput.java b/src/proguard/classfile/io/RuntimeDataOutput.java
index 9d89332..3607294 100644
--- a/src/proguard/classfile/io/RuntimeDataOutput.java
+++ b/src/proguard/classfile/io/RuntimeDataOutput.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/package.html b/src/proguard/classfile/package.html
index fad087c..9a68094 100644
--- a/src/proguard/classfile/package.html
+++ b/src/proguard/classfile/package.html
@@ -1,15 +1,15 @@
<body>
This package contains classes to represent the various elements of class files.
<p>
-A class file is represented by the <code>{@link proguard.classfile.ClassFile
-ClassFile}</code> interface. This interface currently has two alternative
+A class file is represented by the <code>{@link proguard.classfile.Clazz
+Clazz}</code> interface. This interface currently has two alternative
representations:
<ul>
-<li><code>{@link ProgramClassFile ProgramClassFile}</code>:
+<li><code>{@link ProgramClass ProgramClass}</code>:
a complete representation that can be read, modified, and written back.
-<li><code>{@link LibraryClassFile LibraryClassFile}</code>:
+<li><code>{@link LibraryClass LibraryClass}</code>:
an incomplete representation that can be only be read. It is however
- more compact than <code>ProgramClassFile</code>, and sufficient for
+ more compact than <code>ProgramClass</code>, and sufficient for
analyzing class files from library jars.
</ul>
</body>
diff --git a/src/proguard/classfile/util/AccessUtil.java b/src/proguard/classfile/util/AccessUtil.java
index 97fda89..c344e97 100644
--- a/src/proguard/classfile/util/AccessUtil.java
+++ b/src/proguard/classfile/util/AccessUtil.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -88,8 +88,8 @@ public class AccessUtil
/**
* Replaces the access part of the given access flags.
- * @param accessFlags the internal access flags.
- * @param accessFlags the new internal access flags.
+ * @param accessFlags the internal access flags.
+ * @param newAccessFlags the new internal access flags.
*/
public static int replaceAccessFlags(int accessFlags, int newAccessFlags)
{
diff --git a/src/proguard/classfile/util/AllParameterVisitor.java b/src/proguard/classfile/util/AllParameterVisitor.java
index 3695dbb..66c2a2d 100644
--- a/src/proguard/classfile/util/AllParameterVisitor.java
+++ b/src/proguard/classfile/util/AllParameterVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/ClassReferenceInitializer.java b/src/proguard/classfile/util/ClassReferenceInitializer.java
index 3baf422..f0f15b1 100644
--- a/src/proguard/classfile/util/ClassReferenceInitializer.java
+++ b/src/proguard/classfile/util/ClassReferenceInitializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/ClassSubHierarchyInitializer.java b/src/proguard/classfile/util/ClassSubHierarchyInitializer.java
index 8a0e45e..fa76769 100644
--- a/src/proguard/classfile/util/ClassSubHierarchyInitializer.java
+++ b/src/proguard/classfile/util/ClassSubHierarchyInitializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/ClassSuperHierarchyInitializer.java b/src/proguard/classfile/util/ClassSuperHierarchyInitializer.java
index 1e765cb..05b3d07 100644
--- a/src/proguard/classfile/util/ClassSuperHierarchyInitializer.java
+++ b/src/proguard/classfile/util/ClassSuperHierarchyInitializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/ClassUtil.java b/src/proguard/classfile/util/ClassUtil.java
index 037d31a..f076975 100644
--- a/src/proguard/classfile/util/ClassUtil.java
+++ b/src/proguard/classfile/util/ClassUtil.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/DescriptorClassEnumeration.java b/src/proguard/classfile/util/DescriptorClassEnumeration.java
index b15d470..d94a015 100644
--- a/src/proguard/classfile/util/DescriptorClassEnumeration.java
+++ b/src/proguard/classfile/util/DescriptorClassEnumeration.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/DynamicClassReferenceInitializer.java b/src/proguard/classfile/util/DynamicClassReferenceInitializer.java
index 413d885..4c8f6b5 100644
--- a/src/proguard/classfile/util/DynamicClassReferenceInitializer.java
+++ b/src/proguard/classfile/util/DynamicClassReferenceInitializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/DynamicMemberReferenceInitializer.java b/src/proguard/classfile/util/DynamicMemberReferenceInitializer.java
index e35063c..a8a7063 100644
--- a/src/proguard/classfile/util/DynamicMemberReferenceInitializer.java
+++ b/src/proguard/classfile/util/DynamicMemberReferenceInitializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/EnumFieldReferenceInitializer.java b/src/proguard/classfile/util/EnumFieldReferenceInitializer.java
index c856893..61ec836 100644
--- a/src/proguard/classfile/util/EnumFieldReferenceInitializer.java
+++ b/src/proguard/classfile/util/EnumFieldReferenceInitializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/ExternalTypeEnumeration.java b/src/proguard/classfile/util/ExternalTypeEnumeration.java
index b96a80e..22d6feb 100644
--- a/src/proguard/classfile/util/ExternalTypeEnumeration.java
+++ b/src/proguard/classfile/util/ExternalTypeEnumeration.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/InstructionSequenceMatcher.java b/src/proguard/classfile/util/InstructionSequenceMatcher.java
index dc021ee..19aad0c 100644
--- a/src/proguard/classfile/util/InstructionSequenceMatcher.java
+++ b/src/proguard/classfile/util/InstructionSequenceMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/InternalTypeEnumeration.java b/src/proguard/classfile/util/InternalTypeEnumeration.java
index 53538d1..52d6793 100644
--- a/src/proguard/classfile/util/InternalTypeEnumeration.java
+++ b/src/proguard/classfile/util/InternalTypeEnumeration.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -25,17 +25,21 @@ import proguard.classfile.ClassConstants;
/**
* An <code>InternalTypeEnumeration</code> provides an enumeration of all
- * parameter types listed in a given internal method descriptor or signature.
- * The signature can also be a class signature. The return type of a method
- * descriptor can be retrieved separately.
+ * types listed in a given internal descriptor or signature of a class, a
+ * method, or a field.
+ *
+ * The leading formal type parameters, if any, can be retrieved separately.
+ *
+ * The return type of a method descriptor can also be retrieved separately.
*
* @author Eric Lafortune
*/
public class InternalTypeEnumeration
{
private String descriptor;
- private int firstIndex;
- private int lastIndex;
+ private int formalTypeParametersIndex;
+ private int openIndex;
+ private int closeIndex;
private int index;
@@ -45,33 +49,70 @@ public class InternalTypeEnumeration
public InternalTypeEnumeration(String descriptor)
{
this.descriptor = descriptor;
- this.firstIndex = descriptor.indexOf(ClassConstants.METHOD_ARGUMENTS_OPEN);
- this.lastIndex = descriptor.indexOf(ClassConstants.METHOD_ARGUMENTS_CLOSE);
- this.index = firstIndex + 1;
- if (lastIndex < 0)
+ // Find any formal type parameters.
+ if (descriptor.charAt(0) == ClassConstants.TYPE_GENERIC_START)
{
- lastIndex = descriptor.length();
+ formalTypeParametersIndex = 1;
+
+ int nestingLevel = 1;
+ do
+ {
+ char c = descriptor.charAt(formalTypeParametersIndex++);
+ switch (c)
+ {
+ case ClassConstants.TYPE_GENERIC_START:
+ {
+ nestingLevel++;
+ break;
+ }
+ case ClassConstants.TYPE_GENERIC_END:
+ {
+ nestingLevel--;
+ break;
+ }
+ }
+ }
+ while (nestingLevel > 0);
}
+
+ this.openIndex = descriptor.indexOf(ClassConstants.METHOD_ARGUMENTS_OPEN,
+ formalTypeParametersIndex);
+
+ this.closeIndex = openIndex >= 0 ?
+ descriptor.indexOf(ClassConstants.METHOD_ARGUMENTS_CLOSE, openIndex) :
+ descriptor.length();
+
+ this.index = openIndex >= 0 ?
+ openIndex + 1 :
+ formalTypeParametersIndex;
}
/**
- * Returns whether the type is a method signature.
+ * Returns whether the descriptor has leading formal type parameters.
*/
- public boolean isMethodSignature()
+ public boolean hasFormalTypeParameters()
{
- return firstIndex >= 0;
+ return formalTypeParametersIndex > 0;
}
/**
- * Returns the formal type parameters from the descriptor, assuming it's a
- * method descriptor.
+ * Returns the leading formal type parameters from the descriptor.
*/
public String formalTypeParameters()
{
- return descriptor.substring(0, firstIndex);
+ return descriptor.substring(0, formalTypeParametersIndex);
+ }
+
+
+ /**
+ * Returns whether the descriptor is a method signature.
+ */
+ public boolean isMethodSignature()
+ {
+ return openIndex >= 0;
}
@@ -81,7 +122,7 @@ public class InternalTypeEnumeration
*/
public boolean hasMoreTypes()
{
- return index < lastIndex;
+ return index < closeIndex;
}
@@ -120,7 +161,7 @@ public class InternalTypeEnumeration
*/
public String returnType()
{
- return descriptor.substring(lastIndex + 1);
+ return descriptor.substring(closeIndex + 1);
}
@@ -189,7 +230,7 @@ public class InternalTypeEnumeration
System.out.println("Descriptor ["+descriptor+"]");
InternalTypeEnumeration enumeration = new InternalTypeEnumeration(descriptor);
- if (enumeration.firstIndex >= 0)
+ if (enumeration.hasFormalTypeParameters())
{
System.out.println(" Formal type parameters ["+enumeration.formalTypeParameters()+"]");
}
@@ -199,7 +240,7 @@ public class InternalTypeEnumeration
System.out.println(" Type ["+enumeration.nextType()+"]");
}
- if (enumeration.lastIndex < descriptor.length())
+ if (enumeration.isMethodSignature())
{
System.out.println(" Return type ["+enumeration.returnType()+"]");
}
diff --git a/src/proguard/classfile/util/MemberFinder.java b/src/proguard/classfile/util/MemberFinder.java
index dc2724e..7df76ed 100644
--- a/src/proguard/classfile/util/MemberFinder.java
+++ b/src/proguard/classfile/util/MemberFinder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/MethodLinker.java b/src/proguard/classfile/util/MethodLinker.java
index 4b4afa2..23376f3 100644
--- a/src/proguard/classfile/util/MethodLinker.java
+++ b/src/proguard/classfile/util/MethodLinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/SimplifiedVisitor.java b/src/proguard/classfile/util/SimplifiedVisitor.java
index e662061..2a282aa 100644
--- a/src/proguard/classfile/util/SimplifiedVisitor.java
+++ b/src/proguard/classfile/util/SimplifiedVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/StringReferenceInitializer.java b/src/proguard/classfile/util/StringReferenceInitializer.java
index 4d96aa4..56bd320 100644
--- a/src/proguard/classfile/util/StringReferenceInitializer.java
+++ b/src/proguard/classfile/util/StringReferenceInitializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/StringSharer.java b/src/proguard/classfile/util/StringSharer.java
index 5ef231e..39cc1e9 100644
--- a/src/proguard/classfile/util/StringSharer.java
+++ b/src/proguard/classfile/util/StringSharer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/util/WarningPrinter.java b/src/proguard/classfile/util/WarningPrinter.java
index 4f5c477..ea8e711 100644
--- a/src/proguard/classfile/util/WarningPrinter.java
+++ b/src/proguard/classfile/util/WarningPrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/AllClassVisitor.java b/src/proguard/classfile/visitor/AllClassVisitor.java
index 20c6349..587ec00 100644
--- a/src/proguard/classfile/visitor/AllClassVisitor.java
+++ b/src/proguard/classfile/visitor/AllClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/AllFieldVisitor.java b/src/proguard/classfile/visitor/AllFieldVisitor.java
index 1860202..084ab05 100644
--- a/src/proguard/classfile/visitor/AllFieldVisitor.java
+++ b/src/proguard/classfile/visitor/AllFieldVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/AllMemberVisitor.java b/src/proguard/classfile/visitor/AllMemberVisitor.java
index c73df62..cd0f90c 100644
--- a/src/proguard/classfile/visitor/AllMemberVisitor.java
+++ b/src/proguard/classfile/visitor/AllMemberVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/AllMethodVisitor.java b/src/proguard/classfile/visitor/AllMethodVisitor.java
index a5d97e7..f84f726 100644
--- a/src/proguard/classfile/visitor/AllMethodVisitor.java
+++ b/src/proguard/classfile/visitor/AllMethodVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/BottomClassFilter.java b/src/proguard/classfile/visitor/BottomClassFilter.java
index cf3244e..4a51004 100644
--- a/src/proguard/classfile/visitor/BottomClassFilter.java
+++ b/src/proguard/classfile/visitor/BottomClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassAccessFilter.java b/src/proguard/classfile/visitor/ClassAccessFilter.java
index 09af6d9..b49da1f 100644
--- a/src/proguard/classfile/visitor/ClassAccessFilter.java
+++ b/src/proguard/classfile/visitor/ClassAccessFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassCleaner.java b/src/proguard/classfile/visitor/ClassCleaner.java
index a3ada91..4772c66 100644
--- a/src/proguard/classfile/visitor/ClassCleaner.java
+++ b/src/proguard/classfile/visitor/ClassCleaner.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -48,6 +48,9 @@ implements ClassVisitor,
InnerClassesInfoVisitor,
StackMapFrameVisitor,
VerificationTypeVisitor,
+ ParameterInfoVisitor,
+ LocalVariableInfoVisitor,
+ LocalVariableTypeInfoVisitor,
AnnotationVisitor,
TypeAnnotationVisitor,
ElementValueVisitor
@@ -124,6 +127,14 @@ implements ClassVisitor,
}
+ public void visitMethodParametersAttribute(Clazz clazz, Method method, MethodParametersAttribute methodParametersAttribute)
+ {
+ clean(methodParametersAttribute);
+
+ methodParametersAttribute.parametersAccept(clazz, method, this);
+ }
+
+
public void visitExceptionsAttribute(Clazz clazz, Method method, ExceptionsAttribute exceptionsAttribute)
{
clean(exceptionsAttribute);
@@ -157,6 +168,22 @@ implements ClassVisitor,
}
+ public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)
+ {
+ clean(localVariableTableAttribute);
+
+ localVariableTableAttribute.localVariablesAccept(clazz, method, codeAttribute, this);
+ }
+
+
+ public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
+ {
+ clean(localVariableTypeTableAttribute);
+
+ localVariableTypeTableAttribute.localVariablesAccept(clazz, method, codeAttribute, this);
+ }
+
+
public void visitAnyAnnotationsAttribute(Clazz clazz, AnnotationsAttribute annotationsAttribute)
{
clean(annotationsAttribute);
@@ -260,6 +287,30 @@ implements ClassVisitor,
}
+ // Implementations for ParameterInfoVisitor.
+
+ public void visitParameterInfo(Clazz clazz, Method method, int parameterIndex, ParameterInfo parameterInfo)
+ {
+ clean(parameterInfo);
+ }
+
+
+ // Implementations for LocalVariableInfoVisitor.
+
+ public void visitLocalVariableInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableInfo localVariableInfo)
+ {
+ clean(localVariableInfo);
+ }
+
+
+ // Implementations for LocalVariableTypeInfoVisitor.
+
+ public void visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo)
+ {
+ clean(localVariableTypeInfo);
+ }
+
+
// Implementations for AnnotationVisitor.
public void visitAnnotation(Clazz clazz, Annotation annotation)
diff --git a/src/proguard/classfile/visitor/ClassCollector.java b/src/proguard/classfile/visitor/ClassCollector.java
index 05bb23b..20ef542 100644
--- a/src/proguard/classfile/visitor/ClassCollector.java
+++ b/src/proguard/classfile/visitor/ClassCollector.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassCounter.java b/src/proguard/classfile/visitor/ClassCounter.java
index 835f0bd..e890662 100644
--- a/src/proguard/classfile/visitor/ClassCounter.java
+++ b/src/proguard/classfile/visitor/ClassCounter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassHierarchyTraveler.java b/src/proguard/classfile/visitor/ClassHierarchyTraveler.java
index d459719..ab394ad 100644
--- a/src/proguard/classfile/visitor/ClassHierarchyTraveler.java
+++ b/src/proguard/classfile/visitor/ClassHierarchyTraveler.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassNameFilter.java b/src/proguard/classfile/visitor/ClassNameFilter.java
index 3415faa..b93cf0c 100644
--- a/src/proguard/classfile/visitor/ClassNameFilter.java
+++ b/src/proguard/classfile/visitor/ClassNameFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassPoolFiller.java b/src/proguard/classfile/visitor/ClassPoolFiller.java
index bd66a7d..79878f6 100644
--- a/src/proguard/classfile/visitor/ClassPoolFiller.java
+++ b/src/proguard/classfile/visitor/ClassPoolFiller.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassPoolVisitor.java b/src/proguard/classfile/visitor/ClassPoolVisitor.java
index a91a69d..a76b020 100644
--- a/src/proguard/classfile/visitor/ClassPoolVisitor.java
+++ b/src/proguard/classfile/visitor/ClassPoolVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassPresenceFilter.java b/src/proguard/classfile/visitor/ClassPresenceFilter.java
index 42df828..79c38d0 100644
--- a/src/proguard/classfile/visitor/ClassPresenceFilter.java
+++ b/src/proguard/classfile/visitor/ClassPresenceFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassPrinter.java b/src/proguard/classfile/visitor/ClassPrinter.java
index 9af8f75..ea03b74 100644
--- a/src/proguard/classfile/visitor/ClassPrinter.java
+++ b/src/proguard/classfile/visitor/ClassPrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -906,7 +906,8 @@ implements ClassVisitor,
public void visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
{
println("[" + lineNumberInfo.u2startPC + "] -> line " +
- lineNumberInfo.u2lineNumber);
+ lineNumberInfo.u2lineNumber +
+ (lineNumberInfo.getSource() == null ? "" : " [" + lineNumberInfo.getSource() + "]"));
}
diff --git a/src/proguard/classfile/visitor/ClassVersionFilter.java b/src/proguard/classfile/visitor/ClassVersionFilter.java
index 0b80b10..8e3350c 100644
--- a/src/proguard/classfile/visitor/ClassVersionFilter.java
+++ b/src/proguard/classfile/visitor/ClassVersionFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassVersionSetter.java b/src/proguard/classfile/visitor/ClassVersionSetter.java
index 3caf045..3af4448 100644
--- a/src/proguard/classfile/visitor/ClassVersionSetter.java
+++ b/src/proguard/classfile/visitor/ClassVersionSetter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ClassVisitor.java b/src/proguard/classfile/visitor/ClassVisitor.java
index 979b822..14d1457 100644
--- a/src/proguard/classfile/visitor/ClassVisitor.java
+++ b/src/proguard/classfile/visitor/ClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ConcreteClassDownTraveler.java b/src/proguard/classfile/visitor/ConcreteClassDownTraveler.java
index d82a674..9dcf09f 100644
--- a/src/proguard/classfile/visitor/ConcreteClassDownTraveler.java
+++ b/src/proguard/classfile/visitor/ConcreteClassDownTraveler.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/DotClassClassVisitor.java b/src/proguard/classfile/visitor/DotClassClassVisitor.java
index 5960ef6..367428b 100644
--- a/src/proguard/classfile/visitor/DotClassClassVisitor.java
+++ b/src/proguard/classfile/visitor/DotClassClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/DynamicReturnedClassVisitor.java b/src/proguard/classfile/visitor/DynamicReturnedClassVisitor.java
index f9ac3cb..16501c0 100644
--- a/src/proguard/classfile/visitor/DynamicReturnedClassVisitor.java
+++ b/src/proguard/classfile/visitor/DynamicReturnedClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptClassFilter.java b/src/proguard/classfile/visitor/ExceptClassFilter.java
index b216ba7..cd4fc84 100644
--- a/src/proguard/classfile/visitor/ExceptClassFilter.java
+++ b/src/proguard/classfile/visitor/ExceptClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptClassesFilter.java b/src/proguard/classfile/visitor/ExceptClassesFilter.java
index acc758c..bd6a1e0 100644
--- a/src/proguard/classfile/visitor/ExceptClassesFilter.java
+++ b/src/proguard/classfile/visitor/ExceptClassesFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptionCounter.java b/src/proguard/classfile/visitor/ExceptionCounter.java
index a3071a6..4a00e24 100644
--- a/src/proguard/classfile/visitor/ExceptionCounter.java
+++ b/src/proguard/classfile/visitor/ExceptionCounter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptionExcludedOffsetFilter.java b/src/proguard/classfile/visitor/ExceptionExcludedOffsetFilter.java
index c7b05db..1026a77 100644
--- a/src/proguard/classfile/visitor/ExceptionExcludedOffsetFilter.java
+++ b/src/proguard/classfile/visitor/ExceptionExcludedOffsetFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptionHandlerConstantVisitor.java b/src/proguard/classfile/visitor/ExceptionHandlerConstantVisitor.java
index 3a08892..79820fd 100644
--- a/src/proguard/classfile/visitor/ExceptionHandlerConstantVisitor.java
+++ b/src/proguard/classfile/visitor/ExceptionHandlerConstantVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptionHandlerFilter.java b/src/proguard/classfile/visitor/ExceptionHandlerFilter.java
index 25df0ac..431dd4e 100644
--- a/src/proguard/classfile/visitor/ExceptionHandlerFilter.java
+++ b/src/proguard/classfile/visitor/ExceptionHandlerFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptionOffsetFilter.java b/src/proguard/classfile/visitor/ExceptionOffsetFilter.java
index babee27..3876fcc 100644
--- a/src/proguard/classfile/visitor/ExceptionOffsetFilter.java
+++ b/src/proguard/classfile/visitor/ExceptionOffsetFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ExceptionRangeFilter.java b/src/proguard/classfile/visitor/ExceptionRangeFilter.java
index 9ce10ef..9a98a8f 100644
--- a/src/proguard/classfile/visitor/ExceptionRangeFilter.java
+++ b/src/proguard/classfile/visitor/ExceptionRangeFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ImplementedClassConstantFilter.java b/src/proguard/classfile/visitor/ImplementedClassConstantFilter.java
index ac05841..c13c62b 100644
--- a/src/proguard/classfile/visitor/ImplementedClassConstantFilter.java
+++ b/src/proguard/classfile/visitor/ImplementedClassConstantFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ImplementedClassFilter.java b/src/proguard/classfile/visitor/ImplementedClassFilter.java
index accbb6a..5452361 100644
--- a/src/proguard/classfile/visitor/ImplementedClassFilter.java
+++ b/src/proguard/classfile/visitor/ImplementedClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ImplementingClassConstantFilter.java b/src/proguard/classfile/visitor/ImplementingClassConstantFilter.java
index ee42fe2..e994101 100644
--- a/src/proguard/classfile/visitor/ImplementingClassConstantFilter.java
+++ b/src/proguard/classfile/visitor/ImplementingClassConstantFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/SideEffectMethodFilter.java b/src/proguard/classfile/visitor/InitializerMethodFilter.java
similarity index 69%
copy from src/proguard/optimize/info/SideEffectMethodFilter.java
copy to src/proguard/classfile/visitor/InitializerMethodFilter.java
index 3821870..47023aa 100644
--- a/src/proguard/optimize/info/SideEffectMethodFilter.java
+++ b/src/proguard/classfile/visitor/InitializerMethodFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -18,31 +18,30 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-package proguard.optimize.info;
+package proguard.classfile.visitor;
import proguard.classfile.*;
-import proguard.classfile.visitor.MemberVisitor;
+import proguard.classfile.util.ClassUtil;
/**
- * This MemberVisitor delegates all its method calls to another MemberVisitor,
- * but only for Method objects that are marked as having side effects.
- *
- * @see SideEffectMethodMarker
+ * This <code>MemberVisitor</code> delegates its visits to another given
+ * <code>MemberVisitor</code>, but only to static initializers and instance
+ * initializers.
*
* @author Eric Lafortune
*/
-public class SideEffectMethodFilter
+public class InitializerMethodFilter
implements MemberVisitor
{
private final MemberVisitor memberVisitor;
/**
- * Creates a new SideEffectMethodFilter.
- * @param memberVisitor the member visitor to which the visiting will be
- * delegated.
+ * Creates a new InitializerMethodFilter.
+ * @param memberVisitor the <code>MemberVisitor</code> to which visits
+ * will be delegated.
*/
- public SideEffectMethodFilter(MemberVisitor memberVisitor)
+ public InitializerMethodFilter(MemberVisitor memberVisitor)
{
this.memberVisitor = memberVisitor;
}
@@ -56,7 +55,7 @@ implements MemberVisitor
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
- if (SideEffectMethodMarker.hasSideEffects(programMethod))
+ if (ClassUtil.isInitializer(programMethod.getName(programClass)))
{
memberVisitor.visitProgramMethod(programClass, programMethod);
}
@@ -65,9 +64,9 @@ implements MemberVisitor
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod)
{
- if (SideEffectMethodMarker.hasSideEffects(libraryMethod))
+ if (ClassUtil.isInitializer(libraryMethod.getName(libraryClass)))
{
memberVisitor.visitLibraryMethod(libraryClass, libraryMethod);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/proguard/classfile/visitor/LibraryClassFilter.java b/src/proguard/classfile/visitor/LibraryClassFilter.java
index 894c029..b40ecab 100644
--- a/src/proguard/classfile/visitor/LibraryClassFilter.java
+++ b/src/proguard/classfile/visitor/LibraryClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/LibraryMemberFilter.java b/src/proguard/classfile/visitor/LibraryMemberFilter.java
index c58798c..444f5f1 100644
--- a/src/proguard/classfile/visitor/LibraryMemberFilter.java
+++ b/src/proguard/classfile/visitor/LibraryMemberFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberAccessFilter.java b/src/proguard/classfile/visitor/MemberAccessFilter.java
index 4041e77..87f3e12 100644
--- a/src/proguard/classfile/visitor/MemberAccessFilter.java
+++ b/src/proguard/classfile/visitor/MemberAccessFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberClassAccessFilter.java b/src/proguard/classfile/visitor/MemberClassAccessFilter.java
index 40418f4..b6989a4 100644
--- a/src/proguard/classfile/visitor/MemberClassAccessFilter.java
+++ b/src/proguard/classfile/visitor/MemberClassAccessFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberCollector.java b/src/proguard/classfile/visitor/MemberCollector.java
index d1a3d2e..5cc0670 100644
--- a/src/proguard/classfile/visitor/MemberCollector.java
+++ b/src/proguard/classfile/visitor/MemberCollector.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberCounter.java b/src/proguard/classfile/visitor/MemberCounter.java
index 55df638..9105aac 100644
--- a/src/proguard/classfile/visitor/MemberCounter.java
+++ b/src/proguard/classfile/visitor/MemberCounter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberDescriptorFilter.java b/src/proguard/classfile/visitor/MemberDescriptorFilter.java
index 3c0a646..d117077 100644
--- a/src/proguard/classfile/visitor/MemberDescriptorFilter.java
+++ b/src/proguard/classfile/visitor/MemberDescriptorFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberDescriptorReferencedClassVisitor.java b/src/proguard/classfile/visitor/MemberDescriptorReferencedClassVisitor.java
index 9ac1219..97f1285 100644
--- a/src/proguard/classfile/visitor/MemberDescriptorReferencedClassVisitor.java
+++ b/src/proguard/classfile/visitor/MemberDescriptorReferencedClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberNameFilter.java b/src/proguard/classfile/visitor/MemberNameFilter.java
index b40b208..aabb0d1 100644
--- a/src/proguard/classfile/visitor/MemberNameFilter.java
+++ b/src/proguard/classfile/visitor/MemberNameFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberToClassVisitor.java b/src/proguard/classfile/visitor/MemberToClassVisitor.java
index bb4bc03..f191378 100644
--- a/src/proguard/classfile/visitor/MemberToClassVisitor.java
+++ b/src/proguard/classfile/visitor/MemberToClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MemberVisitor.java b/src/proguard/classfile/visitor/MemberVisitor.java
index 51a675c..1b20b58 100644
--- a/src/proguard/classfile/visitor/MemberVisitor.java
+++ b/src/proguard/classfile/visitor/MemberVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MethodImplementationFilter.java b/src/proguard/classfile/visitor/MethodImplementationFilter.java
index be951df..61b397a 100644
--- a/src/proguard/classfile/visitor/MethodImplementationFilter.java
+++ b/src/proguard/classfile/visitor/MethodImplementationFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MethodImplementationTraveler.java b/src/proguard/classfile/visitor/MethodImplementationTraveler.java
index 116b2af..867b976 100644
--- a/src/proguard/classfile/visitor/MethodImplementationTraveler.java
+++ b/src/proguard/classfile/visitor/MethodImplementationTraveler.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MultiClassPoolVisitor.java b/src/proguard/classfile/visitor/MultiClassPoolVisitor.java
index 17a084a..0c1962c 100644
--- a/src/proguard/classfile/visitor/MultiClassPoolVisitor.java
+++ b/src/proguard/classfile/visitor/MultiClassPoolVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MultiClassVisitor.java b/src/proguard/classfile/visitor/MultiClassVisitor.java
index cb79b7d..862dff4 100644
--- a/src/proguard/classfile/visitor/MultiClassVisitor.java
+++ b/src/proguard/classfile/visitor/MultiClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/MultiMemberVisitor.java b/src/proguard/classfile/visitor/MultiMemberVisitor.java
index 67bb53e..e0f4d13 100644
--- a/src/proguard/classfile/visitor/MultiMemberVisitor.java
+++ b/src/proguard/classfile/visitor/MultiMemberVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/NamedClassVisitor.java b/src/proguard/classfile/visitor/NamedClassVisitor.java
index 52a0c5a..ad0069a 100644
--- a/src/proguard/classfile/visitor/NamedClassVisitor.java
+++ b/src/proguard/classfile/visitor/NamedClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/NamedFieldVisitor.java b/src/proguard/classfile/visitor/NamedFieldVisitor.java
index 381c97c..28683f2 100644
--- a/src/proguard/classfile/visitor/NamedFieldVisitor.java
+++ b/src/proguard/classfile/visitor/NamedFieldVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/NamedMethodVisitor.java b/src/proguard/classfile/visitor/NamedMethodVisitor.java
index 397e16d..8dbc792 100644
--- a/src/proguard/classfile/visitor/NamedMethodVisitor.java
+++ b/src/proguard/classfile/visitor/NamedMethodVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ParameterVisitor.java b/src/proguard/classfile/visitor/ParameterVisitor.java
index fc124ae..effced6 100644
--- a/src/proguard/classfile/visitor/ParameterVisitor.java
+++ b/src/proguard/classfile/visitor/ParameterVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ProgramClassFilter.java b/src/proguard/classfile/visitor/ProgramClassFilter.java
index 85f02a2..64a8522 100644
--- a/src/proguard/classfile/visitor/ProgramClassFilter.java
+++ b/src/proguard/classfile/visitor/ProgramClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ProgramMemberFilter.java b/src/proguard/classfile/visitor/ProgramMemberFilter.java
index d3d88f8..0d884c9 100644
--- a/src/proguard/classfile/visitor/ProgramMemberFilter.java
+++ b/src/proguard/classfile/visitor/ProgramMemberFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ReferencedClassVisitor.java b/src/proguard/classfile/visitor/ReferencedClassVisitor.java
index 09449bc..77d88a4 100644
--- a/src/proguard/classfile/visitor/ReferencedClassVisitor.java
+++ b/src/proguard/classfile/visitor/ReferencedClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/ReferencedMemberVisitor.java b/src/proguard/classfile/visitor/ReferencedMemberVisitor.java
index cb77b19..1e3523d 100644
--- a/src/proguard/classfile/visitor/ReferencedMemberVisitor.java
+++ b/src/proguard/classfile/visitor/ReferencedMemberVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/SimilarMemberVisitor.java b/src/proguard/classfile/visitor/SimilarMemberVisitor.java
index 2649a2f..924b261 100644
--- a/src/proguard/classfile/visitor/SimilarMemberVisitor.java
+++ b/src/proguard/classfile/visitor/SimilarMemberVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/SimpleClassPrinter.java b/src/proguard/classfile/visitor/SimpleClassPrinter.java
index 073c635..84359ac 100644
--- a/src/proguard/classfile/visitor/SimpleClassPrinter.java
+++ b/src/proguard/classfile/visitor/SimpleClassPrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/SubclassFilter.java b/src/proguard/classfile/visitor/SubclassFilter.java
index f50e498..c1dbc16 100644
--- a/src/proguard/classfile/visitor/SubclassFilter.java
+++ b/src/proguard/classfile/visitor/SubclassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/SubclassTraveler.java b/src/proguard/classfile/visitor/SubclassTraveler.java
index 8e80913..8b799f9 100644
--- a/src/proguard/classfile/visitor/SubclassTraveler.java
+++ b/src/proguard/classfile/visitor/SubclassTraveler.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/VariableClassVisitor.java b/src/proguard/classfile/visitor/VariableClassVisitor.java
index c8e1ee3..5c595b4 100644
--- a/src/proguard/classfile/visitor/VariableClassVisitor.java
+++ b/src/proguard/classfile/visitor/VariableClassVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/classfile/visitor/VariableMemberVisitor.java b/src/proguard/classfile/visitor/VariableMemberVisitor.java
index fbaedec..e1c0e61 100644
--- a/src/proguard/classfile/visitor/VariableMemberVisitor.java
+++ b/src/proguard/classfile/visitor/VariableMemberVisitor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/BasicBranchUnit.java b/src/proguard/evaluation/BasicBranchUnit.java
index f10e4be..ead727b 100644
--- a/src/proguard/evaluation/BasicBranchUnit.java
+++ b/src/proguard/evaluation/BasicBranchUnit.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/BasicInvocationUnit.java b/src/proguard/evaluation/BasicInvocationUnit.java
index f7cc902..147e74a 100644
--- a/src/proguard/evaluation/BasicInvocationUnit.java
+++ b/src/proguard/evaluation/BasicInvocationUnit.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -105,10 +105,11 @@ implements InvocationUnit,
{
String type = internalTypeEnumeration.nextType();
- Clazz referencedClass = referencedClasses != null &&
- ClassUtil.isInternalClassType(type) ?
- referencedClasses[referencedClassIndex++] :
- null;
+ Clazz referencedClass =
+ referencedClasses != null &&
+ ClassUtil.isInternalClassType(type) ?
+ referencedClasses[referencedClassIndex++] :
+ null;
// Get the parameter value.
Value value = getMethodParameterValue(clazz,
@@ -376,11 +377,14 @@ implements InvocationUnit,
// Try to figure out the class of the return type.
Clazz[] referencedClasses = invokeDynamicConstant.referencedClasses;
- Clazz returnTypeClass = referencedClasses == null ? null :
- referencedClasses[referencedClasses.length - 1];
+ Clazz referencedClass =
+ referencedClasses != null &&
+ ClassUtil.isInternalClassType(type) ?
+ referencedClasses[referencedClasses.length - 1] :
+ null;
return valueFactory.createValue(type,
- returnTypeClass,
+ referencedClass,
true);
}
@@ -396,7 +400,8 @@ implements InvocationUnit,
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
Clazz[] referencedClasses = programMethod.referencedClasses;
- if (referencedClasses != null)
+ if (referencedClasses != null &&
+ ClassUtil.isInternalClassType(programMethod.getDescriptor(programClass)))
{
returnTypeClass = referencedClasses[referencedClasses.length - 1];
}
@@ -409,10 +414,11 @@ implements InvocationUnit,
}
- public void visitLibraryMethod(LibraryClass programClass, LibraryMethod programMethod)
+ public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod)
{
- Clazz[] referencedClasses = programMethod.referencedClasses;
- if (referencedClasses != null)
+ Clazz[] referencedClasses = libraryMethod.referencedClasses;
+ if (referencedClasses != null &&
+ ClassUtil.isInternalClassType(libraryMethod.getDescriptor(libraryClass)))
{
returnTypeClass = referencedClasses[referencedClasses.length - 1];
}
diff --git a/src/proguard/evaluation/BranchUnit.java b/src/proguard/evaluation/BranchUnit.java
index e81b61d..3c5867c 100644
--- a/src/proguard/evaluation/BranchUnit.java
+++ b/src/proguard/evaluation/BranchUnit.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/ClassConstantValueFactory.java b/src/proguard/evaluation/ClassConstantValueFactory.java
index 62cc42c..749cab2 100644
--- a/src/proguard/evaluation/ClassConstantValueFactory.java
+++ b/src/proguard/evaluation/ClassConstantValueFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/ConstantValueFactory.java b/src/proguard/evaluation/ConstantValueFactory.java
index 6875bde..5b3ee45 100644
--- a/src/proguard/evaluation/ConstantValueFactory.java
+++ b/src/proguard/evaluation/ConstantValueFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/InvocationUnit.java b/src/proguard/evaluation/InvocationUnit.java
index 0750894..aac7dec 100644
--- a/src/proguard/evaluation/InvocationUnit.java
+++ b/src/proguard/evaluation/InvocationUnit.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/Processor.java b/src/proguard/evaluation/Processor.java
index d03b853..a602849 100644
--- a/src/proguard/evaluation/Processor.java
+++ b/src/proguard/evaluation/Processor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/Stack.java b/src/proguard/evaluation/Stack.java
index 9294853..b323149 100644
--- a/src/proguard/evaluation/Stack.java
+++ b/src/proguard/evaluation/Stack.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -79,7 +79,7 @@ public class Stack
public void reset(int maxSize)
{
// Is the values array large enough?
- if (maxSize > values.length)
+ if (values.length < maxSize)
{
// Create a new one.
values = new Value[maxSize];
@@ -98,7 +98,7 @@ public class Stack
public void copy(Stack other)
{
// Is the values array large enough?
- if (other.values.length > values.length)
+ if (values.length < other.values.length)
{
// Create a new one.
values = new Value[other.values.length];
diff --git a/src/proguard/evaluation/TracedStack.java b/src/proguard/evaluation/TracedStack.java
index 08e30e9..3c66a60 100644
--- a/src/proguard/evaluation/TracedStack.java
+++ b/src/proguard/evaluation/TracedStack.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/TracedVariables.java b/src/proguard/evaluation/TracedVariables.java
index 23e3041..43e2a03 100644
--- a/src/proguard/evaluation/TracedVariables.java
+++ b/src/proguard/evaluation/TracedVariables.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/Variables.java b/src/proguard/evaluation/Variables.java
index 4b3a2a4..92f865a 100644
--- a/src/proguard/evaluation/Variables.java
+++ b/src/proguard/evaluation/Variables.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -69,15 +69,15 @@ public class Variables
public void reset(int size)
{
// Is the values array large enough?
- if (size > values.length)
+ if (values.length < size)
{
// Create a new one.
values = new Value[size];
}
else
{
- // Clear the variables.
- Arrays.fill(values, null);
+ // Clear the old variables.
+ Arrays.fill(values, 0, this.size, null);
}
this.size = size;
diff --git a/src/proguard/evaluation/value/ArrayReferenceValue.java b/src/proguard/evaluation/value/ArrayReferenceValue.java
index 56f18ad..6a9f03c 100644
--- a/src/proguard/evaluation/value/ArrayReferenceValue.java
+++ b/src/proguard/evaluation/value/ArrayReferenceValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/Category1Value.java b/src/proguard/evaluation/value/Category1Value.java
index 777e3e3..b64c674 100644
--- a/src/proguard/evaluation/value/Category1Value.java
+++ b/src/proguard/evaluation/value/Category1Value.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/Category2Value.java b/src/proguard/evaluation/value/Category2Value.java
index 80c2183..a3c5fdf 100644
--- a/src/proguard/evaluation/value/Category2Value.java
+++ b/src/proguard/evaluation/value/Category2Value.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ComparisonValue.java b/src/proguard/evaluation/value/ComparisonValue.java
index e2cd94e..38f289d 100644
--- a/src/proguard/evaluation/value/ComparisonValue.java
+++ b/src/proguard/evaluation/value/ComparisonValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/CompositeDoubleValue.java b/src/proguard/evaluation/value/CompositeDoubleValue.java
index 85b606a..a22f240 100644
--- a/src/proguard/evaluation/value/CompositeDoubleValue.java
+++ b/src/proguard/evaluation/value/CompositeDoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/CompositeFloatValue.java b/src/proguard/evaluation/value/CompositeFloatValue.java
index 35f160f..30deeba 100644
--- a/src/proguard/evaluation/value/CompositeFloatValue.java
+++ b/src/proguard/evaluation/value/CompositeFloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/CompositeIntegerValue.java b/src/proguard/evaluation/value/CompositeIntegerValue.java
index de56452..458bca8 100644
--- a/src/proguard/evaluation/value/CompositeIntegerValue.java
+++ b/src/proguard/evaluation/value/CompositeIntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/CompositeLongValue.java b/src/proguard/evaluation/value/CompositeLongValue.java
index 70351c8..b4a3dec 100644
--- a/src/proguard/evaluation/value/CompositeLongValue.java
+++ b/src/proguard/evaluation/value/CompositeLongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ConvertedByteValue.java b/src/proguard/evaluation/value/ConvertedByteValue.java
index 6fd96e4..926e94d 100644
--- a/src/proguard/evaluation/value/ConvertedByteValue.java
+++ b/src/proguard/evaluation/value/ConvertedByteValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ConvertedCharacterValue.java b/src/proguard/evaluation/value/ConvertedCharacterValue.java
index 81f0500..637bcdc 100644
--- a/src/proguard/evaluation/value/ConvertedCharacterValue.java
+++ b/src/proguard/evaluation/value/ConvertedCharacterValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ConvertedDoubleValue.java b/src/proguard/evaluation/value/ConvertedDoubleValue.java
index bd20542..b8a7189 100644
--- a/src/proguard/evaluation/value/ConvertedDoubleValue.java
+++ b/src/proguard/evaluation/value/ConvertedDoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ConvertedFloatValue.java b/src/proguard/evaluation/value/ConvertedFloatValue.java
index 83e1eb1..e139cf6 100644
--- a/src/proguard/evaluation/value/ConvertedFloatValue.java
+++ b/src/proguard/evaluation/value/ConvertedFloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ConvertedIntegerValue.java b/src/proguard/evaluation/value/ConvertedIntegerValue.java
index c5d83b5..da7d3ac 100644
--- a/src/proguard/evaluation/value/ConvertedIntegerValue.java
+++ b/src/proguard/evaluation/value/ConvertedIntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ConvertedLongValue.java b/src/proguard/evaluation/value/ConvertedLongValue.java
index 944e8b6..e1395b9 100644
--- a/src/proguard/evaluation/value/ConvertedLongValue.java
+++ b/src/proguard/evaluation/value/ConvertedLongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ConvertedShortValue.java b/src/proguard/evaluation/value/ConvertedShortValue.java
index 7e0472f..9db2488 100644
--- a/src/proguard/evaluation/value/ConvertedShortValue.java
+++ b/src/proguard/evaluation/value/ConvertedShortValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/DetailedArrayReferenceValue.java b/src/proguard/evaluation/value/DetailedArrayReferenceValue.java
index 73ca067..5eca0c9 100644
--- a/src/proguard/evaluation/value/DetailedArrayReferenceValue.java
+++ b/src/proguard/evaluation/value/DetailedArrayReferenceValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/DetailedValueFactory.java b/src/proguard/evaluation/value/DetailedValueFactory.java
index d28b8ab..08ba558 100644
--- a/src/proguard/evaluation/value/DetailedValueFactory.java
+++ b/src/proguard/evaluation/value/DetailedValueFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/DoubleValue.java b/src/proguard/evaluation/value/DoubleValue.java
index 7587ed3..ab2778e 100644
--- a/src/proguard/evaluation/value/DoubleValue.java
+++ b/src/proguard/evaluation/value/DoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/FloatValue.java b/src/proguard/evaluation/value/FloatValue.java
index ce7806e..8631fe1 100644
--- a/src/proguard/evaluation/value/FloatValue.java
+++ b/src/proguard/evaluation/value/FloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IdentifiedArrayReferenceValue.java b/src/proguard/evaluation/value/IdentifiedArrayReferenceValue.java
index 3b597a1..1a95fd3 100644
--- a/src/proguard/evaluation/value/IdentifiedArrayReferenceValue.java
+++ b/src/proguard/evaluation/value/IdentifiedArrayReferenceValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IdentifiedDoubleValue.java b/src/proguard/evaluation/value/IdentifiedDoubleValue.java
index 6740a2c..799cce1 100644
--- a/src/proguard/evaluation/value/IdentifiedDoubleValue.java
+++ b/src/proguard/evaluation/value/IdentifiedDoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IdentifiedFloatValue.java b/src/proguard/evaluation/value/IdentifiedFloatValue.java
index 62e4b2b..c207e10 100644
--- a/src/proguard/evaluation/value/IdentifiedFloatValue.java
+++ b/src/proguard/evaluation/value/IdentifiedFloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IdentifiedIntegerValue.java b/src/proguard/evaluation/value/IdentifiedIntegerValue.java
index ac1d033..c0517ef 100644
--- a/src/proguard/evaluation/value/IdentifiedIntegerValue.java
+++ b/src/proguard/evaluation/value/IdentifiedIntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IdentifiedLongValue.java b/src/proguard/evaluation/value/IdentifiedLongValue.java
index b670ae6..e72fad4 100644
--- a/src/proguard/evaluation/value/IdentifiedLongValue.java
+++ b/src/proguard/evaluation/value/IdentifiedLongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IdentifiedReferenceValue.java b/src/proguard/evaluation/value/IdentifiedReferenceValue.java
index 7f0196b..6fc9e4d 100644
--- a/src/proguard/evaluation/value/IdentifiedReferenceValue.java
+++ b/src/proguard/evaluation/value/IdentifiedReferenceValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IdentifiedValueFactory.java b/src/proguard/evaluation/value/IdentifiedValueFactory.java
index 6bd1d5d..a554082 100644
--- a/src/proguard/evaluation/value/IdentifiedValueFactory.java
+++ b/src/proguard/evaluation/value/IdentifiedValueFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/InitialValueFactory.java b/src/proguard/evaluation/value/InitialValueFactory.java
index 4b2cf29..ae2d0f6 100644
--- a/src/proguard/evaluation/value/InitialValueFactory.java
+++ b/src/proguard/evaluation/value/InitialValueFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/InstructionOffsetValue.java b/src/proguard/evaluation/value/InstructionOffsetValue.java
index 7cb953e..01373bd 100644
--- a/src/proguard/evaluation/value/InstructionOffsetValue.java
+++ b/src/proguard/evaluation/value/InstructionOffsetValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/IntegerValue.java b/src/proguard/evaluation/value/IntegerValue.java
index 148c0ea..23b29f2 100644
--- a/src/proguard/evaluation/value/IntegerValue.java
+++ b/src/proguard/evaluation/value/IntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/LongValue.java b/src/proguard/evaluation/value/LongValue.java
index e8f9e12..1b156d2 100644
--- a/src/proguard/evaluation/value/LongValue.java
+++ b/src/proguard/evaluation/value/LongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/NegatedDoubleValue.java b/src/proguard/evaluation/value/NegatedDoubleValue.java
index 25de608..93dc7b4 100644
--- a/src/proguard/evaluation/value/NegatedDoubleValue.java
+++ b/src/proguard/evaluation/value/NegatedDoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/NegatedFloatValue.java b/src/proguard/evaluation/value/NegatedFloatValue.java
index 7a05579..b163ac6 100644
--- a/src/proguard/evaluation/value/NegatedFloatValue.java
+++ b/src/proguard/evaluation/value/NegatedFloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/NegatedIntegerValue.java b/src/proguard/evaluation/value/NegatedIntegerValue.java
index cbbabdd..6c93e4c 100644
--- a/src/proguard/evaluation/value/NegatedIntegerValue.java
+++ b/src/proguard/evaluation/value/NegatedIntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/NegatedLongValue.java b/src/proguard/evaluation/value/NegatedLongValue.java
index bb9f729..d1bb480 100644
--- a/src/proguard/evaluation/value/NegatedLongValue.java
+++ b/src/proguard/evaluation/value/NegatedLongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ParticularDoubleValue.java b/src/proguard/evaluation/value/ParticularDoubleValue.java
index d97eb5f..f536f53 100644
--- a/src/proguard/evaluation/value/ParticularDoubleValue.java
+++ b/src/proguard/evaluation/value/ParticularDoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ParticularFloatValue.java b/src/proguard/evaluation/value/ParticularFloatValue.java
index 9084b36..1529cff 100644
--- a/src/proguard/evaluation/value/ParticularFloatValue.java
+++ b/src/proguard/evaluation/value/ParticularFloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ParticularIntegerValue.java b/src/proguard/evaluation/value/ParticularIntegerValue.java
index 86f8a22..9049d67 100644
--- a/src/proguard/evaluation/value/ParticularIntegerValue.java
+++ b/src/proguard/evaluation/value/ParticularIntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ParticularLongValue.java b/src/proguard/evaluation/value/ParticularLongValue.java
index 7e7cc20..278dcf4 100644
--- a/src/proguard/evaluation/value/ParticularLongValue.java
+++ b/src/proguard/evaluation/value/ParticularLongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ParticularValueFactory.java b/src/proguard/evaluation/value/ParticularValueFactory.java
index f28c10e..b200bf5 100644
--- a/src/proguard/evaluation/value/ParticularValueFactory.java
+++ b/src/proguard/evaluation/value/ParticularValueFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/ReferenceValue.java b/src/proguard/evaluation/value/ReferenceValue.java
index 1f87382..f2ae6c3 100644
--- a/src/proguard/evaluation/value/ReferenceValue.java
+++ b/src/proguard/evaluation/value/ReferenceValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/SpecificDoubleValue.java b/src/proguard/evaluation/value/SpecificDoubleValue.java
index 5ee2db2..d923065 100644
--- a/src/proguard/evaluation/value/SpecificDoubleValue.java
+++ b/src/proguard/evaluation/value/SpecificDoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/SpecificFloatValue.java b/src/proguard/evaluation/value/SpecificFloatValue.java
index 66e245a..6072dd2 100644
--- a/src/proguard/evaluation/value/SpecificFloatValue.java
+++ b/src/proguard/evaluation/value/SpecificFloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/SpecificIntegerValue.java b/src/proguard/evaluation/value/SpecificIntegerValue.java
index 352e385..b67ce6c 100644
--- a/src/proguard/evaluation/value/SpecificIntegerValue.java
+++ b/src/proguard/evaluation/value/SpecificIntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/SpecificLongValue.java b/src/proguard/evaluation/value/SpecificLongValue.java
index 162f9fe..0cb9e71 100644
--- a/src/proguard/evaluation/value/SpecificLongValue.java
+++ b/src/proguard/evaluation/value/SpecificLongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/TopValue.java b/src/proguard/evaluation/value/TopValue.java
index 4422f69..3492128 100644
--- a/src/proguard/evaluation/value/TopValue.java
+++ b/src/proguard/evaluation/value/TopValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/TypedReferenceValue.java b/src/proguard/evaluation/value/TypedReferenceValue.java
index 4f8629c..e305fa1 100644
--- a/src/proguard/evaluation/value/TypedReferenceValue.java
+++ b/src/proguard/evaluation/value/TypedReferenceValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -318,8 +318,8 @@ public class TypedReferenceValue extends ReferenceValue
// Reduce the common dimension count if either type is an array of
// primitives type of this dimension.
if (commonDimensionCount > 0 &&
- (ClassUtil.isInternalPrimitiveType(otherType.charAt(commonDimensionCount))) ||
- ClassUtil.isInternalPrimitiveType(thisType.charAt(commonDimensionCount)))
+ (ClassUtil.isInternalPrimitiveType(otherType.charAt(commonDimensionCount)) ||
+ ClassUtil.isInternalPrimitiveType(thisType.charAt(commonDimensionCount))))
{
commonDimensionCount--;
}
diff --git a/src/proguard/evaluation/value/UnknownDoubleValue.java b/src/proguard/evaluation/value/UnknownDoubleValue.java
index ad2f511..2d26ebb 100644
--- a/src/proguard/evaluation/value/UnknownDoubleValue.java
+++ b/src/proguard/evaluation/value/UnknownDoubleValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/UnknownFloatValue.java b/src/proguard/evaluation/value/UnknownFloatValue.java
index f6f2047..29edc0c 100644
--- a/src/proguard/evaluation/value/UnknownFloatValue.java
+++ b/src/proguard/evaluation/value/UnknownFloatValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/UnknownIntegerValue.java b/src/proguard/evaluation/value/UnknownIntegerValue.java
index 5c05721..2b9215b 100644
--- a/src/proguard/evaluation/value/UnknownIntegerValue.java
+++ b/src/proguard/evaluation/value/UnknownIntegerValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/UnknownLongValue.java b/src/proguard/evaluation/value/UnknownLongValue.java
index ced2d1f..b5a0b46 100644
--- a/src/proguard/evaluation/value/UnknownLongValue.java
+++ b/src/proguard/evaluation/value/UnknownLongValue.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/evaluation/value/Value.java b/src/proguard/evaluation/value/Value.java
index 9501bd4..4c9e1f0 100644
--- a/src/proguard/evaluation/value/Value.java
+++ b/src/proguard/evaluation/value/Value.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -45,7 +45,7 @@ public abstract class Value
*/
public Category1Value category1Value()
{
- throw new IllegalArgumentException("Value is not a Category 1 value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not a Category 1 value [" + this.getClass().getName() + "]");
}
/**
@@ -53,7 +53,7 @@ public abstract class Value
*/
public Category2Value category2Value()
{
- throw new IllegalArgumentException("Value is not a Category 2 value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not a Category 2 value [" + this.getClass().getName() + "]");
}
@@ -62,7 +62,7 @@ public abstract class Value
*/
public IntegerValue integerValue()
{
- throw new IllegalArgumentException("Value is not an integer value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not an integer value [" + this.getClass().getName() + "]");
}
/**
@@ -70,7 +70,7 @@ public abstract class Value
*/
public LongValue longValue()
{
- throw new IllegalArgumentException("Value is not a long value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not a long value [" + this.getClass().getName() + "]");
}
/**
@@ -78,7 +78,7 @@ public abstract class Value
*/
public FloatValue floatValue()
{
- throw new IllegalArgumentException("Value is not a float value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not a float value [" + this.getClass().getName() + "]");
}
/**
@@ -86,7 +86,7 @@ public abstract class Value
*/
public DoubleValue doubleValue()
{
- throw new IllegalArgumentException("Value is not a double value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not a double value [" + this.getClass().getName() + "]");
}
/**
@@ -94,7 +94,7 @@ public abstract class Value
*/
public ReferenceValue referenceValue()
{
- throw new IllegalArgumentException("Value is not a reference value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not a reference value [" + this.getClass().getName() + "]");
}
/**
@@ -102,7 +102,7 @@ public abstract class Value
*/
public InstructionOffsetValue instructionOffsetValue()
{
- throw new IllegalArgumentException("Value is not an instruction offset value [" + this.getClass().getName() + "]");
+ throw new IllegalArgumentException("Value \"" + this.toString() + "\" is not an instruction offset value [" + this.getClass().getName() + "]");
}
diff --git a/src/proguard/evaluation/value/ValueFactory.java b/src/proguard/evaluation/value/ValueFactory.java
index cb9e657..12adb24 100644
--- a/src/proguard/evaluation/value/ValueFactory.java
+++ b/src/proguard/evaluation/value/ValueFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gradle/ProGuardTask.java b/src/proguard/gradle/ProGuardTask.java
index 447c630..0f0286f 100644
--- a/src/proguard/gradle/ProGuardTask.java
+++ b/src/proguard/gradle/ProGuardTask.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ClassPathPanel.java b/src/proguard/gui/ClassPathPanel.java
index 1b61f0f..d6623fa 100644
--- a/src/proguard/gui/ClassPathPanel.java
+++ b/src/proguard/gui/ClassPathPanel.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ClassSpecificationDialog.java b/src/proguard/gui/ClassSpecificationDialog.java
index f6686ec..ce4171b 100644
--- a/src/proguard/gui/ClassSpecificationDialog.java
+++ b/src/proguard/gui/ClassSpecificationDialog.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ClassSpecificationsPanel.java b/src/proguard/gui/ClassSpecificationsPanel.java
index f09fbe3..b82ef16 100644
--- a/src/proguard/gui/ClassSpecificationsPanel.java
+++ b/src/proguard/gui/ClassSpecificationsPanel.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ExtensionFileFilter.java b/src/proguard/gui/ExtensionFileFilter.java
index dbaae66..b5b3da7 100644
--- a/src/proguard/gui/ExtensionFileFilter.java
+++ b/src/proguard/gui/ExtensionFileFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/FilterBuilder.java b/src/proguard/gui/FilterBuilder.java
index cdf297c..ab0908c 100644
--- a/src/proguard/gui/FilterBuilder.java
+++ b/src/proguard/gui/FilterBuilder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/FilterDialog.java b/src/proguard/gui/FilterDialog.java
index d96684e..6cc0a4a 100644
--- a/src/proguard/gui/FilterDialog.java
+++ b/src/proguard/gui/FilterDialog.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/GUIResources.java b/src/proguard/gui/GUIResources.java
index 5d411ae..0c1123c 100644
--- a/src/proguard/gui/GUIResources.java
+++ b/src/proguard/gui/GUIResources.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/GUIResources.properties b/src/proguard/gui/GUIResources.properties
index 1a8e8fc..0625a21 100644
--- a/src/proguard/gui/GUIResources.properties
+++ b/src/proguard/gui/GUIResources.properties
@@ -1,5 +1,5 @@
# ProGuard -- shrinking, optimization, and obfuscation of Java class files.
-# Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+# Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
#
# Tab names.
@@ -25,7 +25,7 @@ preverification = Preverification
#
# Panel titles.
#
-welcome = Welcome to ProGuard, version 5.0
+welcome = Welcome to ProGuard, version 5.2.1
options = Options
keepAdditional = Keep additional classes and class members
keepNamesAdditional = Keep additional class names and class member names
@@ -65,12 +65,12 @@ proGuardInfo = \
Official site at Sourceforge: \
<a href="http://proguard.sourceforge.net/\">http://proguard.sourceforge.net/</a>\
<br>\
- Professional support by Saikoa: \
- <a href="http://www.saikoa.com/\">http://www.saikoa.com/</a>\
+ Professional support by GuardSquare: \
+ <a href="http://www.guardsquare.com/\">http://www.guardsquare.com/</a>\
<p>\
Distributed under the GNU General Public License.\
<br>\
- Copyright © 2002-2014.</html>
+ Copyright © 2002-2015.</html>
processingInfo = \
You can now start processing your code, \
diff --git a/src/proguard/gui/KeepSpecificationsPanel.java b/src/proguard/gui/KeepSpecificationsPanel.java
index 0678bc7..1195142 100644
--- a/src/proguard/gui/KeepSpecificationsPanel.java
+++ b/src/proguard/gui/KeepSpecificationsPanel.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ListPanel.java b/src/proguard/gui/ListPanel.java
index d0293a2..d99e940 100644
--- a/src/proguard/gui/ListPanel.java
+++ b/src/proguard/gui/ListPanel.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/MemberSpecificationDialog.java b/src/proguard/gui/MemberSpecificationDialog.java
index 9744e9e..f562c2d 100644
--- a/src/proguard/gui/MemberSpecificationDialog.java
+++ b/src/proguard/gui/MemberSpecificationDialog.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/MemberSpecificationsPanel.java b/src/proguard/gui/MemberSpecificationsPanel.java
index 92feac6..e4783db 100644
--- a/src/proguard/gui/MemberSpecificationsPanel.java
+++ b/src/proguard/gui/MemberSpecificationsPanel.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/MessageDialogRunnable.java b/src/proguard/gui/MessageDialogRunnable.java
index d1809c7..9049091 100644
--- a/src/proguard/gui/MessageDialogRunnable.java
+++ b/src/proguard/gui/MessageDialogRunnable.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/OptimizationsDialog.java b/src/proguard/gui/OptimizationsDialog.java
index c30797b..02283b7 100644
--- a/src/proguard/gui/OptimizationsDialog.java
+++ b/src/proguard/gui/OptimizationsDialog.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ProGuardGUI.java b/src/proguard/gui/ProGuardGUI.java
index 4c2ef57..91e3d10 100644
--- a/src/proguard/gui/ProGuardGUI.java
+++ b/src/proguard/gui/ProGuardGUI.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ProGuardRunnable.java b/src/proguard/gui/ProGuardRunnable.java
index e03fb29..58b88d1 100644
--- a/src/proguard/gui/ProGuardRunnable.java
+++ b/src/proguard/gui/ProGuardRunnable.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/ReTraceRunnable.java b/src/proguard/gui/ReTraceRunnable.java
index 4e0f299..4657585 100644
--- a/src/proguard/gui/ReTraceRunnable.java
+++ b/src/proguard/gui/ReTraceRunnable.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -28,7 +28,7 @@ import java.io.*;
/**
- * This <code>Runnable</code> runs ReTrace, sending console output to a text
+ * This <code>Runnable</code> runs ReTrace, sending the output to a text
* area and any exceptions to message dialogs.
*
* @see ReTrace
@@ -43,7 +43,7 @@ final class ReTraceRunnable implements Runnable
/**
- * Creates a new ProGuardRunnable object.
+ * Creates a new ReTraceRunnable.
* @param consoleTextArea the text area to send the console output to.
* @param verbose specifies whether the de-obfuscated stack trace
* should be verbose.
@@ -68,31 +68,18 @@ final class ReTraceRunnable implements Runnable
consoleTextArea.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
consoleTextArea.setText("");
- // Redirect the stack trace string to the System's in stream, and the
- // out and err streams to the console text area.
- InputStream oldIn = System.in;
- PrintStream oldOut = System.out;
- PrintStream oldErr = System.err;
+ LineNumberReader reader =
+ new LineNumberReader(
+ new CharArrayReader(stackTrace.toCharArray()));
- ByteArrayInputStream inputStream =
- new ByteArrayInputStream(stackTrace.getBytes());
-
- PrintStream printStream =
- new PrintStream(new TextAreaOutputStream(consoleTextArea), true);
-
- System.setIn(inputStream);
- System.setOut(printStream);
- System.setErr(printStream);
+ PrintWriter writer =
+ new PrintWriter(new TextAreaWriter(consoleTextArea), true);
try
{
- // Create a new ProGuard object with the GUI's configuration.
- ReTrace reTrace = new ReTrace(ReTrace.STACK_TRACE_EXPRESSION,
- verbose,
- mappingFile);
-
- // Run it.
- reTrace.execute();
+ // Execute ReTrace with the collected settings.
+ new ReTrace(ReTrace.STACK_TRACE_EXPRESSION, verbose, mappingFile)
+ .retrace(reader, writer);
}
catch (Exception ex)
{
@@ -120,19 +107,8 @@ final class ReTraceRunnable implements Runnable
JOptionPane.ERROR_MESSAGE);
}
- // Make sure all output has been sent to the console text area.
- printStream.flush();
-
- // Restore the old System's in, out, and err streams.
- System.setIn(oldIn);
- System.setOut(oldOut);
- System.setErr(oldErr);
-
consoleTextArea.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
consoleTextArea.setCaretPosition(0);
-
- // Reset the global static redirection lock.
- ProGuardGUI.systemOutRedirected = false;
}
diff --git a/src/proguard/gui/SwingUtil.java b/src/proguard/gui/SwingUtil.java
index b7edf98..7af8e39 100644
--- a/src/proguard/gui/SwingUtil.java
+++ b/src/proguard/gui/SwingUtil.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/TabbedPane.java b/src/proguard/gui/TabbedPane.java
index 07c1a63..763ce4f 100644
--- a/src/proguard/gui/TabbedPane.java
+++ b/src/proguard/gui/TabbedPane.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/TextAreaOutputStream.java b/src/proguard/gui/TextAreaOutputStream.java
index 425574c..38c3201 100644
--- a/src/proguard/gui/TextAreaOutputStream.java
+++ b/src/proguard/gui/TextAreaOutputStream.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/TextAreaOutputStream.java b/src/proguard/gui/TextAreaWriter.java
similarity index 76%
copy from src/proguard/gui/TextAreaOutputStream.java
copy to src/proguard/gui/TextAreaWriter.java
index 425574c..1e8c205 100644
--- a/src/proguard/gui/TextAreaOutputStream.java
+++ b/src/proguard/gui/TextAreaWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -25,24 +25,24 @@ import java.io.*;
/**
- * This <code>PrintStream</code> appends its output to a given text area.
+ * This writer appends its output to a given text area.
*
* @author Eric Lafortune
*/
-final class TextAreaOutputStream extends FilterOutputStream implements Runnable
+final class TextAreaWriter extends FilterWriter implements Runnable
{
private final JTextArea textArea;
- public TextAreaOutputStream(JTextArea textArea)
+ public TextAreaWriter(JTextArea textArea)
{
- super(new ByteArrayOutputStream());
+ super(new CharArrayWriter());
this.textArea = textArea;
}
- // Implementation for FilterOutputStream.
+ // Implementation for FilterWriter.
public void flush() throws IOException
{
@@ -64,17 +64,17 @@ final class TextAreaOutputStream extends FilterOutputStream implements Runnable
public void run()
{
- ByteArrayOutputStream out = (ByteArrayOutputStream)super.out;
+ CharArrayWriter writer = (CharArrayWriter)super.out;
// Has any new text been written?
- String text = out.toString();
+ String text = writer.toString();
if (text.length() > 0)
{
// Append the accumulated text to the text area.
textArea.append(text);
// Clear the buffer.
- out.reset();
+ writer.reset();
}
}
}
diff --git a/src/proguard/gui/splash/BufferedSprite.java b/src/proguard/gui/splash/BufferedSprite.java
index 251088e..007ee41 100644
--- a/src/proguard/gui/splash/BufferedSprite.java
+++ b/src/proguard/gui/splash/BufferedSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/CircleSprite.java b/src/proguard/gui/splash/CircleSprite.java
index 2ce1bfd..5bfea6e 100644
--- a/src/proguard/gui/splash/CircleSprite.java
+++ b/src/proguard/gui/splash/CircleSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ClipSprite.java b/src/proguard/gui/splash/ClipSprite.java
index d286bcb..26b7c18 100644
--- a/src/proguard/gui/splash/ClipSprite.java
+++ b/src/proguard/gui/splash/ClipSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ColorSprite.java b/src/proguard/gui/splash/ColorSprite.java
index a5baaca..93105b6 100644
--- a/src/proguard/gui/splash/ColorSprite.java
+++ b/src/proguard/gui/splash/ColorSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/CompositeSprite.java b/src/proguard/gui/splash/CompositeSprite.java
index b5ad4c0..9e842a8 100644
--- a/src/proguard/gui/splash/CompositeSprite.java
+++ b/src/proguard/gui/splash/CompositeSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ConstantColor.java b/src/proguard/gui/splash/ConstantColor.java
index f3439d5..aa1bc6a 100644
--- a/src/proguard/gui/splash/ConstantColor.java
+++ b/src/proguard/gui/splash/ConstantColor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ConstantDouble.java b/src/proguard/gui/splash/ConstantDouble.java
index 45e7a08..88b2f23 100644
--- a/src/proguard/gui/splash/ConstantDouble.java
+++ b/src/proguard/gui/splash/ConstantDouble.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ConstantFont.java b/src/proguard/gui/splash/ConstantFont.java
index 3efc4d2..8922242 100644
--- a/src/proguard/gui/splash/ConstantFont.java
+++ b/src/proguard/gui/splash/ConstantFont.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ConstantInt.java b/src/proguard/gui/splash/ConstantInt.java
index d34be3d..f7d94e7 100644
--- a/src/proguard/gui/splash/ConstantInt.java
+++ b/src/proguard/gui/splash/ConstantInt.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ConstantString.java b/src/proguard/gui/splash/ConstantString.java
index 534c474..1cf0b48 100644
--- a/src/proguard/gui/splash/ConstantString.java
+++ b/src/proguard/gui/splash/ConstantString.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ConstantTiming.java b/src/proguard/gui/splash/ConstantTiming.java
index a32d7ad..3998488 100644
--- a/src/proguard/gui/splash/ConstantTiming.java
+++ b/src/proguard/gui/splash/ConstantTiming.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/FontSprite.java b/src/proguard/gui/splash/FontSprite.java
index 3904432..e572517 100644
--- a/src/proguard/gui/splash/FontSprite.java
+++ b/src/proguard/gui/splash/FontSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ImageSprite.java b/src/proguard/gui/splash/ImageSprite.java
index 2ef0be5..3ba95a0 100644
--- a/src/proguard/gui/splash/ImageSprite.java
+++ b/src/proguard/gui/splash/ImageSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/LinearColor.java b/src/proguard/gui/splash/LinearColor.java
index 34e9b45..5392538 100644
--- a/src/proguard/gui/splash/LinearColor.java
+++ b/src/proguard/gui/splash/LinearColor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/LinearDouble.java b/src/proguard/gui/splash/LinearDouble.java
index 0536af3..fd881d4 100644
--- a/src/proguard/gui/splash/LinearDouble.java
+++ b/src/proguard/gui/splash/LinearDouble.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/LinearInt.java b/src/proguard/gui/splash/LinearInt.java
index dcd2234..ad541fe 100644
--- a/src/proguard/gui/splash/LinearInt.java
+++ b/src/proguard/gui/splash/LinearInt.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/LinearTiming.java b/src/proguard/gui/splash/LinearTiming.java
index 9c00b0d..7b11b9e 100644
--- a/src/proguard/gui/splash/LinearTiming.java
+++ b/src/proguard/gui/splash/LinearTiming.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/OverrideGraphics2D.java b/src/proguard/gui/splash/OverrideGraphics2D.java
index 1306d9a..c63ef1d 100644
--- a/src/proguard/gui/splash/OverrideGraphics2D.java
+++ b/src/proguard/gui/splash/OverrideGraphics2D.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/RectangleSprite.java b/src/proguard/gui/splash/RectangleSprite.java
index d65abc3..714fce5 100644
--- a/src/proguard/gui/splash/RectangleSprite.java
+++ b/src/proguard/gui/splash/RectangleSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/SawToothTiming.java b/src/proguard/gui/splash/SawToothTiming.java
index 9158e12..3f297d7 100644
--- a/src/proguard/gui/splash/SawToothTiming.java
+++ b/src/proguard/gui/splash/SawToothTiming.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/ShadowedSprite.java b/src/proguard/gui/splash/ShadowedSprite.java
index 9a136bc..1e69125 100644
--- a/src/proguard/gui/splash/ShadowedSprite.java
+++ b/src/proguard/gui/splash/ShadowedSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/SineTiming.java b/src/proguard/gui/splash/SineTiming.java
index bfa7388..820acb5 100644
--- a/src/proguard/gui/splash/SineTiming.java
+++ b/src/proguard/gui/splash/SineTiming.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/SmoothTiming.java b/src/proguard/gui/splash/SmoothTiming.java
index 73fea38..013aede 100644
--- a/src/proguard/gui/splash/SmoothTiming.java
+++ b/src/proguard/gui/splash/SmoothTiming.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/SplashPanel.java b/src/proguard/gui/splash/SplashPanel.java
index 94596e6..d07373b 100644
--- a/src/proguard/gui/splash/SplashPanel.java
+++ b/src/proguard/gui/splash/SplashPanel.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/Sprite.java b/src/proguard/gui/splash/Sprite.java
index 7f225e3..2f6b4f0 100644
--- a/src/proguard/gui/splash/Sprite.java
+++ b/src/proguard/gui/splash/Sprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/TextSprite.java b/src/proguard/gui/splash/TextSprite.java
index 5225b90..2392e10 100644
--- a/src/proguard/gui/splash/TextSprite.java
+++ b/src/proguard/gui/splash/TextSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/TimeSwitchSprite.java b/src/proguard/gui/splash/TimeSwitchSprite.java
index ffafcd3..a0e8d48 100644
--- a/src/proguard/gui/splash/TimeSwitchSprite.java
+++ b/src/proguard/gui/splash/TimeSwitchSprite.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/Timing.java b/src/proguard/gui/splash/Timing.java
index 9d01c1d..a5aa8b0 100644
--- a/src/proguard/gui/splash/Timing.java
+++ b/src/proguard/gui/splash/Timing.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/TypeWriterString.java b/src/proguard/gui/splash/TypeWriterString.java
index 83b4bd0..cc7103c 100644
--- a/src/proguard/gui/splash/TypeWriterString.java
+++ b/src/proguard/gui/splash/TypeWriterString.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/VariableColor.java b/src/proguard/gui/splash/VariableColor.java
index eabcc71..8465b51 100644
--- a/src/proguard/gui/splash/VariableColor.java
+++ b/src/proguard/gui/splash/VariableColor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/VariableDouble.java b/src/proguard/gui/splash/VariableDouble.java
index 120d7f5..9a2dfeb 100644
--- a/src/proguard/gui/splash/VariableDouble.java
+++ b/src/proguard/gui/splash/VariableDouble.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/VariableFont.java b/src/proguard/gui/splash/VariableFont.java
index 7ca9462..f6d6882 100644
--- a/src/proguard/gui/splash/VariableFont.java
+++ b/src/proguard/gui/splash/VariableFont.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/VariableInt.java b/src/proguard/gui/splash/VariableInt.java
index e12a319..b3a355c 100644
--- a/src/proguard/gui/splash/VariableInt.java
+++ b/src/proguard/gui/splash/VariableInt.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/VariableSizeFont.java b/src/proguard/gui/splash/VariableSizeFont.java
index 4c1ff0f..4a8d4a8 100644
--- a/src/proguard/gui/splash/VariableSizeFont.java
+++ b/src/proguard/gui/splash/VariableSizeFont.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/gui/splash/VariableString.java b/src/proguard/gui/splash/VariableString.java
index 2622889..0ce3c41 100644
--- a/src/proguard/gui/splash/VariableString.java
+++ b/src/proguard/gui/splash/VariableString.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/CascadingDataEntryWriter.java b/src/proguard/io/CascadingDataEntryWriter.java
index 17c1946..5439056 100644
--- a/src/proguard/io/CascadingDataEntryWriter.java
+++ b/src/proguard/io/CascadingDataEntryWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/ClassFilter.java b/src/proguard/io/ClassFilter.java
index c89f9f6..81cb566 100644
--- a/src/proguard/io/ClassFilter.java
+++ b/src/proguard/io/ClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/ClassReader.java b/src/proguard/io/ClassReader.java
index 124160c..44d4e31 100644
--- a/src/proguard/io/ClassReader.java
+++ b/src/proguard/io/ClassReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/ClassRewriter.java b/src/proguard/io/ClassRewriter.java
index fab9366..2e3e2fc 100644
--- a/src/proguard/io/ClassRewriter.java
+++ b/src/proguard/io/ClassRewriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntry.java b/src/proguard/io/DataEntry.java
index 59946c9..bbd0f90 100644
--- a/src/proguard/io/DataEntry.java
+++ b/src/proguard/io/DataEntry.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryClassWriter.java b/src/proguard/io/DataEntryClassWriter.java
index 205cce1..63856bf 100644
--- a/src/proguard/io/DataEntryClassWriter.java
+++ b/src/proguard/io/DataEntryClassWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryCopier.java b/src/proguard/io/DataEntryCopier.java
index 63b2fa9..0b94778 100644
--- a/src/proguard/io/DataEntryCopier.java
+++ b/src/proguard/io/DataEntryCopier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryDirectoryFilter.java b/src/proguard/io/DataEntryDirectoryFilter.java
index a9b2c8b..d240bf4 100644
--- a/src/proguard/io/DataEntryDirectoryFilter.java
+++ b/src/proguard/io/DataEntryDirectoryFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryFilter.java b/src/proguard/io/DataEntryFilter.java
index 0b604ba..fae2233 100644
--- a/src/proguard/io/DataEntryFilter.java
+++ b/src/proguard/io/DataEntryFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryNameFilter.java b/src/proguard/io/DataEntryNameFilter.java
index bc676c0..652a499 100644
--- a/src/proguard/io/DataEntryNameFilter.java
+++ b/src/proguard/io/DataEntryNameFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryObfuscator.java b/src/proguard/io/DataEntryObfuscator.java
index aabb0e8..6c3249c 100644
--- a/src/proguard/io/DataEntryObfuscator.java
+++ b/src/proguard/io/DataEntryObfuscator.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryParentFilter.java b/src/proguard/io/DataEntryParentFilter.java
index 1d4d1e4..641f852 100644
--- a/src/proguard/io/DataEntryParentFilter.java
+++ b/src/proguard/io/DataEntryParentFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryPump.java b/src/proguard/io/DataEntryPump.java
index 6cdaef3..2546cc3 100644
--- a/src/proguard/io/DataEntryPump.java
+++ b/src/proguard/io/DataEntryPump.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryReader.java b/src/proguard/io/DataEntryReader.java
index d03124a..4f72f23 100644
--- a/src/proguard/io/DataEntryReader.java
+++ b/src/proguard/io/DataEntryReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryRenamer.java b/src/proguard/io/DataEntryRenamer.java
index c8bb319..cb9af04 100644
--- a/src/proguard/io/DataEntryRenamer.java
+++ b/src/proguard/io/DataEntryRenamer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryRewriter.java b/src/proguard/io/DataEntryRewriter.java
index 666aa0d..824b862 100644
--- a/src/proguard/io/DataEntryRewriter.java
+++ b/src/proguard/io/DataEntryRewriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DataEntryWriter.java b/src/proguard/io/DataEntryWriter.java
index 5dac1e3..7249412 100644
--- a/src/proguard/io/DataEntryWriter.java
+++ b/src/proguard/io/DataEntryWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DirectoryFilter.java b/src/proguard/io/DirectoryFilter.java
index ebdf4c4..2cbebd9 100644
--- a/src/proguard/io/DirectoryFilter.java
+++ b/src/proguard/io/DirectoryFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DirectoryPump.java b/src/proguard/io/DirectoryPump.java
index fe387ca..e609945 100644
--- a/src/proguard/io/DirectoryPump.java
+++ b/src/proguard/io/DirectoryPump.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/DirectoryWriter.java b/src/proguard/io/DirectoryWriter.java
index e44e195..3e1fc13 100644
--- a/src/proguard/io/DirectoryWriter.java
+++ b/src/proguard/io/DirectoryWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/FileDataEntry.java b/src/proguard/io/FileDataEntry.java
index f188f3b..b678a18 100644
--- a/src/proguard/io/FileDataEntry.java
+++ b/src/proguard/io/FileDataEntry.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/FilteredDataEntryReader.java b/src/proguard/io/FilteredDataEntryReader.java
index ce0f207..d0e68e8 100644
--- a/src/proguard/io/FilteredDataEntryReader.java
+++ b/src/proguard/io/FilteredDataEntryReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/FilteredDataEntryWriter.java b/src/proguard/io/FilteredDataEntryWriter.java
index b8d7977..ff58691 100644
--- a/src/proguard/io/FilteredDataEntryWriter.java
+++ b/src/proguard/io/FilteredDataEntryWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/Finisher.java b/src/proguard/io/Finisher.java
index 74da6f8..0009ca7 100644
--- a/src/proguard/io/Finisher.java
+++ b/src/proguard/io/Finisher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/JarReader.java b/src/proguard/io/JarReader.java
index c4b7e3f..dd11f5d 100644
--- a/src/proguard/io/JarReader.java
+++ b/src/proguard/io/JarReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/JarWriter.java b/src/proguard/io/JarWriter.java
index 5437f28..e7420c9 100644
--- a/src/proguard/io/JarWriter.java
+++ b/src/proguard/io/JarWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/ManifestRewriter.java b/src/proguard/io/ManifestRewriter.java
index f45ad9e..4983608 100644
--- a/src/proguard/io/ManifestRewriter.java
+++ b/src/proguard/io/ManifestRewriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/NameFilter.java b/src/proguard/io/NameFilter.java
index b2e5539..292a6fe 100644
--- a/src/proguard/io/NameFilter.java
+++ b/src/proguard/io/NameFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/ParentDataEntryWriter.java b/src/proguard/io/ParentDataEntryWriter.java
index 9f97e46..644df88 100644
--- a/src/proguard/io/ParentDataEntryWriter.java
+++ b/src/proguard/io/ParentDataEntryWriter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/RenamedDataEntry.java b/src/proguard/io/RenamedDataEntry.java
index ce97b3f..e4a8fdd 100644
--- a/src/proguard/io/RenamedDataEntry.java
+++ b/src/proguard/io/RenamedDataEntry.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/io/ZipDataEntry.java b/src/proguard/io/ZipDataEntry.java
index 84e24db..b078431 100644
--- a/src/proguard/io/ZipDataEntry.java
+++ b/src/proguard/io/ZipDataEntry.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/AttributeShrinker.java b/src/proguard/obfuscate/AttributeShrinker.java
index b1b6dd3..cb7c33c 100644
--- a/src/proguard/obfuscate/AttributeShrinker.java
+++ b/src/proguard/obfuscate/AttributeShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/AttributeUsageMarker.java b/src/proguard/obfuscate/AttributeUsageMarker.java
index 81a4554..a726b45 100644
--- a/src/proguard/obfuscate/AttributeUsageMarker.java
+++ b/src/proguard/obfuscate/AttributeUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/ClassObfuscator.java b/src/proguard/obfuscate/ClassObfuscator.java
index 516c889..64808ff 100644
--- a/src/proguard/obfuscate/ClassObfuscator.java
+++ b/src/proguard/obfuscate/ClassObfuscator.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/ClassRenamer.java b/src/proguard/obfuscate/ClassRenamer.java
index 0a0974d..9b2cf94 100644
--- a/src/proguard/obfuscate/ClassRenamer.java
+++ b/src/proguard/obfuscate/ClassRenamer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/DictionaryNameFactory.java b/src/proguard/obfuscate/DictionaryNameFactory.java
index ffe6e41..836ed97 100644
--- a/src/proguard/obfuscate/DictionaryNameFactory.java
+++ b/src/proguard/obfuscate/DictionaryNameFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/MapCleaner.java b/src/proguard/obfuscate/MapCleaner.java
index 365ec15..ed0b495 100644
--- a/src/proguard/obfuscate/MapCleaner.java
+++ b/src/proguard/obfuscate/MapCleaner.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/MappingKeeper.java b/src/proguard/obfuscate/MappingKeeper.java
index e955e53..9421d24 100644
--- a/src/proguard/obfuscate/MappingKeeper.java
+++ b/src/proguard/obfuscate/MappingKeeper.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -24,7 +24,6 @@ import proguard.classfile.*;
import proguard.classfile.util.*;
import proguard.util.ListUtil;
-
/**
* This MappingKeeper applies the mappings that it receives to its class pool,
* so these mappings are ensured in a subsequent obfuscation step.
@@ -100,9 +99,10 @@ public class MappingKeeper implements MappingProcessor
public void processFieldMapping(String className,
String fieldType,
String fieldName,
+ String newClassName,
String newFieldName)
{
- if (clazz != null)
+ if (clazz != null && className.equals(newClassName))
{
// Find the field.
String name = fieldName;
@@ -141,9 +141,12 @@ public class MappingKeeper implements MappingProcessor
String methodReturnType,
String methodName,
String methodArguments,
+ String newClassName,
+ int newFirstLineNumber,
+ int newLastLineNumber,
String newMethodName)
{
- if (clazz != null)
+ if (clazz != null && className.equals(newClassName))
{
// Find the method.
String descriptor = ClassUtil.internalMethodDescriptor(methodReturnType,
diff --git a/src/proguard/obfuscate/MappingPrinter.java b/src/proguard/obfuscate/MappingPrinter.java
index aab779f..7777971 100644
--- a/src/proguard/obfuscate/MappingPrinter.java
+++ b/src/proguard/obfuscate/MappingPrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -25,8 +25,10 @@ import proguard.classfile.attribute.*;
import proguard.classfile.attribute.visitor.AttributeVisitor;
import proguard.classfile.util.*;
import proguard.classfile.visitor.*;
+import proguard.optimize.peephole.LineNumberLinearizer;
import java.io.PrintStream;
+import java.util.Stack;
/**
@@ -45,6 +47,9 @@ implements ClassVisitor,
{
private final PrintStream ps;
+ // A field serving as a return value for the visitor methods.
+ private boolean printed;
+
/**
* Creates a new MappingPrinter that prints to <code>System.out</code>.
@@ -72,6 +77,7 @@ implements ClassVisitor,
String name = programClass.getName();
String newName = ClassObfuscator.newClassName(programClass);
+ // Print out the class mapping.
ps.println(ClassUtil.externalClassName(name) +
" -> " +
ClassUtil.externalClassName(newName) +
@@ -87,42 +93,44 @@ implements ClassVisitor,
public void visitProgramField(ProgramClass programClass, ProgramField programField)
{
- String newName = MemberObfuscator.newMemberName(programField);
- if (newName != null)
+ String fieldName = programField.getName(programClass);
+ String obfuscatedFieldName = MemberObfuscator.newMemberName(programField);
+ if (obfuscatedFieldName == null)
{
- ps.println(" " +
- ClassUtil.externalFullFieldDescription(
- 0,
- programField.getName(programClass),
- programField.getDescriptor(programClass)) +
- " -> " +
- newName);
+ obfuscatedFieldName = fieldName;
}
+
+ // Print out the field mapping.
+ ps.println(" " +
+ ClassUtil.externalType(programField.getDescriptor(programClass)) + " " +
+ fieldName +
+ " -> " +
+ obfuscatedFieldName);
}
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
- // Special cases: <clinit> and <init> are always kept unchanged.
- // We can ignore them here.
- String name = programMethod.getName(programClass);
- if (ClassUtil.isInitializer(name))
+ String methodName = programMethod.getName(programClass);
+ String obfuscatedMethodName = MemberObfuscator.newMemberName(programMethod);
+ if (obfuscatedMethodName == null)
{
- return;
+ obfuscatedMethodName = methodName;
}
- String newName = MemberObfuscator.newMemberName(programMethod);
- if (newName != null)
+ // Print out the method mapping, if it has line numbers.
+ printed = false;
+ programMethod.attributesAccept(programClass, this);
+
+ // Otherwise print out the method mapping without line numbers.
+ if (!printed)
{
- ps.print(" ");
- programMethod.attributesAccept(programClass, this);
- ps.println(ClassUtil.externalFullMethodDescription(
- programClass.getName(),
- 0,
- programMethod.getName(programClass),
- programMethod.getDescriptor(programClass)) +
+ ps.println(" " +
+ ClassUtil.externalMethodReturnType(programMethod.getDescriptor(programClass)) + " " +
+ methodName + JavaConstants.METHOD_ARGUMENTS_OPEN +
+ ClassUtil.externalMethodArguments(programMethod.getDescriptor(programClass)) + JavaConstants.METHOD_ARGUMENTS_CLOSE +
" -> " +
- newName);
+ obfuscatedMethodName);
}
}
@@ -140,7 +148,218 @@ implements ClassVisitor,
public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
{
- ps.print(lineNumberTableAttribute.getLowestLineNumber() + ":" +
- lineNumberTableAttribute.getHighestLineNumber() + ":");
+ LineNumberInfo[] lineNumberTable = lineNumberTableAttribute.lineNumberTable;
+ int lineNumberTableLength = lineNumberTableAttribute.u2lineNumberTableLength;
+
+ String methodName = method.getName(clazz);
+ String methodDescriptor = method.getDescriptor(clazz);
+ String obfuscatedMethodName = MemberObfuscator.newMemberName(method);
+ if (obfuscatedMethodName == null)
+ {
+ obfuscatedMethodName = methodName;
+ }
+
+ int lowestLineNumber = lineNumberTableAttribute.getLowestLineNumber();
+ int highestLineNumber = lineNumberTableAttribute.getHighestLineNumber();
+
+ // Does the method have any local line numbers at all?
+ if (lineNumberTableAttribute.getSource(codeAttribute.u4codeLength) == null)
+ {
+ if (lowestLineNumber > 0)
+ {
+ // Print out the line number range of the method,
+ // ignoring line numbers of any inlined methods.
+ ps.println(" " +
+ lowestLineNumber + ":" +
+ highestLineNumber + ":" +
+ ClassUtil.externalMethodReturnType(method.getDescriptor(clazz)) + " " +
+ methodName + JavaConstants.METHOD_ARGUMENTS_OPEN +
+ ClassUtil.externalMethodArguments(method.getDescriptor(clazz)) + JavaConstants.METHOD_ARGUMENTS_CLOSE +
+ " -> " +
+ obfuscatedMethodName);
+ }
+ else
+ {
+ // Print out the method mapping without line numbers.
+ ps.println(" " +
+ ClassUtil.externalMethodReturnType(method.getDescriptor(clazz)) + " " +
+ methodName + JavaConstants.METHOD_ARGUMENTS_OPEN +
+ ClassUtil.externalMethodArguments(method.getDescriptor(clazz)) + JavaConstants.METHOD_ARGUMENTS_CLOSE +
+ " -> " +
+ obfuscatedMethodName);
+ }
+ }
+
+ // Print out the line numbers of any inlined methods and their
+ // enclosing methods.
+ Stack enclosingLineNumbers = new Stack();
+
+ LineNumberInfo previousInfo = new LineNumberInfo(0, 0);
+
+ for (int index = 0; index < lineNumberTableLength; index++)
+ {
+ LineNumberInfo info = lineNumberTable[index];
+
+ // Are we entering or exiting an inlined block (or a merged block)?
+ // We're testing on the identities out of convenience.
+ String previousSource = previousInfo.getSource();
+ String source = info.getSource();
+ if (source != previousSource)
+ {
+ // Are we entering or exiting the block?
+ int previousLineNumber = previousInfo.u2lineNumber;
+ int lineNumber = info.u2lineNumber;
+ if (lineNumber > previousLineNumber)
+ {
+ // We're entering an inlined block.
+ // Accumulate its enclosing line numbers, so they can be
+ // printed out for each inlined block.
+ if (index > 0)
+ {
+ enclosingLineNumbers.push(previousInfo);
+ }
+
+ printInlinedMethodMapping(clazz.getName(),
+ methodName,
+ methodDescriptor,
+ info,
+ enclosingLineNumbers,
+ obfuscatedMethodName);
+ }
+ // TODO: There appear to be cases where the stack is empty at this point, so we've added a check.
+ else if (!enclosingLineNumbers.isEmpty())
+ {
+ // We're exiting an inlined block.
+ // Pop its enclosing line number.
+ enclosingLineNumbers.pop();
+ }
+ }
+
+ previousInfo = info;
+ }
+
+ printed = true;
+ }
+
+
+ // Small utility methods.
+
+ /**
+ * Prints out the mapping of the specified inlined methods and its
+ * enclosing methods.
+ */
+ private void printInlinedMethodMapping(String className,
+ String methodName,
+ String methodDescriptor,
+ LineNumberInfo inlinedInfo,
+ Stack enclosingLineNumbers,
+ String obfuscatedMethodName)
+ {
+ String source = inlinedInfo.getSource();
+
+ // Parse the information from the source string of the
+ // inlined method.
+ int separatorIndex1 = source.indexOf('.');
+ int separatorIndex2 = source.indexOf('(', separatorIndex1 + 1);
+ int separatorIndex3 = source.indexOf(':', separatorIndex2 + 1);
+ int separatorIndex4 = source.indexOf(':', separatorIndex3 + 1);
+
+ String inlinedClassName = source.substring(0, separatorIndex1);
+ String inlinedMethodName = source.substring(separatorIndex1 + 1, separatorIndex2);
+ String inlinedMethodDescriptor = source.substring(separatorIndex2, separatorIndex3);
+ String inlinedRange = source.substring(separatorIndex3);
+
+ int startLineNumber = Integer.parseInt(source.substring(separatorIndex3 + 1, separatorIndex4));
+ int endLineNumber = Integer.parseInt(source.substring(separatorIndex4 + 1));
+
+ // Compute the shifted line number range.
+ int shiftedStartLineNumber = inlinedInfo.u2lineNumber;
+ int shiftedEndLineNumber = shiftedStartLineNumber + endLineNumber - startLineNumber;
+
+ // Print out the line number range of the inlined method.
+ ps.println(" " +
+ shiftedStartLineNumber + ":" +
+ shiftedEndLineNumber + ":" +
+ ClassUtil.externalMethodReturnType(inlinedMethodDescriptor) + " " +
+ (inlinedClassName.equals(className) ? "" :
+ ClassUtil.externalClassName(inlinedClassName) + JavaConstants.PACKAGE_SEPARATOR) +
+ inlinedMethodName + JavaConstants.METHOD_ARGUMENTS_OPEN +
+ ClassUtil.externalMethodArguments(inlinedMethodDescriptor) + JavaConstants.METHOD_ARGUMENTS_CLOSE +
+ inlinedRange + " -> " +
+ obfuscatedMethodName);
+
+ // Print out the line numbers of the accumulated enclosing
+ // methods.
+ for (int enclosingIndex = enclosingLineNumbers.size()-1; enclosingIndex >= 0; enclosingIndex--)
+ {
+ LineNumberInfo enclosingInfo =
+ (LineNumberInfo)enclosingLineNumbers.get(enclosingIndex);
+
+ printEnclosingMethodMapping(className,
+ methodName,
+ methodDescriptor,
+ shiftedStartLineNumber + ":" +
+ shiftedEndLineNumber,
+ enclosingInfo,
+ obfuscatedMethodName);
+
+
+ }
+ }
+
+
+ /**
+ * Prints out the mapping of the specified enclosing method.
+ */
+ private void printEnclosingMethodMapping(String className,
+ String methodName,
+ String methodDescriptor,
+ String shiftedRange,
+ LineNumberInfo enclosingInfo,
+ String obfuscatedMethodName)
+ {
+ // Parse the information from the source string of the enclosing
+ // method.
+ String enclosingSource = enclosingInfo.getSource();
+
+ String enclosingClassName;
+ String enclosingMethodName;
+ String enclosingMethodDescriptor;
+ int enclosingLineNumber;
+
+ if (enclosingSource == null)
+ {
+ enclosingClassName = className;
+ enclosingMethodName = methodName;
+ enclosingMethodDescriptor = methodDescriptor;
+ enclosingLineNumber = enclosingInfo.u2lineNumber;
+ }
+ else
+ {
+ int enclosingSeparatorIndex1 = enclosingSource.indexOf('.');
+ int enclosingSeparatorIndex2 = enclosingSource.indexOf('(', enclosingSeparatorIndex1 + 1);
+ int enclosingSeparatorIndex3 = enclosingSource.indexOf(':', enclosingSeparatorIndex2 + 1);
+ int enclosingSeparatorIndex4 = enclosingSource.indexOf(':', enclosingSeparatorIndex3 + 1);
+
+ // We need the first line number to correct the shifted enclosing
+ // line number back to its original range.
+ int firstLineNumber = Integer.parseInt(enclosingSource.substring(enclosingSeparatorIndex3 + 1, enclosingSeparatorIndex4));
+
+ enclosingClassName = enclosingSource.substring(0, enclosingSeparatorIndex1);
+ enclosingMethodName = enclosingSource.substring(enclosingSeparatorIndex1 + 1, enclosingSeparatorIndex2);
+ enclosingMethodDescriptor = enclosingSource.substring(enclosingSeparatorIndex2, enclosingSeparatorIndex3);
+ enclosingLineNumber = (enclosingInfo.u2lineNumber - firstLineNumber) % LineNumberLinearizer.SHIFT_ROUNDING + firstLineNumber;
+ }
+
+ // Print out the line number of the enclosing method.
+ ps.println(" " +
+ shiftedRange + ":" +
+ ClassUtil.externalMethodReturnType(enclosingMethodDescriptor) + " " +
+ (enclosingClassName.equals(className) ? "" :
+ ClassUtil.externalClassName(enclosingClassName) + JavaConstants.PACKAGE_SEPARATOR) +
+ enclosingMethodName + JavaConstants.METHOD_ARGUMENTS_OPEN +
+ ClassUtil.externalMethodArguments(enclosingMethodDescriptor) + JavaConstants.METHOD_ARGUMENTS_CLOSE + ":" +
+ enclosingLineNumber + " -> " +
+ obfuscatedMethodName);
}
}
diff --git a/src/proguard/obfuscate/MappingProcessor.java b/src/proguard/obfuscate/MappingProcessor.java
index 8047e8d..f8cfe1a 100644
--- a/src/proguard/obfuscate/MappingProcessor.java
+++ b/src/proguard/obfuscate/MappingProcessor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -20,7 +20,6 @@
*/
package proguard.obfuscate;
-
/**
* This interface specifies methods to process name mappings between original
* classes and their obfuscated versions. The mappings are typically read
@@ -45,29 +44,34 @@ public interface MappingProcessor
/**
* Processes the given field name mapping.
- *
* @param className the original class name.
* @param fieldType the original external field type.
* @param fieldName the original field name.
+ * @param newClassName the new class name.
* @param newFieldName the new field name.
*/
public void processFieldMapping(String className,
String fieldType,
String fieldName,
+ String newClassName,
String newFieldName);
/**
* Processes the given method name mapping.
- *
- * @param className the original class name.
- * @param firstLineNumber the first line number of the method, or 0 if it
- * is not known.
- * @param lastLineNumber the last line number of the method, or 0 if it
- * is not known.
- * @param methodReturnType the original external method return type.
- * @param methodName the original external method name.
- * @param methodArguments the original external method arguments.
- * @param newMethodName the new method name.
+ * @param className the original class name.
+ * @param firstLineNumber the first line number of the method, or 0 if
+ * it is not known.
+ * @param lastLineNumber the last line number of the method, or 0 if
+ * it is not known.
+ * @param methodReturnType the original external method return type.
+ * @param methodName the original external method name.
+ * @param methodArguments the original external method arguments.
+ * @param newClassName the new class name.
+ * @param newFirstLineNumber the new first line number of the method, or 0
+ * if it is not known.
+ * @param newLastLineNumber the new last line number of the method, or 0
+ * if it is not known.
+ * @param newMethodName the new method name.
*/
public void processMethodMapping(String className,
int firstLineNumber,
@@ -75,5 +79,8 @@ public interface MappingProcessor
String methodReturnType,
String methodName,
String methodArguments,
+ String newClassName,
+ int newFirstLineNumber,
+ int newLastLineNumber,
String newMethodName);
}
diff --git a/src/proguard/obfuscate/MappingReader.java b/src/proguard/obfuscate/MappingReader.java
index 88a13e0..d87fdc7 100644
--- a/src/proguard/obfuscate/MappingReader.java
+++ b/src/proguard/obfuscate/MappingReader.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -65,19 +65,22 @@ public class MappingReader
line = line.trim();
- // The distinction between a class mapping and a class
- // member mapping is the initial whitespace.
- if (line.endsWith(":"))
+ // Is it a non-comment line?
+ if (!line.startsWith("#"))
{
- // Process the class mapping and remember the class's
- // old name.
- className = processClassMapping(line, mappingProcessor);
- }
- else if (className != null)
- {
- // Process the class member mapping, in the context of the
- // current old class name.
- processClassMemberMapping(className, line, mappingProcessor);
+ // Is it a class mapping or a class member mapping?
+ if (line.endsWith(":"))
+ {
+ // Process the class mapping and remember the class's
+ // old name.
+ className = processClassMapping(line, mappingProcessor);
+ }
+ else if (className != null)
+ {
+ // Process the class member mapping, in the context of
+ // the current old class name.
+ processClassMemberMapping(className, line, mappingProcessor);
+ }
}
}
}
@@ -141,16 +144,27 @@ public class MappingReader
String line,
MappingProcessor mappingProcessor)
{
- // See if we can parse "___:___:___ ___(___) -> ___",
+ // See if we can parse one of
+ // ___ ___ -> ___
+ // ___:___:___ ___(___) -> ___
+ // ___:___:___ ___(___):___ -> ___
+ // ___:___:___ ___(___):___:___ -> ___
// containing the optional line numbers, the return type, the original
- // field/method name, optional arguments, and the new field/method name.
+ // field/method name, optional arguments, the optional original line
+ // numbers, and the new field/method name. The original field/method
+ // name may contain an original class name "___.___".
int colonIndex1 = line.indexOf(':');
int colonIndex2 = colonIndex1 < 0 ? -1 : line.indexOf(':', colonIndex1 + 1);
int spaceIndex = line.indexOf(' ', colonIndex2 + 2);
int argumentIndex1 = line.indexOf('(', spaceIndex + 1);
int argumentIndex2 = argumentIndex1 < 0 ? -1 : line.indexOf(')', argumentIndex1 + 1);
- int arrowIndex = line.indexOf("->", Math.max(spaceIndex, argumentIndex2) + 1);
+ int colonIndex3 = argumentIndex2 < 0 ? -1 : line.indexOf(':', argumentIndex2 + 1);
+ int colonIndex4 = colonIndex3 < 0 ? -1 : line.indexOf(':', colonIndex3 + 1);
+ int arrowIndex = line.indexOf("->", (colonIndex4 >= 0 ? colonIndex4 :
+ colonIndex3 >= 0 ? colonIndex3 :
+ argumentIndex2 >= 0 ? argumentIndex2 :
+ spaceIndex) + 1);
if (spaceIndex < 0 ||
arrowIndex < 0)
@@ -163,6 +177,15 @@ public class MappingReader
String name = line.substring(spaceIndex + 1, argumentIndex1 >= 0 ? argumentIndex1 : arrowIndex).trim();
String newName = line.substring(arrowIndex + 2).trim();
+ // Does the method name contain an explicit original class name?
+ String newClassName = className;
+ int dotIndex = name.lastIndexOf('.');
+ if (dotIndex >= 0)
+ {
+ className = name.substring(0, dotIndex);
+ name = name.substring(dotIndex + 1);
+ }
+
// Process this class member mapping.
if (type.length() > 0 &&
name.length() > 0 &&
@@ -171,17 +194,30 @@ public class MappingReader
// Is it a field or a method?
if (argumentIndex2 < 0)
{
- mappingProcessor.processFieldMapping(className, type, name, newName);
+ mappingProcessor.processFieldMapping(className,
+ type,
+ name,
+ newClassName,
+ newName);
}
else
{
int firstLineNumber = 0;
int lastLineNumber = 0;
+ int newFirstLineNumber = 0;
+ int newLastLineNumber = 0;
+
+ if (colonIndex2 >= 0)
+ {
+ firstLineNumber = newFirstLineNumber = Integer.parseInt(line.substring(0, colonIndex1).trim());
+ lastLineNumber = newLastLineNumber = Integer.parseInt(line.substring(colonIndex1 + 1, colonIndex2).trim());
+ }
- if (colonIndex2 > 0)
+ if (colonIndex3 >= 0)
{
- firstLineNumber = Integer.parseInt(line.substring(0, colonIndex1).trim());
- lastLineNumber = Integer.parseInt(line.substring(colonIndex1 + 1, colonIndex2).trim());
+ firstLineNumber = Integer.parseInt(line.substring(colonIndex3 + 1, colonIndex4 > 0 ? colonIndex4 : arrowIndex).trim());
+ lastLineNumber = colonIndex4 < 0 ? firstLineNumber :
+ Integer.parseInt(line.substring(colonIndex4 + 1, arrowIndex).trim());
}
String arguments = line.substring(argumentIndex1 + 1, argumentIndex2).trim();
@@ -192,6 +228,9 @@ public class MappingReader
type,
name,
arguments,
+ newClassName,
+ newFirstLineNumber,
+ newLastLineNumber,
newName);
}
}
diff --git a/src/proguard/obfuscate/MemberNameCleaner.java b/src/proguard/obfuscate/MemberNameCleaner.java
index 5b7e16f..7eed8db 100644
--- a/src/proguard/obfuscate/MemberNameCleaner.java
+++ b/src/proguard/obfuscate/MemberNameCleaner.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/MemberNameCollector.java b/src/proguard/obfuscate/MemberNameCollector.java
index bab9e95..aecb9d7 100644
--- a/src/proguard/obfuscate/MemberNameCollector.java
+++ b/src/proguard/obfuscate/MemberNameCollector.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/MemberNameConflictFixer.java b/src/proguard/obfuscate/MemberNameConflictFixer.java
index 00ac6f7..eab1aff 100644
--- a/src/proguard/obfuscate/MemberNameConflictFixer.java
+++ b/src/proguard/obfuscate/MemberNameConflictFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/MemberNameFilter.java b/src/proguard/obfuscate/MemberNameFilter.java
index dfff99a..2f2b20e 100644
--- a/src/proguard/obfuscate/MemberNameFilter.java
+++ b/src/proguard/obfuscate/MemberNameFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/MemberObfuscator.java b/src/proguard/obfuscate/MemberObfuscator.java
index b5211ac..002cd32 100644
--- a/src/proguard/obfuscate/MemberObfuscator.java
+++ b/src/proguard/obfuscate/MemberObfuscator.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -80,7 +80,7 @@ implements MemberVisitor
// Get the member's descriptor.
String descriptor = member.getDescriptor(clazz);
- // Check whether we're allowed to do aggressive overloading
+ // Check whether we're allowed to overload aggressively.
if (!allowAggressiveOverloading)
{
// Trim the return argument from the descriptor if not.
diff --git a/src/proguard/obfuscate/MemberSpecialNameFilter.java b/src/proguard/obfuscate/MemberSpecialNameFilter.java
index f8ab913..f36ecf6 100644
--- a/src/proguard/obfuscate/MemberSpecialNameFilter.java
+++ b/src/proguard/obfuscate/MemberSpecialNameFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/MultiMappingProcessor.java b/src/proguard/obfuscate/MultiMappingProcessor.java
index e10c100..51afb9a 100644
--- a/src/proguard/obfuscate/MultiMappingProcessor.java
+++ b/src/proguard/obfuscate/MultiMappingProcessor.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -26,7 +26,8 @@ package proguard.obfuscate;
*
* @author Eric Lafortune
*/
-public class MultiMappingProcessor implements MappingProcessor
+public class MultiMappingProcessor
+implements MappingProcessor
{
private final MappingProcessor[] mappingProcessors;
@@ -62,6 +63,7 @@ public class MultiMappingProcessor implements MappingProcessor
public void processFieldMapping(String className,
String fieldType,
String fieldName,
+ String newClassName,
String newFieldName)
{
for (int index = 0; index < mappingProcessors.length; index++)
@@ -69,6 +71,7 @@ public class MultiMappingProcessor implements MappingProcessor
mappingProcessors[index].processFieldMapping(className,
fieldType,
fieldName,
+ newClassName,
newFieldName);
}
}
@@ -80,6 +83,9 @@ public class MultiMappingProcessor implements MappingProcessor
String methodReturnType,
String methodName,
String methodArguments,
+ String newClassName,
+ int newFirstLineNumber,
+ int newLastLineNumber,
String newMethodName)
{
for (int index = 0; index < mappingProcessors.length; index++)
@@ -90,6 +96,9 @@ public class MultiMappingProcessor implements MappingProcessor
methodReturnType,
methodName,
methodArguments,
+ newClassName,
+ newFirstLineNumber,
+ newLastLineNumber,
newMethodName);
}
}
diff --git a/src/proguard/obfuscate/NameFactory.java b/src/proguard/obfuscate/NameFactory.java
index cb5f998..4edb869 100644
--- a/src/proguard/obfuscate/NameFactory.java
+++ b/src/proguard/obfuscate/NameFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/NameFactoryResetter.java b/src/proguard/obfuscate/NameFactoryResetter.java
index a6188a6..f8f90e6 100644
--- a/src/proguard/obfuscate/NameFactoryResetter.java
+++ b/src/proguard/obfuscate/NameFactoryResetter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/NameMarker.java b/src/proguard/obfuscate/NameMarker.java
index 376943f..0f4553b 100644
--- a/src/proguard/obfuscate/NameMarker.java
+++ b/src/proguard/obfuscate/NameMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/NumericNameFactory.java b/src/proguard/obfuscate/NumericNameFactory.java
index 0a23f16..23e203d 100644
--- a/src/proguard/obfuscate/NumericNameFactory.java
+++ b/src/proguard/obfuscate/NumericNameFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/Obfuscator.java b/src/proguard/obfuscate/Obfuscator.java
index b2758a7..c770537 100644
--- a/src/proguard/obfuscate/Obfuscator.java
+++ b/src/proguard/obfuscate/Obfuscator.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/ParameterNameMarker.java b/src/proguard/obfuscate/ParameterNameMarker.java
index fbe8a81..34715d2 100644
--- a/src/proguard/obfuscate/ParameterNameMarker.java
+++ b/src/proguard/obfuscate/ParameterNameMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/SimpleNameFactory.java b/src/proguard/obfuscate/SimpleNameFactory.java
index c7e1a50..e19f4a3 100644
--- a/src/proguard/obfuscate/SimpleNameFactory.java
+++ b/src/proguard/obfuscate/SimpleNameFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/SourceFileRenamer.java b/src/proguard/obfuscate/SourceFileRenamer.java
index 57ab009..5b7bb6b 100644
--- a/src/proguard/obfuscate/SourceFileRenamer.java
+++ b/src/proguard/obfuscate/SourceFileRenamer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/obfuscate/SpecialNameFactory.java b/src/proguard/obfuscate/SpecialNameFactory.java
index 84bb55f..1678286 100644
--- a/src/proguard/obfuscate/SpecialNameFactory.java
+++ b/src/proguard/obfuscate/SpecialNameFactory.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/BootstrapMethodArgumentShrinker.java b/src/proguard/optimize/BootstrapMethodArgumentShrinker.java
index b4ac4cc..5d743f0 100644
--- a/src/proguard/optimize/BootstrapMethodArgumentShrinker.java
+++ b/src/proguard/optimize/BootstrapMethodArgumentShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/ChangedCodePrinter.java b/src/proguard/optimize/ChangedCodePrinter.java
index 261e164..3c790ee 100644
--- a/src/proguard/optimize/ChangedCodePrinter.java
+++ b/src/proguard/optimize/ChangedCodePrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/ConstantMemberFilter.java b/src/proguard/optimize/ConstantMemberFilter.java
index 6bd8619..112c527 100644
--- a/src/proguard/optimize/ConstantMemberFilter.java
+++ b/src/proguard/optimize/ConstantMemberFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/ConstantParameterFilter.java b/src/proguard/optimize/ConstantParameterFilter.java
index 8a5058e..4607bfb 100644
--- a/src/proguard/optimize/ConstantParameterFilter.java
+++ b/src/proguard/optimize/ConstantParameterFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/DuplicateInitializerFixer.java b/src/proguard/optimize/DuplicateInitializerFixer.java
index f5d5787..bd2300d 100644
--- a/src/proguard/optimize/DuplicateInitializerFixer.java
+++ b/src/proguard/optimize/DuplicateInitializerFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/DuplicateInitializerInvocationFixer.java b/src/proguard/optimize/DuplicateInitializerInvocationFixer.java
index cbfdc30..2828ff4 100644
--- a/src/proguard/optimize/DuplicateInitializerInvocationFixer.java
+++ b/src/proguard/optimize/DuplicateInitializerInvocationFixer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -131,14 +131,14 @@ implements AttributeVisitor,
// Implementations for ConstantVisitor.
- public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
+ public void visitAnyMethodrefConstant(Clazz clazz, RefConstant refConstant)
{
// Check the referenced constructor descriptor.
- if (methodrefConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT))
+ if (refConstant.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT))
{
- descriptor = methodrefConstant.getType(clazz);
+ descriptor = refConstant.getType(clazz);
- methodrefConstant.referencedMemberAccept(this);
+ refConstant.referencedMemberAccept(this);
}
}
diff --git a/src/proguard/optimize/KeepMarker.java b/src/proguard/optimize/KeepMarker.java
index c98ca6e..973d716 100644
--- a/src/proguard/optimize/KeepMarker.java
+++ b/src/proguard/optimize/KeepMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/KeptClassFilter.java b/src/proguard/optimize/KeptClassFilter.java
index c4e436f..8e63f8d 100644
--- a/src/proguard/optimize/KeptClassFilter.java
+++ b/src/proguard/optimize/KeptClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/KeptMemberFilter.java b/src/proguard/optimize/KeptMemberFilter.java
index 279c019..05cd925 100644
--- a/src/proguard/optimize/KeptMemberFilter.java
+++ b/src/proguard/optimize/KeptMemberFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/MemberDescriptorSpecializer.java b/src/proguard/optimize/MemberDescriptorSpecializer.java
index 4656092..30712f1 100644
--- a/src/proguard/optimize/MemberDescriptorSpecializer.java
+++ b/src/proguard/optimize/MemberDescriptorSpecializer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/MethodDescriptorShrinker.java b/src/proguard/optimize/MethodDescriptorShrinker.java
index 9b9d2fe..d925476 100644
--- a/src/proguard/optimize/MethodDescriptorShrinker.java
+++ b/src/proguard/optimize/MethodDescriptorShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -30,6 +30,8 @@ import proguard.classfile.visitor.MemberVisitor;
import proguard.optimize.info.*;
import proguard.optimize.peephole.VariableShrinker;
+import java.util.Arrays;
+
/**
* This MemberVisitor removes unused parameters in the descriptors of the
* methods that it visits.
@@ -74,15 +76,17 @@ implements MemberVisitor,
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
+ if (DEBUG)
+ {
+ System.out.println("MethodDescriptorShrinker: ["+programClass.getName()+"."+programMethod.getName(programClass)+programMethod.getDescriptor(programClass)+"]");
+ }
+
// Update the descriptor if it has any unused parameters.
String descriptor = programMethod.getDescriptor(programClass);
String newDescriptor = shrinkDescriptor(programMethod, descriptor);
- if (!descriptor.equals(newDescriptor))
+ if (!newDescriptor.equals(descriptor))
{
- // Shrink the signature and parameter annotations.
- programMethod.attributesAccept(programClass, this);
-
String name = programMethod.getName(programClass);
String newName = name;
@@ -92,14 +96,6 @@ implements MemberVisitor,
newName += ClassConstants.SPECIAL_MEMBER_SEPARATOR + Long.toHexString(Math.abs((descriptor).hashCode()));
}
- if (DEBUG)
- {
- System.out.println("MethodDescriptorShrinker:");
- System.out.println(" ["+programClass.getName()+"."+
- name+descriptor+"] -> ["+
- newName+newDescriptor+"]");
- }
-
ConstantPoolEditor constantPoolEditor =
new ConstantPoolEditor(programClass);
@@ -120,6 +116,14 @@ implements MemberVisitor,
programMethod.u2descriptorIndex =
constantPoolEditor.addUtf8Constant(newDescriptor);
+ if (DEBUG)
+ {
+ System.out.println(" -> ["+newName+newDescriptor+"]");
+ }
+
+ // Shrink the signature and parameter annotations.
+ programMethod.attributesAccept(programClass, this);
+
// Visit the method, if required.
if (extraMemberVisitor != null)
{
@@ -136,19 +140,32 @@ implements MemberVisitor,
public void visitSignatureAttribute(Clazz clazz, Method method, SignatureAttribute signatureAttribute)
{
+ if (DEBUG)
+ {
+ System.out.println(" ["+signatureAttribute.getSignature(clazz)+"]");
+ }
+
// Compute the new signature.
String signature = signatureAttribute.getSignature(clazz);
String newSignature = shrinkDescriptor(method, signature);
- // Update the signature.
- signatureAttribute.u2signatureIndex =
- new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSignature);
+ if (!newSignature.equals(signature))
+ {
+ // Update the signature.
+ signatureAttribute.u2signatureIndex =
+ new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSignature);
- // Update the referenced classes.
- signatureAttribute.referencedClasses =
- shrinkReferencedClasses(method,
- signature,
- signatureAttribute.referencedClasses);
+ // Update the referenced classes.
+ signatureAttribute.referencedClasses =
+ shrinkReferencedClasses(method,
+ signature,
+ signatureAttribute.referencedClasses);
+
+ if (DEBUG)
+ {
+ System.out.println(" -> ["+newSignature+"]");
+ }
+ }
}
@@ -210,15 +227,17 @@ implements MemberVisitor,
(method.getAccessFlags() & ClassConstants.ACC_STATIC) != 0 ?
0 : 1;
- // Go over the parameters.
InternalTypeEnumeration internalTypeEnumeration =
new InternalTypeEnumeration(descriptor);
- StringBuffer newDescriptorBuffer = new StringBuffer();
+ StringBuffer newDescriptorBuffer =
+ new StringBuffer(descriptor.length());
+ // Copy the formal type parameters.
newDescriptorBuffer.append(internalTypeEnumeration.formalTypeParameters());
newDescriptorBuffer.append(ClassConstants.METHOD_ARGUMENTS_OPEN);
+ // Go over the parameters.
while (internalTypeEnumeration.hasMoreTypes())
{
String type = internalTypeEnumeration.nextType();
@@ -234,6 +253,7 @@ implements MemberVisitor,
parameterIndex += ClassUtil.isInternalCategory2Type(type) ? 2 : 1;
}
+ // Copy the return type.
newDescriptorBuffer.append(ClassConstants.METHOD_ARGUMENTS_CLOSE);
newDescriptorBuffer.append(internalTypeEnumeration.returnType());
@@ -256,27 +276,29 @@ implements MemberVisitor,
(method.getAccessFlags() & ClassConstants.ACC_STATIC) != 0 ?
0 : 1;
- int referencedClassIndex = 0;
- int newReferencedClassIndex = 0;
-
- // Go over the parameters.
InternalTypeEnumeration internalTypeEnumeration =
new InternalTypeEnumeration(descriptor);
- // Also look at the formal type parameters.
- String type = internalTypeEnumeration.formalTypeParameters();
- int count = new DescriptorClassEnumeration(type).classCount();
- for (int counter = 0; counter < count; counter++)
+ int referencedClassIndex = 0;
+ int newReferencedClassIndex = 0;
+
+ // Copy the formal type parameters.
{
- referencedClasses[newReferencedClassIndex++] =
- referencedClasses[referencedClassIndex++];
+ String type = internalTypeEnumeration.formalTypeParameters();
+ int count = new DescriptorClassEnumeration(type).classCount();
+ for (int counter = 0; counter < count; counter++)
+ {
+ referencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
}
+ // Go over the parameters.
while (internalTypeEnumeration.hasMoreTypes())
{
// Consider the classes referenced by this parameter type.
- type = internalTypeEnumeration.nextType();
- count = new DescriptorClassEnumeration(type).classCount();
+ String type = internalTypeEnumeration.nextType();
+ int count = new DescriptorClassEnumeration(type).classCount();
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
{
@@ -296,19 +318,30 @@ implements MemberVisitor,
parameterIndex += ClassUtil.isInternalCategory2Type(type) ? 2 : 1;
}
- // Also look at the return value.
- type = internalTypeEnumeration.returnType();
- count = new DescriptorClassEnumeration(type).classCount();
- for (int counter = 0; counter < count; counter++)
+ // Copy the return type.
{
- referencedClasses[newReferencedClassIndex++] =
- referencedClasses[referencedClassIndex++];
+ String type = internalTypeEnumeration.returnType();
+ int count = new DescriptorClassEnumeration(type).classCount();
+ for (int counter = 0; counter < count; counter++)
+ {
+ referencedClasses[newReferencedClassIndex++] =
+ referencedClasses[referencedClassIndex++];
+ }
}
- // Clear the unused entries.
- while (newReferencedClassIndex < referencedClassIndex)
+ // Shrink the array to the proper size.
+ if (newReferencedClassIndex == 0)
{
- referencedClasses[newReferencedClassIndex++] = null;
+ referencedClasses = null;
+ }
+ else if (newReferencedClassIndex < referencedClassIndex)
+ {
+ Clazz[] newReferencedClasses = new Clazz[newReferencedClassIndex];
+ System.arraycopy(referencedClasses, 0,
+ newReferencedClasses, 0,
+ newReferencedClassIndex);
+
+ referencedClasses = newReferencedClasses;
}
}
diff --git a/src/proguard/optimize/MethodStaticizer.java b/src/proguard/optimize/MethodStaticizer.java
index c672bfa..e5357aa 100644
--- a/src/proguard/optimize/MethodStaticizer.java
+++ b/src/proguard/optimize/MethodStaticizer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/OptimizationInfoMemberFilter.java b/src/proguard/optimize/OptimizationInfoMemberFilter.java
index bbfac20..d82daa5 100644
--- a/src/proguard/optimize/OptimizationInfoMemberFilter.java
+++ b/src/proguard/optimize/OptimizationInfoMemberFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/Optimizer.java b/src/proguard/optimize/Optimizer.java
index dcb558c..5ab452c 100644
--- a/src/proguard/optimize/Optimizer.java
+++ b/src/proguard/optimize/Optimizer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -283,14 +283,31 @@ public class Optimizer
new MethodrefTraveler(
new ReferencedMemberVisitor(keepMarker))))))));
- // We also keep all methods of classes that are returned by dynamic
+ // We also keep all bootstrap method arguments that point to methods.
+ // These arguments are typically the method handles for
+ // java.lang.invoke.LambdaMetafactory#metafactory, which provides the
+ // implementations for closures.
+ programClassPool.classesAccept(
+ new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_7,
+ new AllAttributeVisitor(
+ new AttributeNameFilter(ClassConstants.ATTR_BootstrapMethods,
+ new AllBootstrapMethodInfoVisitor(
+ new BootstrapMethodArgumentVisitor(
+ new MethodrefTraveler(
+ new ReferencedMemberVisitor(keepMarker))))))));
+
+ // We also keep all classes (and their methods) returned by dynamic
// method invocations. They may return dynamic implementations of
// interfaces that otherwise appear unused.
programClassPool.classesAccept(
new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_7,
new AllConstantVisitor(
new DynamicReturnedClassVisitor(
- new AllMemberVisitor(keepMarker)))));
+ new MultiClassVisitor(new ClassVisitor[]
+ {
+ keepMarker,
+ new AllMemberVisitor(keepMarker)
+ })))));
// Attach some optimization info to all classes and class members, so
// it can be filled out later.
diff --git a/src/proguard/optimize/ParameterShrinker.java b/src/proguard/optimize/ParameterShrinker.java
index 624581c..efe48a9 100644
--- a/src/proguard/optimize/ParameterShrinker.java
+++ b/src/proguard/optimize/ParameterShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -29,7 +29,7 @@ import proguard.classfile.visitor.MemberVisitor;
import proguard.optimize.info.ParameterUsageMarker;
/**
- * This MemberVisitor removes unused parameters from the code of the methods
+ * This AttributeVisitor removes unused parameters from the code of the methods
* that it visits.
*
* @see ParameterUsageMarker
diff --git a/src/proguard/optimize/TailRecursionSimplifier.java b/src/proguard/optimize/TailRecursionSimplifier.java
index dd38d6b..c2dec73 100644
--- a/src/proguard/optimize/TailRecursionSimplifier.java
+++ b/src/proguard/optimize/TailRecursionSimplifier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/WriteOnlyFieldFilter.java b/src/proguard/optimize/WriteOnlyFieldFilter.java
index 7aad651..98633f8 100644
--- a/src/proguard/optimize/WriteOnlyFieldFilter.java
+++ b/src/proguard/optimize/WriteOnlyFieldFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/EvaluationShrinker.java b/src/proguard/optimize/evaluation/EvaluationShrinker.java
index 268eb02..c98fea9 100644
--- a/src/proguard/optimize/evaluation/EvaluationShrinker.java
+++ b/src/proguard/optimize/evaluation/EvaluationShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -2074,14 +2074,14 @@ implements AttributeVisitor
int variableIndex)
{
// Wasn't the variable set yet?
- Value valueBefore = partialEvaluator.getVariablesBefore(instructionOffset).getValue(variableIndex);
+ Value valueBefore = simplePartialEvaluator.getVariablesBefore(instructionOffset).getValue(variableIndex);
if (valueBefore == null)
{
return true;
}
// Is the computational type different now?
- Value valueAfter = partialEvaluator.getVariablesAfter(instructionOffset).getValue(variableIndex);
+ Value valueAfter = simplePartialEvaluator.getVariablesAfter(instructionOffset).getValue(variableIndex);
if (valueAfter.computationalType() != valueBefore.computationalType())
{
return true;
@@ -2096,7 +2096,7 @@ implements AttributeVisitor
}
// Was the producer an argument (which may be removed)?
- Value producersBefore = partialEvaluator.getVariablesBefore(instructionOffset).getProducerValue(variableIndex);
+ Value producersBefore = simplePartialEvaluator.getVariablesBefore(instructionOffset).getProducerValue(variableIndex);
return producersBefore.instructionOffsetValue().instructionOffsetCount() == 1 &&
producersBefore.instructionOffsetValue().instructionOffset(0) == PartialEvaluator.AT_METHOD_ENTRY;
}
diff --git a/src/proguard/optimize/evaluation/EvaluationSimplifier.java b/src/proguard/optimize/evaluation/EvaluationSimplifier.java
index 8187342..19498aa 100644
--- a/src/proguard/optimize/evaluation/EvaluationSimplifier.java
+++ b/src/proguard/optimize/evaluation/EvaluationSimplifier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -184,7 +184,14 @@ implements AttributeVisitor,
case InstructionConstants.OP_I2C:
case InstructionConstants.OP_I2S:
case InstructionConstants.OP_ARRAYLENGTH:
- replaceIntegerPushInstruction(clazz, offset, simpleInstruction);
+ if (!sideEffectInstructionChecker.hasSideEffects(clazz,
+ method,
+ codeAttribute,
+ offset,
+ simpleInstruction))
+ {
+ replaceIntegerPushInstruction(clazz, offset, simpleInstruction);
+ }
break;
case InstructionConstants.OP_LALOAD:
@@ -203,7 +210,14 @@ implements AttributeVisitor,
case InstructionConstants.OP_I2L:
case InstructionConstants.OP_F2L:
case InstructionConstants.OP_D2L:
- replaceLongPushInstruction(clazz, offset, simpleInstruction);
+ if (!sideEffectInstructionChecker.hasSideEffects(clazz,
+ method,
+ codeAttribute,
+ offset,
+ simpleInstruction))
+ {
+ replaceLongPushInstruction(clazz, offset, simpleInstruction);
+ }
break;
case InstructionConstants.OP_FALOAD:
@@ -216,7 +230,14 @@ implements AttributeVisitor,
case InstructionConstants.OP_I2F:
case InstructionConstants.OP_L2F:
case InstructionConstants.OP_D2F:
- replaceFloatPushInstruction(clazz, offset, simpleInstruction);
+ if (!sideEffectInstructionChecker.hasSideEffects(clazz,
+ method,
+ codeAttribute,
+ offset,
+ simpleInstruction))
+ {
+ replaceFloatPushInstruction(clazz, offset, simpleInstruction);
+ }
break;
case InstructionConstants.OP_DALOAD:
@@ -229,11 +250,25 @@ implements AttributeVisitor,
case InstructionConstants.OP_I2D:
case InstructionConstants.OP_L2D:
case InstructionConstants.OP_F2D:
- replaceDoublePushInstruction(clazz, offset, simpleInstruction);
+ if (!sideEffectInstructionChecker.hasSideEffects(clazz,
+ method,
+ codeAttribute,
+ offset,
+ simpleInstruction))
+ {
+ replaceDoublePushInstruction(clazz, offset, simpleInstruction);
+ }
break;
case InstructionConstants.OP_AALOAD:
- replaceReferencePushInstruction(clazz, offset, simpleInstruction);
+ if (!sideEffectInstructionChecker.hasSideEffects(clazz,
+ method,
+ codeAttribute,
+ offset,
+ simpleInstruction))
+ {
+ replaceReferencePushInstruction(clazz, offset, simpleInstruction);
+ }
break;
}
}
@@ -306,9 +341,6 @@ implements AttributeVisitor,
{
case InstructionConstants.OP_GETSTATIC:
case InstructionConstants.OP_GETFIELD:
- replaceAnyPushInstruction(clazz, offset, constantInstruction);
- break;
-
case InstructionConstants.OP_INVOKEVIRTUAL:
case InstructionConstants.OP_INVOKESPECIAL:
case InstructionConstants.OP_INVOKESTATIC:
diff --git a/src/proguard/optimize/evaluation/LivenessAnalyzer.java b/src/proguard/optimize/evaluation/LivenessAnalyzer.java
index 87bd4e5..07ada7d 100644
--- a/src/proguard/optimize/evaluation/LivenessAnalyzer.java
+++ b/src/proguard/optimize/evaluation/LivenessAnalyzer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/LoadingInvocationUnit.java b/src/proguard/optimize/evaluation/LoadingInvocationUnit.java
index 80b4b84..3327a2c 100644
--- a/src/proguard/optimize/evaluation/LoadingInvocationUnit.java
+++ b/src/proguard/optimize/evaluation/LoadingInvocationUnit.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/PartialEvaluator.java b/src/proguard/optimize/evaluation/PartialEvaluator.java
index 9b20814..0eb5e08 100644
--- a/src/proguard/optimize/evaluation/PartialEvaluator.java
+++ b/src/proguard/optimize/evaluation/PartialEvaluator.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -71,6 +71,7 @@ implements AttributeVisitor,
private boolean[] generalizedContexts = new boolean[ClassConstants.TYPICAL_CODE_LENGTH];
private int[] evaluationCounts = new int[ClassConstants.TYPICAL_CODE_LENGTH];
private boolean evaluateExceptions;
+ private int codeLength;
private final BasicBranchUnit branchUnit;
private final BranchTargetFinder branchTargetFinder;
@@ -299,7 +300,7 @@ implements AttributeVisitor,
if (isTraced(offset))
{
int initializationOffset = branchTargetFinder.initializationOffset(offset);
- if (initializationOffset != NONE)
+ if (initializationOffset >= 0)
{
System.out.println(" is to be initialized at ["+initializationOffset+"]");
}
@@ -1111,30 +1112,30 @@ implements AttributeVisitor,
*/
private void initializeArrays(CodeAttribute codeAttribute)
{
- int codeLength = codeAttribute.u4codeLength;
+ int newCodeLength = codeAttribute.u4codeLength;
// Create new arrays for storing information at each instruction offset.
- if (variablesAfter.length < codeLength)
+ if (branchOriginValues.length < newCodeLength)
{
// Create new arrays.
- branchOriginValues = new InstructionOffsetValue[codeLength];
- branchTargetValues = new InstructionOffsetValue[codeLength];
- variablesBefore = new TracedVariables[codeLength];
- stacksBefore = new TracedStack[codeLength];
- variablesAfter = new TracedVariables[codeLength];
- stacksAfter = new TracedStack[codeLength];
- generalizedContexts = new boolean[codeLength];
- evaluationCounts = new int[codeLength];
+ branchOriginValues = new InstructionOffsetValue[newCodeLength];
+ branchTargetValues = new InstructionOffsetValue[newCodeLength];
+ variablesBefore = new TracedVariables[newCodeLength];
+ stacksBefore = new TracedStack[newCodeLength];
+ variablesAfter = new TracedVariables[newCodeLength];
+ stacksAfter = new TracedStack[newCodeLength];
+ generalizedContexts = new boolean[newCodeLength];
+ evaluationCounts = new int[newCodeLength];
}
else
{
- // Reset the arrays.
- Arrays.fill(branchOriginValues, null);
- Arrays.fill(branchTargetValues, null);
- Arrays.fill(generalizedContexts, false);
- Arrays.fill(evaluationCounts, 0);
+ // Reset the old arrays.
+ Arrays.fill(branchOriginValues, 0, codeLength, null);
+ Arrays.fill(branchTargetValues, 0, codeLength, null);
+ Arrays.fill(generalizedContexts, 0, codeLength, false);
+ Arrays.fill(evaluationCounts, 0, codeLength, 0);
- for (int index = 0; index < codeLength; index++)
+ for (int index = 0; index < newCodeLength; index++)
{
if (variablesBefore[index] != null)
{
@@ -1156,7 +1157,32 @@ implements AttributeVisitor,
stacksAfter[index].reset(codeAttribute.u2maxStack);
}
}
+
+ for (int index = newCodeLength; index < codeLength; index++)
+ {
+ if (variablesBefore[index] != null)
+ {
+ variablesBefore[index].reset(0);
+ }
+
+ if (stacksBefore[index] != null)
+ {
+ stacksBefore[index].reset(0);
+ }
+
+ if (variablesAfter[index] != null)
+ {
+ variablesAfter[index].reset(0);
+ }
+
+ if (stacksAfter[index] != null)
+ {
+ stacksAfter[index].reset(0);
+ }
+ }
}
+
+ codeLength = newCodeLength;
}
diff --git a/src/proguard/optimize/evaluation/SimpleEnumArrayPropagator.java b/src/proguard/optimize/evaluation/SimpleEnumArrayPropagator.java
index d6aaf7d..ca9996a 100644
--- a/src/proguard/optimize/evaluation/SimpleEnumArrayPropagator.java
+++ b/src/proguard/optimize/evaluation/SimpleEnumArrayPropagator.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/SimpleEnumClassChecker.java b/src/proguard/optimize/evaluation/SimpleEnumClassChecker.java
index 1bd5008..457879d 100644
--- a/src/proguard/optimize/evaluation/SimpleEnumClassChecker.java
+++ b/src/proguard/optimize/evaluation/SimpleEnumClassChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/SimpleEnumClassSimplifier.java b/src/proguard/optimize/evaluation/SimpleEnumClassSimplifier.java
index 33f775f..baf32ce 100644
--- a/src/proguard/optimize/evaluation/SimpleEnumClassSimplifier.java
+++ b/src/proguard/optimize/evaluation/SimpleEnumClassSimplifier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/SimpleEnumDescriptorSimplifier.java b/src/proguard/optimize/evaluation/SimpleEnumDescriptorSimplifier.java
index b92cbd1..fab990c 100644
--- a/src/proguard/optimize/evaluation/SimpleEnumDescriptorSimplifier.java
+++ b/src/proguard/optimize/evaluation/SimpleEnumDescriptorSimplifier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -54,35 +54,7 @@ implements ClassVisitor,
private static boolean DEBUG = System.getProperty("enum") != null;
//*/
- private final InstructionVisitor extraInstructionVisitor;
-
- private final PartialEvaluator partialEvaluator;
- private final CodeAttributeEditor codeAttributeEditor = new CodeAttributeEditor(false, true);
-
-
- /**
- * Creates a new SimpleEnumDescriptorSimplifier.
- */
- public SimpleEnumDescriptorSimplifier()
- {
- this(new PartialEvaluator(), null);
- }
-
-
- /**
- * Creates a new SimpleEnumDescriptorSimplifier.
- * @param partialEvaluator the partial evaluator that will
- * execute the code and provide
- * information about the results.
- * @param extraInstructionVisitor an optional extra visitor for all
- * simplified instructions.
- */
- public SimpleEnumDescriptorSimplifier(PartialEvaluator partialEvaluator,
- InstructionVisitor extraInstructionVisitor)
- {
- this.partialEvaluator = partialEvaluator;
- this.extraInstructionVisitor = extraInstructionVisitor;
- }
+ private static final boolean DEBUG_EXTRA = false;
// Implementations for ClassVisitor.
@@ -152,6 +124,10 @@ implements ClassVisitor,
invokeDynamicConstant.u2nameAndTypeIndex =
constantPoolEditor.addNameAndTypeConstant(invokeDynamicConstant.getName(clazz),
newDescriptor);
+
+ // Update the referenced classes.
+ invokeDynamicConstant.referencedClasses =
+ simplifyReferencedClasses(descriptor, invokeDynamicConstant.referencedClasses);
}
}
@@ -273,6 +249,10 @@ implements ClassVisitor,
// Update the descriptor itself.
programMethod.u2descriptorIndex =
constantPoolEditor.addUtf8Constant(newDescriptor);
+
+ // Update the referenced classes.
+ programMethod.referencedClasses =
+ simplifyReferencedClasses(descriptor, programMethod.referencedClasses);
}
}
@@ -303,31 +283,7 @@ implements ClassVisitor,
}
- public void visitSignatureAttribute(Clazz clazz, Field field, SignatureAttribute signatureAttribute)
- {
- // We're only looking at the base type for now.
- if (signatureAttribute.referencedClasses != null &&
- signatureAttribute.referencedClasses.length > 0)
- {
- // Update the signature if it has any simple enum classes.
- String signature = signatureAttribute.getSignature(clazz);
- String newSignature = simplifyDescriptor(signature,
- signatureAttribute.referencedClasses[0]);
-
- if (!signature.equals(newSignature))
- {
- // Update the signature.
- signatureAttribute.u2signatureIndex =
- new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSignature);
-
- // Clear the referenced class.
- signatureAttribute.referencedClasses[0] = null;
- }
- }
- }
-
-
- public void visitSignatureAttribute(Clazz clazz, Method method, SignatureAttribute signatureAttribute)
+ public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
{
// Compute the new signature.
String signature = signatureAttribute.getSignature(clazz);
@@ -339,6 +295,10 @@ implements ClassVisitor,
// Update the signature.
signatureAttribute.u2signatureIndex =
new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSignature);
+
+ // Update the referenced classes.
+ signatureAttribute.referencedClasses =
+ simplifyReferencedClasses(signature, signatureAttribute.referencedClasses);
}
}
@@ -404,105 +364,401 @@ implements ClassVisitor,
/**
- * Returns the descriptor with simplified enum types and removes any enum
- * classes that can be simplified from the referenced classes.
+ * Returns the descriptor with simplified enum types.
*/
private String simplifyDescriptor(String descriptor,
Clazz[] referencedClasses)
{
if (referencedClasses != null)
{
- int referencedClassIndex = 0;
- int newReferencedClassIndex = 0;
+ if (DEBUG_EXTRA)
+ {
+ System.out.println(" Before: ["+descriptor+"]");
+ }
- // Go over the parameters.
- InternalTypeEnumeration internalTypeEnumeration =
+ InternalTypeEnumeration typeEnumeration =
new InternalTypeEnumeration(descriptor);
- StringBuffer newDescriptorBuffer = new StringBuffer();
+ int referencedClassIndex = 0;
- newDescriptorBuffer.append(internalTypeEnumeration.formalTypeParameters());
- newDescriptorBuffer.append(ClassConstants.METHOD_ARGUMENTS_OPEN);
+ StringBuffer newDescriptorBuffer =
+ new StringBuffer(descriptor.length());
- // Also look at the formal type parameters.
- String type = internalTypeEnumeration.formalTypeParameters();
- int count = new DescriptorClassEnumeration(type).classCount();
- for (int counter = 0; counter < count; counter++)
+ // Go over the formal type parameters.
+ if (typeEnumeration.hasFormalTypeParameters())
{
- Clazz referencedClass =
- referencedClasses[referencedClassIndex++];
+ // Consider the classes referenced by this formal type
+ // parameter.
+ String type = typeEnumeration.formalTypeParameters();
+
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(type);
- if (!isSimpleEnum(referencedClass))
+ newDescriptorBuffer.append(classEnumeration.nextFluff());
+
+ // Replace any simple enum types.
+ while (classEnumeration.hasMoreClassNames())
{
- referencedClasses[newReferencedClassIndex++] =
- referencedClass;
+ // Get the class.
+ String className =
+ classEnumeration.nextClassName();
+
+ Clazz referencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Is this class a simple enum type?
+ if (isSimpleEnum(referencedClass))
+ {
+ // Let's replace it by java.lang.Integer.
+ className = ClassConstants.NAME_JAVA_LANG_INTEGER;
+ }
+
+ newDescriptorBuffer.append(className);
+ newDescriptorBuffer.append(classEnumeration.nextFluff());
}
}
- while (internalTypeEnumeration.hasMoreTypes())
+ if (typeEnumeration.isMethodSignature())
+ {
+ newDescriptorBuffer.append(ClassConstants.METHOD_ARGUMENTS_OPEN);
+ }
+
+ // Go over the main types (class types or parameter types).
+ while (typeEnumeration.hasMoreTypes())
{
// Consider the classes referenced by this parameter type.
- type = internalTypeEnumeration.nextType();
- count = new DescriptorClassEnumeration(type).classCount();
+ String type = typeEnumeration.nextType();
+
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(type);
- // Copy the referenced classes.
- for (int counter = 0; counter < count; counter++)
+ String firstFluff = classEnumeration.nextFluff();
+
+ if (classEnumeration.hasMoreClassNames())
{
- Clazz referencedClass =
+ // Get the first class.
+ String firstClassName =
+ classEnumeration.nextClassName();
+
+ Clazz firstReferencedClass =
referencedClasses[referencedClassIndex++];
- if (!isSimpleEnum(referencedClass))
+ // Is the first class a simple enum type?
+ if (isSimpleEnum(firstReferencedClass))
{
- referencedClasses[newReferencedClassIndex++] =
- referencedClass;
+ // Replace it by a primitive int, with any array
+ // prefix.
+ newDescriptorBuffer.append(type.substring(0, ClassUtil.internalArrayTypeDimensionCount(type)));
+ newDescriptorBuffer.append(ClassConstants.TYPE_INT);
+
+ // Skip any other classes of this type.
+ classEnumeration.nextFluff();
+ while (classEnumeration.hasMoreClassNames())
+ {
+ classEnumeration.nextClassName();
+ classEnumeration.nextFluff();
+
+ referencedClassIndex++;
+ }
}
else
{
- type =
- type.substring(0, ClassUtil.internalArrayTypeDimensionCount(type)) +
- ClassConstants.TYPE_INT;
+ newDescriptorBuffer.append(firstFluff);
+ newDescriptorBuffer.append(firstClassName);
+ newDescriptorBuffer.append(classEnumeration.nextFluff());
+
+ // Replace any other simple enum types.
+ while (classEnumeration.hasMoreClassNames())
+ {
+ // Get the class.
+ String className =
+ classEnumeration.nextClassName();
+
+ Clazz referencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Is this class a simple enum type?
+ if (isSimpleEnum(referencedClass))
+ {
+ // Let's replace it by java.lang.Integer.
+ className = ClassConstants.NAME_JAVA_LANG_INTEGER;
+ }
+
+ newDescriptorBuffer.append(className);
+ newDescriptorBuffer.append(classEnumeration.nextFluff());
+ }
}
}
+ else
+ {
+ newDescriptorBuffer.append(firstFluff);
+ }
+ }
+
+ if (typeEnumeration.isMethodSignature())
+ {
+ newDescriptorBuffer.append(ClassConstants.METHOD_ARGUMENTS_CLOSE);
+
+ // Consider the classes referenced by the return type.
+ String type = typeEnumeration.returnType();
- newDescriptorBuffer.append(type);
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(type);
+
+ String firstFluff = classEnumeration.nextFluff();
+
+ if (classEnumeration.hasMoreClassNames())
+ {
+ // Get the first class.
+ String firstClassName =
+ classEnumeration.nextClassName();
+
+ Clazz firstReferencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Is the first class a simple enum type?
+ if (isSimpleEnum(firstReferencedClass))
+ {
+ // Replace it by a primitive int, with any array
+ // prefix.
+ newDescriptorBuffer.append(type.substring(0, ClassUtil.internalArrayTypeDimensionCount(type)));
+ newDescriptorBuffer.append(ClassConstants.TYPE_INT);
+ }
+ else
+ {
+ newDescriptorBuffer.append(firstFluff);
+ newDescriptorBuffer.append(firstClassName);
+ newDescriptorBuffer.append(classEnumeration.nextFluff());
+
+ // Replace any other simple enum types.
+ while (classEnumeration.hasMoreClassNames())
+ {
+ // Get the class.
+ String className =
+ classEnumeration.nextClassName();
+
+ Clazz referencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Is this class a simple enum type?
+ if (isSimpleEnum(referencedClass))
+ {
+ // Let's replace it by java.lang.Integer.
+ className = ClassConstants.NAME_JAVA_LANG_INTEGER;
+ }
+
+ newDescriptorBuffer.append(className);
+ newDescriptorBuffer.append(classEnumeration.nextFluff());
+ }
+ }
+ }
+ else
+ {
+ newDescriptorBuffer.append(firstFluff);
+ }
+ }
+
+ descriptor = newDescriptorBuffer.toString();
+
+ if (DEBUG_EXTRA)
+ {
+ System.out.println(" After: ["+descriptor+"]");
+ }
+ }
+
+ return descriptor;
+ }
+
+
+ /**
+ * Returns the simplified and shrunk array of referenced classes for the
+ * given descriptor.
+ */
+ private Clazz[] simplifyReferencedClasses(String descriptor,
+ Clazz[] referencedClasses)
+ {
+ if (referencedClasses != null)
+ {
+ if (DEBUG_EXTRA)
+ {
+ System.out.print(" Referenced before:");
+ for (int index = 0; index < referencedClasses.length; index++)
+ {
+ System.out.print(" ["+(referencedClasses[index] == null ? null : referencedClasses[index].getName())+"]");
+ }
+ System.out.println();
}
- // Also look at the return value.
- type = internalTypeEnumeration.returnType();
- count = new DescriptorClassEnumeration(type).classCount();
+ InternalTypeEnumeration typeEnumeration =
+ new InternalTypeEnumeration(descriptor);
+
+ int referencedClassIndex = 0;
+ int newReferencedClassIndex = 0;
- for (int counter = 0; counter < count; counter++)
+ // Go over the formal type parameters.
+ if (typeEnumeration.hasFormalTypeParameters())
{
- Clazz referencedClass =
- referencedClasses[referencedClassIndex++];
+ // Consider the classes referenced by this formal type
+ // parameter.
+ String type = typeEnumeration.formalTypeParameters();
+
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(type);
+
+ classEnumeration.nextFluff();
- if (!isSimpleEnum(referencedClass))
+ // Replace any simple enum types.
+ while (classEnumeration.hasMoreClassNames())
{
+ // Get the class.
+ classEnumeration.nextClassName();
+ classEnumeration.nextFluff();
+
+ Clazz referencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Clear the referenced class if it is a simple
+ // enum type (now java.lang.Integer).
referencedClasses[newReferencedClassIndex++] =
- referencedClass;
+ isSimpleEnum(referencedClass) ? null : referencedClass;
}
- else
+ }
+
+ // Go over the main types (class types or parameter types).
+ while (typeEnumeration.hasMoreTypes())
+ {
+ // Consider the classes referenced by this parameter type.
+ String type = typeEnumeration.nextType();
+
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(type);
+
+ classEnumeration.nextFluff();
+
+ if (classEnumeration.hasMoreClassNames())
{
- type =
- type.substring(0, ClassUtil.internalArrayTypeDimensionCount(
- type)) +
- ClassConstants.TYPE_INT;
+ // Get the first class.
+ classEnumeration.nextClassName();
+ classEnumeration.nextFluff();
+
+ Clazz firstReferencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Is the first class a simple enum type?
+ if (isSimpleEnum(firstReferencedClass))
+ {
+ // Replace it by a primitive int.
+
+ // Skip any other classes of this type.
+ classEnumeration.nextFluff();
+ while (classEnumeration.hasMoreClassNames())
+ {
+ classEnumeration.nextClassName();
+ classEnumeration.nextFluff();
+
+ referencedClassIndex++;
+ }
+ }
+ else
+ {
+ referencedClasses[newReferencedClassIndex++] =
+ firstReferencedClass;
+
+ // Replace any other simple enum types.
+ while (classEnumeration.hasMoreClassNames())
+ {
+ // Get the class.
+ classEnumeration.nextClassName();
+ classEnumeration.nextFluff();
+
+ Clazz referencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Clear the referenced class if it is a simple
+ // enum type (now java.lang.Integer).
+ referencedClasses[newReferencedClassIndex++] =
+ isSimpleEnum(referencedClass) ? null : referencedClass;
+ }
+ }
}
}
- newDescriptorBuffer.append(ClassConstants.METHOD_ARGUMENTS_CLOSE);
- newDescriptorBuffer.append(type);
+ if (typeEnumeration.isMethodSignature())
+ {
+ // Consider the classes referenced by the return type.
+ String type = typeEnumeration.returnType();
+
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(type);
+
+ classEnumeration.nextFluff();
+
+ if (classEnumeration.hasMoreClassNames())
+ {
+ // Get the first class.
+ classEnumeration.nextClassName();
+ classEnumeration.nextFluff();
+
+ Clazz firstReferencedClass =
+ referencedClasses[referencedClassIndex++];
- // Clear the unused entries.
- while (newReferencedClassIndex < referencedClassIndex)
+ // Is the first class a simple enum type?
+ if (isSimpleEnum(firstReferencedClass))
+ {
+ // Replace it by a primitive int.
+ // Clear all remaining referenced classes.
+ }
+ else
+ {
+ referencedClasses[newReferencedClassIndex++] =
+ firstReferencedClass;
+
+ // Replace any other simple enum types.
+ while (classEnumeration.hasMoreClassNames())
+ {
+ // Get the class.
+ classEnumeration.nextClassName();
+ classEnumeration.nextFluff();
+
+ Clazz referencedClass =
+ referencedClasses[referencedClassIndex++];
+
+ // Clear the referenced class if it is a simple
+ // enum type (now java.lang.Integer).
+ referencedClasses[newReferencedClassIndex++] =
+ isSimpleEnum(referencedClass) ? null : referencedClass;
+ }
+ }
+ }
+ }
+
+ // Shrink the array to the proper size.
+ if (newReferencedClassIndex == 0)
{
- referencedClasses[newReferencedClassIndex++] = null;
+ referencedClasses = null;
}
+ else if (newReferencedClassIndex < referencedClassIndex)
+ {
+ Clazz[] newReferencedClasses = new Clazz[newReferencedClassIndex];
+ System.arraycopy(referencedClasses, 0,
+ newReferencedClasses, 0,
+ newReferencedClassIndex);
- descriptor = newDescriptorBuffer.toString();
+ referencedClasses = newReferencedClasses;
+
+ if (DEBUG_EXTRA)
+ {
+ System.out.print(" Referenced after: ");
+ for (int index = 0; index < referencedClasses.length; index++)
+ {
+ System.out.print(" ["+(referencedClasses[index] == null ? null : referencedClasses[index].getName())+"]");
+ }
+ System.out.println();
+ }
+ }
}
- return descriptor;
+ return referencedClasses;
}
diff --git a/src/proguard/optimize/evaluation/SimpleEnumUseChecker.java b/src/proguard/optimize/evaluation/SimpleEnumUseChecker.java
index b748c68..7d348cb 100644
--- a/src/proguard/optimize/evaluation/SimpleEnumUseChecker.java
+++ b/src/proguard/optimize/evaluation/SimpleEnumUseChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -635,12 +635,10 @@ implements ClassVisitor,
if (referencedClasses != null)
{
- int returnedClassIndex =
- new DescriptorClassEnumeration(descriptor).classCount() - 1;
+ Clazz referencedClass =
+ referencedClasses[referencedClasses.length - 1];
- Clazz returnedClass = referencedClasses[returnedClassIndex];
-
- return isSimpleEnum(returnedClass);
+ return isSimpleEnum(referencedClass);
}
}
diff --git a/src/proguard/optimize/evaluation/SimpleEnumUseSimplifier.java b/src/proguard/optimize/evaluation/SimpleEnumUseSimplifier.java
index b5a2396..ea845ee 100644
--- a/src/proguard/optimize/evaluation/SimpleEnumUseSimplifier.java
+++ b/src/proguard/optimize/evaluation/SimpleEnumUseSimplifier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -483,10 +483,8 @@ implements AttributeVisitor,
if (referencedClasses != null)
{
- int returnedClassIndex =
- new DescriptorClassEnumeration(descriptor).classCount() - 1;
-
- Clazz returnedClass = referencedClasses[returnedClassIndex];
+ Clazz returnedClass =
+ referencedClasses[referencedClasses.length - 1];
return isSimpleEnum(returnedClass);
}
diff --git a/src/proguard/optimize/evaluation/StoringInvocationUnit.java b/src/proguard/optimize/evaluation/StoringInvocationUnit.java
index 271b654..9e39a96 100644
--- a/src/proguard/optimize/evaluation/StoringInvocationUnit.java
+++ b/src/proguard/optimize/evaluation/StoringInvocationUnit.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/TracedBranchUnit.java b/src/proguard/optimize/evaluation/TracedBranchUnit.java
index 9e55275..964181a 100644
--- a/src/proguard/optimize/evaluation/TracedBranchUnit.java
+++ b/src/proguard/optimize/evaluation/TracedBranchUnit.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/evaluation/VariableOptimizer.java b/src/proguard/optimize/evaluation/VariableOptimizer.java
index bef1445..0fc8a8d 100644
--- a/src/proguard/optimize/evaluation/VariableOptimizer.java
+++ b/src/proguard/optimize/evaluation/VariableOptimizer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/AccessMethodMarker.java b/src/proguard/optimize/info/AccessMethodMarker.java
index 4c3c17b..18581f1 100644
--- a/src/proguard/optimize/info/AccessMethodMarker.java
+++ b/src/proguard/optimize/info/AccessMethodMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/BackwardBranchMarker.java b/src/proguard/optimize/info/BackwardBranchMarker.java
index 089b66e..8229d9c 100644
--- a/src/proguard/optimize/info/BackwardBranchMarker.java
+++ b/src/proguard/optimize/info/BackwardBranchMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/CatchExceptionMarker.java b/src/proguard/optimize/info/CatchExceptionMarker.java
index 2894d2a..1e234b7 100644
--- a/src/proguard/optimize/info/CatchExceptionMarker.java
+++ b/src/proguard/optimize/info/CatchExceptionMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/CaughtClassFilter.java b/src/proguard/optimize/info/CaughtClassFilter.java
index 0c32151..f79292a 100644
--- a/src/proguard/optimize/info/CaughtClassFilter.java
+++ b/src/proguard/optimize/info/CaughtClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/CaughtClassMarker.java b/src/proguard/optimize/info/CaughtClassMarker.java
index 31ee1a8..c021add 100644
--- a/src/proguard/optimize/info/CaughtClassMarker.java
+++ b/src/proguard/optimize/info/CaughtClassMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/ClassOptimizationInfo.java b/src/proguard/optimize/info/ClassOptimizationInfo.java
index 5ac56f9..b24fa7a 100644
--- a/src/proguard/optimize/info/ClassOptimizationInfo.java
+++ b/src/proguard/optimize/info/ClassOptimizationInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/ClassOptimizationInfoSetter.java b/src/proguard/optimize/info/ClassOptimizationInfoSetter.java
index b9211e7..67310fa 100644
--- a/src/proguard/optimize/info/ClassOptimizationInfoSetter.java
+++ b/src/proguard/optimize/info/ClassOptimizationInfoSetter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/DotClassFilter.java b/src/proguard/optimize/info/DotClassFilter.java
index 8ab4f98..4c8d76c 100644
--- a/src/proguard/optimize/info/DotClassFilter.java
+++ b/src/proguard/optimize/info/DotClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/DotClassMarker.java b/src/proguard/optimize/info/DotClassMarker.java
index d9519ac..3b39af6 100644
--- a/src/proguard/optimize/info/DotClassMarker.java
+++ b/src/proguard/optimize/info/DotClassMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/DynamicInvocationMarker.java b/src/proguard/optimize/info/DynamicInvocationMarker.java
index daee6b4..9c70ef1 100644
--- a/src/proguard/optimize/info/DynamicInvocationMarker.java
+++ b/src/proguard/optimize/info/DynamicInvocationMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/ExceptionInstructionChecker.java b/src/proguard/optimize/info/ExceptionInstructionChecker.java
index a32a1d3..953a9c6 100644
--- a/src/proguard/optimize/info/ExceptionInstructionChecker.java
+++ b/src/proguard/optimize/info/ExceptionInstructionChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/FieldOptimizationInfo.java b/src/proguard/optimize/info/FieldOptimizationInfo.java
index 730eead..b40df80 100644
--- a/src/proguard/optimize/info/FieldOptimizationInfo.java
+++ b/src/proguard/optimize/info/FieldOptimizationInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/InstanceofClassFilter.java b/src/proguard/optimize/info/InstanceofClassFilter.java
index ab345fb..9ac480d 100644
--- a/src/proguard/optimize/info/InstanceofClassFilter.java
+++ b/src/proguard/optimize/info/InstanceofClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/InstanceofClassMarker.java b/src/proguard/optimize/info/InstanceofClassMarker.java
index 3556dd8..5b533bd 100644
--- a/src/proguard/optimize/info/InstanceofClassMarker.java
+++ b/src/proguard/optimize/info/InstanceofClassMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/InstantiationClassFilter.java b/src/proguard/optimize/info/InstantiationClassFilter.java
index 7822205..8657a81 100644
--- a/src/proguard/optimize/info/InstantiationClassFilter.java
+++ b/src/proguard/optimize/info/InstantiationClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/InstantiationClassMarker.java b/src/proguard/optimize/info/InstantiationClassMarker.java
index 3f90991..7d8fcad 100644
--- a/src/proguard/optimize/info/InstantiationClassMarker.java
+++ b/src/proguard/optimize/info/InstantiationClassMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/MemberOptimizationInfoSetter.java b/src/proguard/optimize/info/MemberOptimizationInfoSetter.java
index ad64cf9..6f2383e 100644
--- a/src/proguard/optimize/info/MemberOptimizationInfoSetter.java
+++ b/src/proguard/optimize/info/MemberOptimizationInfoSetter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/MethodInvocationMarker.java b/src/proguard/optimize/info/MethodInvocationMarker.java
index c9a9131..90ee4da 100644
--- a/src/proguard/optimize/info/MethodInvocationMarker.java
+++ b/src/proguard/optimize/info/MethodInvocationMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/MethodOptimizationInfo.java b/src/proguard/optimize/info/MethodOptimizationInfo.java
index 9bfdb50..2f8c346 100644
--- a/src/proguard/optimize/info/MethodOptimizationInfo.java
+++ b/src/proguard/optimize/info/MethodOptimizationInfo.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/NoSideEffectMethodMarker.java b/src/proguard/optimize/info/NoSideEffectMethodMarker.java
index 34549b3..9621c97 100644
--- a/src/proguard/optimize/info/NoSideEffectMethodMarker.java
+++ b/src/proguard/optimize/info/NoSideEffectMethodMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/NonPrivateMemberMarker.java b/src/proguard/optimize/info/NonPrivateMemberMarker.java
index 152e114..2da62aa 100644
--- a/src/proguard/optimize/info/NonPrivateMemberMarker.java
+++ b/src/proguard/optimize/info/NonPrivateMemberMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/PackageVisibleMemberContainingClassMarker.java b/src/proguard/optimize/info/PackageVisibleMemberContainingClassMarker.java
index 7f1dfdb..cfdb336 100644
--- a/src/proguard/optimize/info/PackageVisibleMemberContainingClassMarker.java
+++ b/src/proguard/optimize/info/PackageVisibleMemberContainingClassMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/PackageVisibleMemberInvokingClassMarker.java b/src/proguard/optimize/info/PackageVisibleMemberInvokingClassMarker.java
index 6a8e329..4be8502 100644
--- a/src/proguard/optimize/info/PackageVisibleMemberInvokingClassMarker.java
+++ b/src/proguard/optimize/info/PackageVisibleMemberInvokingClassMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/ParameterUsageMarker.java b/src/proguard/optimize/info/ParameterUsageMarker.java
index 0061148..719432f 100644
--- a/src/proguard/optimize/info/ParameterUsageMarker.java
+++ b/src/proguard/optimize/info/ParameterUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/ReadWriteFieldMarker.java b/src/proguard/optimize/info/ReadWriteFieldMarker.java
index ea98d3e..de28768 100644
--- a/src/proguard/optimize/info/ReadWriteFieldMarker.java
+++ b/src/proguard/optimize/info/ReadWriteFieldMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/SideEffectInstructionChecker.java b/src/proguard/optimize/info/SideEffectInstructionChecker.java
index 34d4872..0ca140a 100644
--- a/src/proguard/optimize/info/SideEffectInstructionChecker.java
+++ b/src/proguard/optimize/info/SideEffectInstructionChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -33,7 +33,8 @@ import java.util.*;
/**
* This class can tell whether an instruction has any side effects outside of
- * its method. Return instructions can be included or not.
+ * its method. Return instructions and local field accesses can be included or
+ * not.
*
* @see ReadWriteFieldMarker
* @see StaticInitializerContainingClassMarker
@@ -54,10 +55,18 @@ implements InstructionVisitor,
private final boolean includeLocalFieldAccess;
// A return value for the visitor methods.
+ private boolean writingField;
private Clazz referencingClass;
private boolean hasSideEffects;
+ /**
+ * Creates a new SideEffectInstructionChecker
+ * @param includeReturnInstructions specifies whether return instructions
+ * count as side effects.
+ * @param includeLocalFieldAccess specifies whether reading or writing
+ * local fields counts as side effects.
+ */
public SideEffectInstructionChecker(boolean includeReturnInstructions,
boolean includeLocalFieldAccess)
{
@@ -169,16 +178,53 @@ implements InstructionVisitor,
switch (opcode)
{
case InstructionConstants.OP_GETSTATIC:
+ // Check if accessing the field might cause any side effects.
+ writingField = false;
+ clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
+ break;
+
case InstructionConstants.OP_PUTSTATIC:
- case InstructionConstants.OP_INVOKESPECIAL:
- case InstructionConstants.OP_INVOKESTATIC:
- // Check if the field is write-only or volatile, or if the
- // invoked method is causing any side effects.
+ // Check if accessing the field might cause any side effects.
+ writingField = true;
clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
break;
case InstructionConstants.OP_GETFIELD:
+ if (OPTIMIZE_CONSERVATIVELY)
+ {
+ // These instructions strictly taken may cause a side effect
+ // (NullPointerException).
+ hasSideEffects = true;
+ }
+ else
+ {
+ // Check if the field is write-only or volatile.
+ writingField = false;
+ clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
+ }
+ break;
+
case InstructionConstants.OP_PUTFIELD:
+ if (OPTIMIZE_CONSERVATIVELY)
+ {
+ // These instructions strictly taken may cause a side effect
+ // (NullPointerException).
+ hasSideEffects = true;
+ }
+ else
+ {
+ // Check if the field is write-only or volatile.
+ writingField = true;
+ clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
+ }
+ break;
+
+ case InstructionConstants.OP_INVOKESPECIAL:
+ case InstructionConstants.OP_INVOKESTATIC:
+ // Check if the invoked method is causing any side effects.
+ clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
+ break;
+
case InstructionConstants.OP_INVOKEVIRTUAL:
case InstructionConstants.OP_INVOKEINTERFACE:
case InstructionConstants.OP_INVOKEDYNAMIC:
@@ -190,8 +236,7 @@ implements InstructionVisitor,
}
else
{
- // Check if the field is write-only or volatile, or if the
- // invoked method is causing any side effects.
+ // Check if the invoked method is causing any side effects.
clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
}
break;
@@ -263,11 +308,9 @@ implements InstructionVisitor,
{
hasSideEffects =
(includeLocalFieldAccess || !programClass.equals(referencingClass)) &&
- ((ReadWriteFieldMarker.isRead(programField) &&
- ReadWriteFieldMarker.isWritten(programField)) ||
- ((programField.getAccessFlags() & ClassConstants.ACC_VOLATILE) != 0) ||
- (!programClass.equals(referencingClass) &&
- !initializedSuperClasses(referencingClass).containsAll(initializedSuperClasses(programClass))));
+ ((writingField && ReadWriteFieldMarker.isRead(programField)) ||
+ (programField.getAccessFlags() & ClassConstants.ACC_VOLATILE) != 0 ||
+ mayHaveSideEffects(referencingClass, programClass));
}
@@ -278,8 +321,7 @@ implements InstructionVisitor,
hasSideEffects =
!NoSideEffectMethodMarker.hasNoSideEffects(programMethod) &&
(SideEffectMethodMarker.hasSideEffects(programMethod) ||
- (!programClass.equals(referencingClass) &&
- !initializedSuperClasses(referencingClass).containsAll(initializedSuperClasses(programClass))));
+ mayHaveSideEffects(referencingClass, programClass));
}
@@ -296,6 +338,21 @@ implements InstructionVisitor,
}
+ // Small utility methods.
+
+ /**
+ * Returns whether a field reference or method invocation from the
+ * referencing class to the referenced class might have any side
+ * effects.
+ */
+ private boolean mayHaveSideEffects(Clazz referencingClass, Clazz referencedClass)
+ {
+ return
+ !referencedClass.equals(referencingClass) &&
+ !initializedSuperClasses(referencingClass).containsAll(initializedSuperClasses(referencedClass));
+ }
+
+
/**
* Returns the set of superclasses and interfaces that are initialized.
*/
diff --git a/src/proguard/optimize/info/SideEffectMethodFilter.java b/src/proguard/optimize/info/SideEffectMethodFilter.java
index 3821870..1f64525 100644
--- a/src/proguard/optimize/info/SideEffectMethodFilter.java
+++ b/src/proguard/optimize/info/SideEffectMethodFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/SideEffectMethodMarker.java b/src/proguard/optimize/info/SideEffectMethodMarker.java
index 79584e1..fa65ee9 100644
--- a/src/proguard/optimize/info/SideEffectMethodMarker.java
+++ b/src/proguard/optimize/info/SideEffectMethodMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/SimpleEnumFilter.java b/src/proguard/optimize/info/SimpleEnumFilter.java
index 8db58f4..fd91610 100644
--- a/src/proguard/optimize/info/SimpleEnumFilter.java
+++ b/src/proguard/optimize/info/SimpleEnumFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/SimpleEnumMarker.java b/src/proguard/optimize/info/SimpleEnumMarker.java
index dfb1ccb..cfa3273 100644
--- a/src/proguard/optimize/info/SimpleEnumMarker.java
+++ b/src/proguard/optimize/info/SimpleEnumMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/StaticInitializerContainingClassFilter.java b/src/proguard/optimize/info/StaticInitializerContainingClassFilter.java
index ccb3d31..29c9e7c 100644
--- a/src/proguard/optimize/info/StaticInitializerContainingClassFilter.java
+++ b/src/proguard/optimize/info/StaticInitializerContainingClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/StaticInitializerContainingClassMarker.java b/src/proguard/optimize/info/StaticInitializerContainingClassMarker.java
index 12e0079..88e995d 100644
--- a/src/proguard/optimize/info/StaticInitializerContainingClassMarker.java
+++ b/src/proguard/optimize/info/StaticInitializerContainingClassMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/SuperInvocationMarker.java b/src/proguard/optimize/info/SuperInvocationMarker.java
index 990a9ea..d855c69 100644
--- a/src/proguard/optimize/info/SuperInvocationMarker.java
+++ b/src/proguard/optimize/info/SuperInvocationMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/info/VariableUsageMarker.java b/src/proguard/optimize/info/VariableUsageMarker.java
index 1d3c04a..1bacdd7 100644
--- a/src/proguard/optimize/info/VariableUsageMarker.java
+++ b/src/proguard/optimize/info/VariableUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/BranchTargetFinder.java b/src/proguard/optimize/peephole/BranchTargetFinder.java
index 507c1f8..6e2a37f 100644
--- a/src/proguard/optimize/peephole/BranchTargetFinder.java
+++ b/src/proguard/optimize/peephole/BranchTargetFinder.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/ClassFinalizer.java b/src/proguard/optimize/peephole/ClassFinalizer.java
index 1529c2c..7475064 100644
--- a/src/proguard/optimize/peephole/ClassFinalizer.java
+++ b/src/proguard/optimize/peephole/ClassFinalizer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/ClassMerger.java b/src/proguard/optimize/peephole/ClassMerger.java
index 9bcc993..9839d00 100644
--- a/src/proguard/optimize/peephole/ClassMerger.java
+++ b/src/proguard/optimize/peephole/ClassMerger.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -366,6 +366,12 @@ implements ClassVisitor,
}
+ public void visitLibraryClass(LibraryClass libraryClass)
+ {
+ // Ignore attempts to merge with a library class.
+ }
+
+
private boolean print(ProgramClass programClass, String message)
{
System.out.println("Merge ["+targetClass.getName()+"] <- ["+programClass.getName()+"] "+message);
diff --git a/src/proguard/optimize/peephole/GotoCommonCodeReplacer.java b/src/proguard/optimize/peephole/GotoCommonCodeReplacer.java
index a1f422f..b2e9c16 100644
--- a/src/proguard/optimize/peephole/GotoCommonCodeReplacer.java
+++ b/src/proguard/optimize/peephole/GotoCommonCodeReplacer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/GotoGotoReplacer.java b/src/proguard/optimize/peephole/GotoGotoReplacer.java
index bf7292b..3f0b695 100644
--- a/src/proguard/optimize/peephole/GotoGotoReplacer.java
+++ b/src/proguard/optimize/peephole/GotoGotoReplacer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/GotoReturnReplacer.java b/src/proguard/optimize/peephole/GotoReturnReplacer.java
index aa8ed9f..758ffff 100644
--- a/src/proguard/optimize/peephole/GotoReturnReplacer.java
+++ b/src/proguard/optimize/peephole/GotoReturnReplacer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/HorizontalClassMerger.java b/src/proguard/optimize/peephole/HorizontalClassMerger.java
index ef76f9b..e3aa744 100644
--- a/src/proguard/optimize/peephole/HorizontalClassMerger.java
+++ b/src/proguard/optimize/peephole/HorizontalClassMerger.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -81,10 +81,9 @@ implements ClassVisitor
{
programClass.superClassConstantAccept(new ReferencedClassVisitor(
new SubclassTraveler(
- new ProgramClassFilter(
new ClassMerger(programClass,
allowAccessModification,
mergeInterfacesAggressively,
- extraClassVisitor)))));
+ extraClassVisitor))));
}
}
\ No newline at end of file
diff --git a/src/proguard/optimize/peephole/InstructionSequenceConstants.java b/src/proguard/optimize/peephole/InstructionSequenceConstants.java
index df96dda..5a380bc 100644
--- a/src/proguard/optimize/peephole/InstructionSequenceConstants.java
+++ b/src/proguard/optimize/peephole/InstructionSequenceConstants.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/InstructionSequenceReplacer.java b/src/proguard/optimize/peephole/InstructionSequenceReplacer.java
index 6a1d872..dbbdeae 100644
--- a/src/proguard/optimize/peephole/InstructionSequenceReplacer.java
+++ b/src/proguard/optimize/peephole/InstructionSequenceReplacer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/InstructionSequencesReplacer.java b/src/proguard/optimize/peephole/InstructionSequencesReplacer.java
index 9aca05a..7ac12c1 100644
--- a/src/proguard/optimize/peephole/InstructionSequencesReplacer.java
+++ b/src/proguard/optimize/peephole/InstructionSequencesReplacer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/LineNumberLinearizer.java b/src/proguard/optimize/peephole/LineNumberLinearizer.java
new file mode 100644
index 0000000..e04a138
--- /dev/null
+++ b/src/proguard/optimize/peephole/LineNumberLinearizer.java
@@ -0,0 +1,250 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.optimize.peephole;
+
+import proguard.classfile.*;
+import proguard.classfile.attribute.*;
+import proguard.classfile.attribute.visitor.*;
+import proguard.classfile.util.*;
+import proguard.classfile.visitor.*;
+
+import java.util.*;
+
+/**
+ * This ClassVisitor disambiguates line numbers, in the classes that it
+ * visits. It shifts line numbers that originate from different classes
+ * (e.g. due to method inlining or class merging) to blocks that don't
+ * overlap with the main line numbers and with each other. The line numbers
+ * then uniquely identify the inlined and merged code in the classes.
+ *
+ * @author Eric Lafortune
+ */
+public class LineNumberLinearizer
+extends SimplifiedVisitor
+implements ClassVisitor,
+ MemberVisitor,
+ AttributeVisitor,
+ LineNumberInfoVisitor
+{
+ private static final boolean DEBUG = false;
+
+ public static final int SHIFT_ROUNDING = 1000;
+ private static final int SHIFT_ROUNDING_LIMIT = 50000;
+
+
+ private Stack enclosingLineNumbers = new Stack();
+ private LineNumberInfo previousLineNumberInfo;
+ private int highestUsedLineNumber;
+ private int currentLineNumberShift;
+
+
+ // Implementations for ClassVisitor.
+
+ public void visitProgramClass(ProgramClass programClass)
+ {
+ // Find the highest line number in the entire class.
+ LineNumberRangeFinder lineNumberRangeFinder =
+ new LineNumberRangeFinder();
+
+ programClass.methodsAccept(new AllAttributeVisitor(true,
+ new AllLineNumberInfoVisitor(
+ lineNumberRangeFinder)));
+
+ // Are there any inlined line numbers?
+ if (lineNumberRangeFinder.hasSource())
+ {
+ // Remember the minimum initial shift.
+ highestUsedLineNumber = lineNumberRangeFinder.getHighestLineNumber();
+
+ // Shift the inlined line numbers.
+ programClass.methodsAccept(this);
+ }
+ }
+
+
+ // Implementations for MemberVisitor.
+
+ public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
+ {
+ programMethod.attributesAccept(programClass, this);
+ }
+
+
+ // Implementations for AttributeVisitor.
+
+ public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}
+
+
+ public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
+ {
+ codeAttribute.attributesAccept(clazz, method, this);
+ }
+
+
+ public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
+ {
+ if (DEBUG)
+ {
+ System.out.println("LineNumberLinearizer ["+clazz.getName()+"."+method.getName(clazz)+method.getDescriptor(clazz)+"]:");
+ }
+
+ enclosingLineNumbers.clear();
+ previousLineNumberInfo = null;
+
+ // Process all line numbers.
+ lineNumberTableAttribute.lineNumbersAccept(clazz, method, codeAttribute, this);
+ }
+
+
+ // Implementations for LineNumberInfoVisitor.
+
+ public void visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
+ {
+ String source = lineNumberInfo.getSource();
+
+ if (DEBUG)
+ {
+ System.out.print(" [" + lineNumberInfo.u2startPC + "] line " + lineNumberInfo.u2lineNumber + (source == null ? "" : " [" + source + "]"));
+ }
+
+ // Is it an inlined line number?
+ if (source != null)
+ {
+ ExtendedLineNumberInfo extendedLineNumberInfo =
+ (ExtendedLineNumberInfo)lineNumberInfo;
+
+ int lineNumber = extendedLineNumberInfo.u2lineNumber;
+
+ // Are we entering or exiting a new inlined block?
+ if (previousLineNumberInfo == null ||
+ previousLineNumberInfo.getSource() != source)
+ {
+ // Are we entering a new inlined block?
+ if (lineNumber != MethodInliner.INLINED_METHOD_END_LINE_NUMBER)
+ {
+ // Remember information about the inlined block.
+ enclosingLineNumbers.push(previousLineNumberInfo != null ?
+ new MyLineNumberBlock(currentLineNumberShift,
+ previousLineNumberInfo.u2lineNumber,
+ previousLineNumberInfo.getSource()) :
+ new MyLineNumberBlock(0, 0, null));
+
+ // Parse the end line number from the source string,
+ // so we know how large a block this will be.
+ int separatorIndex1 = source.indexOf(':');
+ int separatorIndex2 = source.indexOf(':', separatorIndex1 + 1);
+
+ int startLineNumber = Integer.parseInt(source.substring(separatorIndex1 + 1, separatorIndex2));
+ int endLineNumber = Integer.parseInt(source.substring(separatorIndex2 + 1));
+
+ // Start shifting, if necessary, so the block ends up beyond
+ // the highest used line number. We're striving for rounded
+ // shifts, unless we've reached a given limit, to avoid
+ // running out of line numbers too quickly.
+ currentLineNumberShift =
+ highestUsedLineNumber > SHIFT_ROUNDING_LIMIT ?
+ highestUsedLineNumber - startLineNumber + 1 :
+ startLineNumber > highestUsedLineNumber ? 0 :
+ (highestUsedLineNumber - startLineNumber + SHIFT_ROUNDING)
+ / SHIFT_ROUNDING * SHIFT_ROUNDING;
+
+ highestUsedLineNumber = endLineNumber + currentLineNumberShift;
+
+ if (DEBUG)
+ {
+ System.out.print(" (enter with shift "+currentLineNumberShift+")");
+ }
+
+ // Apply the shift.
+ lineNumberInfo.u2lineNumber += currentLineNumberShift;
+ }
+
+ // TODO: There appear to be cases where the stack is empty at this point, so we've added a check.
+ else if (enclosingLineNumbers.isEmpty())
+ {
+ if (DEBUG)
+ {
+ System.err.println("Problem linearizing line numbers for optimized code ("+clazz.getName()+"."+method.getName(clazz)+")");
+ }
+ }
+
+ // Are we exiting an inlined block?
+ else
+ {
+ // Pop information about the enclosing line number.
+ MyLineNumberBlock lineNumberBlock =
+ (MyLineNumberBlock)enclosingLineNumbers.pop();
+
+ // Set this end of the block to the line at which it was
+ // inlined.
+ extendedLineNumberInfo.u2lineNumber = lineNumberBlock.enclosingLineNumber;
+ extendedLineNumberInfo.source = lineNumberBlock.enclosingSource;
+
+ // Reset the shift to the shift of the block.
+ currentLineNumberShift = lineNumberBlock.lineNumberShift;
+
+ if (DEBUG)
+ {
+ System.out.print(" (exit to shift "+currentLineNumberShift+")");
+ }
+ }
+ }
+ else
+ {
+ if (DEBUG)
+ {
+ System.out.print(" (apply shift "+currentLineNumberShift+")");
+ }
+
+ // Apply the shift.
+ lineNumberInfo.u2lineNumber += currentLineNumberShift;
+ }
+ }
+
+ previousLineNumberInfo = lineNumberInfo;
+
+ if (DEBUG)
+ {
+ System.out.println(" -> line " + lineNumberInfo.u2lineNumber);
+ }
+ }
+
+
+ /**
+ * This class represents a block of line numbers that originates from the
+ * same inlined method.
+ */
+ private static class MyLineNumberBlock
+ {
+ public final int lineNumberShift;
+ public final int enclosingLineNumber;
+ public final String enclosingSource;
+
+ public MyLineNumberBlock(int lineNumberShift,
+ int enclosingLineNumber,
+ String enclosingSource)
+ {
+ this.lineNumberShift = lineNumberShift;
+ this.enclosingLineNumber = enclosingLineNumber;
+ this.enclosingSource = enclosingSource;
+ }
+ }
+}
diff --git a/src/proguard/optimize/peephole/MemberPrivatizer.java b/src/proguard/optimize/peephole/MemberPrivatizer.java
index 420d80a..f5ffd46 100644
--- a/src/proguard/optimize/peephole/MemberPrivatizer.java
+++ b/src/proguard/optimize/peephole/MemberPrivatizer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/MethodFinalizer.java b/src/proguard/optimize/peephole/MethodFinalizer.java
index 2ce3029..30c7b76 100644
--- a/src/proguard/optimize/peephole/MethodFinalizer.java
+++ b/src/proguard/optimize/peephole/MethodFinalizer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/MethodInliner.java b/src/proguard/optimize/peephole/MethodInliner.java
index 5068965..3fdb3c1 100644
--- a/src/proguard/optimize/peephole/MethodInliner.java
+++ b/src/proguard/optimize/peephole/MethodInliner.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -46,8 +46,12 @@ extends SimplifiedVisitor
implements AttributeVisitor,
InstructionVisitor,
ConstantVisitor,
- MemberVisitor
+ MemberVisitor,
+ LineNumberInfoVisitor
{
+ static final int METHOD_DUMMY_START_LINE_NUMBER = 0;
+ static final int INLINED_METHOD_END_LINE_NUMBER = -1;
+
private static final int MAXIMUM_INLINED_CODE_LENGTH = Integer.parseInt(System.getProperty("maximum.inlined.code.length", "8"));
private static final int MAXIMUM_RESULTING_CODE_LENGTH_JSE = Integer.parseInt(System.getProperty("maximum.resulting.code.length", "7000"));
private static final int MAXIMUM_RESULTING_CODE_LENGTH_JME = Integer.parseInt(System.getProperty("maximum.resulting.code.length", "2000"));
@@ -81,6 +85,9 @@ implements AttributeVisitor,
private int variableOffset;
private boolean inlined;
private boolean inlinedAny;
+ private boolean copiedLineNumbers;
+ private String source;
+ private int minimumLineNumberIndex;
/**
@@ -245,6 +252,25 @@ implements AttributeVisitor,
}
+ public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
+ {
+ // Remember the source if we're inlining a method.
+ source = inlining ?
+ clazz.getName() + '.' +
+ method.getName(clazz) +
+ method.getDescriptor(clazz) + ':' +
+ lineNumberTableAttribute.getLowestLineNumber() + ':' +
+ lineNumberTableAttribute.getHighestLineNumber() :
+ null;
+
+ // Insert all line numbers, possibly partly before previously inserted
+ // line numbers.
+ lineNumberTableAttribute.lineNumbersAccept(clazz, method, codeAttribute, this);
+
+ copiedLineNumbers = true;
+ }
+
+
/**
* Appends instructions to pop the parameters for the given method, storing
* them in new local variables.
@@ -348,6 +374,49 @@ implements AttributeVisitor,
// Copy the exceptions.
codeAttribute.exceptionsAccept(clazz, method, exceptionInfoAdder);
+ // Copy the line numbers.
+ copiedLineNumbers = false;
+
+ // The line numbers need to be inserted sequentially.
+ minimumLineNumberIndex = 0;
+
+ codeAttribute.attributesAccept(clazz, method, this);
+
+ // Make sure we at least have some entry at the start of the method.
+ if (!copiedLineNumbers)
+ {
+ String source = inlining ?
+ clazz.getName() + '.' +
+ method.getName(clazz) +
+ method.getDescriptor(clazz) +
+ ":0:0" :
+ null;
+
+ minimumLineNumberIndex =
+ codeAttributeComposer.insertLineNumber(minimumLineNumberIndex,
+ new ExtendedLineNumberInfo(0,
+ METHOD_DUMMY_START_LINE_NUMBER,
+ source)) + 1;
+ }
+
+ // Add a marker at the end of an inlined method.
+ // The marker will be corrected in LineNumberLinearizer,
+ // so it points to the line of the enclosing method.
+ if (inlining)
+ {
+ String source =
+ clazz.getName() + '.' +
+ method.getName(clazz) +
+ method.getDescriptor(clazz) +
+ ":0:0";
+
+ minimumLineNumberIndex =
+ codeAttributeComposer.insertLineNumber(minimumLineNumberIndex,
+ new ExtendedLineNumberInfo(codeAttribute.u4codeLength,
+ INLINED_METHOD_END_LINE_NUMBER,
+ source)) + 1;
+ }
+
codeAttributeComposer.endCodeFragment();
}
@@ -584,6 +653,26 @@ implements AttributeVisitor,
}
+ // Implementations for LineNumberInfoVisitor.
+
+ public void visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
+ {
+ String newSource = lineNumberInfo.getSource() != null ?
+ lineNumberInfo.getSource() :
+ source;
+
+ LineNumberInfo newLineNumberInfo = newSource != null ?
+ new ExtendedLineNumberInfo(lineNumberInfo.u2startPC,
+ lineNumberInfo.u2lineNumber,
+ newSource) :
+ new LineNumberInfo(lineNumberInfo.u2startPC,
+ lineNumberInfo.u2lineNumber);
+
+ minimumLineNumberIndex =
+ codeAttributeComposer.insertLineNumber(minimumLineNumberIndex, newLineNumberInfo) + 1;
+ }
+
+
/**
* Returns the set of superclasses and interfaces that are initialized.
*/
diff --git a/src/proguard/optimize/peephole/NopRemover.java b/src/proguard/optimize/peephole/NopRemover.java
index b869045..8b9f2d4 100644
--- a/src/proguard/optimize/peephole/NopRemover.java
+++ b/src/proguard/optimize/peephole/NopRemover.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/PeepholeOptimizer.java b/src/proguard/optimize/peephole/PeepholeOptimizer.java
index 35c4426..887af1e 100644
--- a/src/proguard/optimize/peephole/PeepholeOptimizer.java
+++ b/src/proguard/optimize/peephole/PeepholeOptimizer.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/ReachableCodeMarker.java b/src/proguard/optimize/peephole/ReachableCodeMarker.java
index 2b8fb10..75759d0 100644
--- a/src/proguard/optimize/peephole/ReachableCodeMarker.java
+++ b/src/proguard/optimize/peephole/ReachableCodeMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/RetargetedInnerClassAttributeRemover.java b/src/proguard/optimize/peephole/RetargetedInnerClassAttributeRemover.java
index 5d3ccd3..31e9ed9 100644
--- a/src/proguard/optimize/peephole/RetargetedInnerClassAttributeRemover.java
+++ b/src/proguard/optimize/peephole/RetargetedInnerClassAttributeRemover.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/TargetClassChanger.java b/src/proguard/optimize/peephole/TargetClassChanger.java
index 687beb2..a8c7f8d 100644
--- a/src/proguard/optimize/peephole/TargetClassChanger.java
+++ b/src/proguard/optimize/peephole/TargetClassChanger.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -71,18 +71,32 @@ implements ClassVisitor,
// Change the references of the attributes.
programClass.attributesAccept(this);
- // Remove interface classes that have ended up pointing to the class itself.
- int newInterfacesCount = 0;
+ // Remove duplicate interfaces and interface classes that have ended
+ // up pointing to the class itself.
+ boolean[] delete = null;
for (int index = 0; index < programClass.u2interfacesCount; index++)
{
Clazz interfaceClass = programClass.getInterface(index);
- if (!programClass.equals(interfaceClass))
+ if (interfaceClass != null &&
+ (programClass.equals(interfaceClass) ||
+ containsInterfaceClass(programClass,
+ index,
+ interfaceClass)))
{
- programClass.u2interfaces[newInterfacesCount++] =
- programClass.u2interfaces[index];
+ // Lazily create the array.
+ if (delete == null)
+ {
+ delete = new boolean[programClass.u2interfacesCount];
+ }
+
+ delete[index] = true;
}
}
- programClass.u2interfacesCount = newInterfacesCount;
+
+ if (delete != null)
+ {
+ new InterfaceDeleter(delete).visitProgramClass(programClass);
+ }
// Is the class being retargeted?
Clazz targetClass = ClassMerger.getTargetClass(programClass);
@@ -192,6 +206,13 @@ implements ClassVisitor,
}
+ public void visitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)
+ {
+ // Change the referenced classes.
+ updateReferencedClasses(invokeDynamicConstant.referencedClasses);
+ }
+
+
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
Clazz referencedClass = refConstant.referencedClass;
@@ -385,7 +406,27 @@ implements ClassVisitor,
// Small utility methods.
- /**
+ /**
+ * Returns whether the given class contains the given interface
+ * class in its first given number of interfaces.
+ */
+ private boolean containsInterfaceClass(Clazz clazz,
+ int interfaceCount,
+ Clazz interfaceClass)
+ {
+ for (int index = 0; index < interfaceCount; index++)
+ {
+ if (interfaceClass.equals(clazz.getInterface(index)))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ /**
* Updates the retargeted classes in the given array of classes.
*/
private void updateReferencedClasses(Clazz[] referencedClasses)
diff --git a/src/proguard/optimize/peephole/UnreachableCodeRemover.java b/src/proguard/optimize/peephole/UnreachableCodeRemover.java
index f4e3603..a6e1f43 100644
--- a/src/proguard/optimize/peephole/UnreachableCodeRemover.java
+++ b/src/proguard/optimize/peephole/UnreachableCodeRemover.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/UnreachableExceptionRemover.java b/src/proguard/optimize/peephole/UnreachableExceptionRemover.java
index 150c4c5..2b57d17 100644
--- a/src/proguard/optimize/peephole/UnreachableExceptionRemover.java
+++ b/src/proguard/optimize/peephole/UnreachableExceptionRemover.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/VariableShrinker.java b/src/proguard/optimize/peephole/VariableShrinker.java
index 6387f1e..f3e5563 100644
--- a/src/proguard/optimize/peephole/VariableShrinker.java
+++ b/src/proguard/optimize/peephole/VariableShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/optimize/peephole/VerticalClassMerger.java b/src/proguard/optimize/peephole/VerticalClassMerger.java
index 560e989..0fb0796 100644
--- a/src/proguard/optimize/peephole/VerticalClassMerger.java
+++ b/src/proguard/optimize/peephole/VerticalClassMerger.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/preverify/CodePreverifier.java b/src/proguard/preverify/CodePreverifier.java
index 60e7afe..88c8c0e 100644
--- a/src/proguard/preverify/CodePreverifier.java
+++ b/src/proguard/preverify/CodePreverifier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/preverify/CodeSubroutineInliner.java b/src/proguard/preverify/CodeSubroutineInliner.java
index f0b5775..9519a7a 100644
--- a/src/proguard/preverify/CodeSubroutineInliner.java
+++ b/src/proguard/preverify/CodeSubroutineInliner.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/preverify/Preverifier.java b/src/proguard/preverify/Preverifier.java
index 59dad7f..36c61a9 100644
--- a/src/proguard/preverify/Preverifier.java
+++ b/src/proguard/preverify/Preverifier.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/preverify/SubroutineInliner.java b/src/proguard/preverify/SubroutineInliner.java
index b069612..f4415da 100644
--- a/src/proguard/preverify/SubroutineInliner.java
+++ b/src/proguard/preverify/SubroutineInliner.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/retrace/FrameInfo.java b/src/proguard/retrace/FrameInfo.java
new file mode 100644
index 0000000..3498625
--- /dev/null
+++ b/src/proguard/retrace/FrameInfo.java
@@ -0,0 +1,108 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.retrace;
+
+/**
+ * This class represents the class name, field name, method name, etc.
+ * possibly found in a stack frame. Values that are not defined are null.
+ */
+public class FrameInfo
+{
+ private final String className;
+ private final String sourceFile;
+ private final int lineNumber;
+ private final String type;
+ private final String fieldName;
+ private final String methodName;
+ private final String arguments;
+
+
+ /**
+ * Creates a new FrameInfo with the given information.
+ * Any undefined values can be null.
+ */
+ public FrameInfo(String className,
+ String sourceFile,
+ int lineNumber,
+ String type,
+ String fieldName,
+ String methodName,
+ String arguments)
+ {
+ this.className = className;
+ this.sourceFile = sourceFile;
+ this.lineNumber = lineNumber;
+ this.type = type;
+ this.fieldName = fieldName;
+ this.methodName = methodName;
+ this.arguments = arguments;
+ }
+
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+
+ public String getSourceFile()
+ {
+ return sourceFile;
+ }
+
+
+ public int getLineNumber()
+ {
+ return lineNumber;
+ }
+
+
+ public String getType()
+ {
+ return type;
+ }
+
+
+ public String getFieldName()
+ {
+ return fieldName;
+ }
+
+
+ public String getMethodName()
+ {
+ return methodName;
+ }
+
+
+ public String getArguments()
+ {
+ return arguments;
+ }
+
+
+ // Implementations for Object.
+
+ public String toString()
+ {
+ return FrameInfo.class.getName() + "(class=["+className+"], line=["+lineNumber+"], type=["+type+"], field=["+fieldName+"], method=["+methodName+"], arguments=["+arguments+"]";
+ }
+}
diff --git a/src/proguard/retrace/FramePattern.java b/src/proguard/retrace/FramePattern.java
new file mode 100644
index 0000000..bec284c
--- /dev/null
+++ b/src/proguard/retrace/FramePattern.java
@@ -0,0 +1,303 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.retrace;
+
+import proguard.classfile.util.ClassUtil;
+
+import java.util.regex.*;
+
+/**
+ * This class can parse and format lines that represent stack frames
+ * matching a given regular expression.
+ *
+ * @author Eric Lafortune
+ */
+public class FramePattern
+{
+ // The pattern matcher has problems with \\b against some unicode
+ // characters, so we're no longer using \\b for classes and class members.
+ private static final String REGEX_CLASS = "(?:[^\\s\":./()]+\\.)*[^\\s\":./()]+";
+ private static final String REGEX_CLASS_SLASH = "(?:[^\\s\":./()]+/)*[^\\s\":./()]+";
+ private static final String REGEX_SOURCE_FILE = "(?:[^:()]+)*";
+ private static final String REGEX_LINE_NUMBER = "\\b\\d+\\b";
+ private static final String REGEX_TYPE = REGEX_CLASS + "(?:\\[\\])*";
+ private static final String REGEX_MEMBER = "<?[^\\s\":./()]+>?";
+ private static final String REGEX_ARGUMENTS = "(?:" + REGEX_TYPE + "(?:\\s*,\\s*" + REGEX_TYPE + ")*)?";
+
+ private final char[] expressionTypes = new char[32];
+ private final int expressionTypeCount;
+ private final Pattern pattern;
+ private final boolean verbose;
+
+
+ /**
+ * Creates a new FramePattern.
+ */
+ public FramePattern(String regularExpression, boolean verbose)
+ {
+ // Construct the regular expression.
+ StringBuffer expressionBuffer = new StringBuffer(regularExpression.length() + 32);
+
+ int expressionTypeCount = 0;
+ int index = 0;
+ while (true)
+ {
+ int nextIndex = regularExpression.indexOf('%', index);
+ if (nextIndex < 0 ||
+ nextIndex == regularExpression.length()-1 ||
+ expressionTypeCount == expressionTypes.length)
+ {
+ break;
+ }
+
+ // Copy a literal piece of the input line.
+ expressionBuffer.append(regularExpression.substring(index, nextIndex));
+ expressionBuffer.append('(');
+
+ char expressionType = regularExpression.charAt(nextIndex + 1);
+ switch(expressionType)
+ {
+ case 'c':
+ expressionBuffer.append(REGEX_CLASS);
+ break;
+
+ case 'C':
+ expressionBuffer.append(REGEX_CLASS_SLASH);
+ break;
+
+ case 's':
+ expressionBuffer.append(REGEX_SOURCE_FILE);
+ break;
+
+ case 'l':
+ expressionBuffer.append(REGEX_LINE_NUMBER);
+ break;
+
+ case 't':
+ expressionBuffer.append(REGEX_TYPE);
+ break;
+
+ case 'f':
+ expressionBuffer.append(REGEX_MEMBER);
+ break;
+
+ case 'm':
+ expressionBuffer.append(REGEX_MEMBER);
+ break;
+
+ case 'a':
+ expressionBuffer.append(REGEX_ARGUMENTS);
+ break;
+ }
+
+ expressionBuffer.append(')');
+
+ expressionTypes[expressionTypeCount++] = expressionType;
+
+ index = nextIndex + 2;
+ }
+
+ // Copy the last literal piece of the input line.
+ expressionBuffer.append(regularExpression.substring(index));
+
+ this.expressionTypeCount = expressionTypeCount;
+ this.pattern = Pattern.compile(expressionBuffer.toString());
+ this.verbose = verbose;
+ }
+
+
+ /**
+ * Parses all frame information from a given line.
+ * @param line a line that represents a stack frame.
+ * @return the parsed information, or null if the line doesn't match a
+ * stack frame.
+ */
+ public FrameInfo parse(String line)
+ {
+ // Try to match it against the regular expression.
+ Matcher matcher = pattern.matcher(line);
+
+ if (!matcher.matches())
+ {
+ return null;
+ }
+
+ // The line matched the regular expression.
+ String className = null;
+ String sourceFile = null;
+ int lineNumber = 0;
+ String type = null;
+ String fieldName = null;
+ String methodName = null;
+ String arguments = null;
+
+ // Extract a class name, a line number, a type, and
+ // arguments.
+ for (int expressionTypeIndex = 0; expressionTypeIndex < expressionTypeCount; expressionTypeIndex++)
+ {
+ int startIndex = matcher.start(expressionTypeIndex + 1);
+ if (startIndex >= 0)
+ {
+ String match = matcher.group(expressionTypeIndex + 1);
+
+ char expressionType = expressionTypes[expressionTypeIndex];
+ switch (expressionType)
+ {
+ case 'c':
+ className = match;
+ break;
+
+ case 'C':
+ className = ClassUtil.externalClassName(match);
+ break;
+
+ case 's':
+ sourceFile = match;
+ break;
+
+ case 'l':
+ lineNumber = Integer.parseInt(match);
+ break;
+
+ case 't':
+ type = match;
+ break;
+
+ case 'f':
+ fieldName = match;
+ break;
+
+ case 'm':
+ methodName = match;
+ break;
+
+ case 'a':
+ arguments = match;
+ break;
+ }
+ }
+ }
+
+ return new FrameInfo(className,
+ sourceFile,
+ lineNumber,
+ type,
+ fieldName,
+ methodName,
+ arguments);
+ }
+
+
+ /**
+ * Formats the given frame information based on the given template line.
+ * It is the reverse of {@link #parse(String)}, but optionally with
+ * different frame information.
+ * @param line a template line that represents a stack frame.
+ * @param frameInfo information about a stack frame.
+ * @return the formatted line, or null if the line doesn't match a
+ * stack frame.
+ */
+ public String format(String line, FrameInfo frameInfo)
+ {
+ // Try to match it against the regular expression.
+ Matcher matcher = pattern.matcher(line);
+
+ if (!matcher.matches())
+ {
+ return null;
+ }
+
+ StringBuffer formattedBuffer = new StringBuffer();
+
+ int lineIndex = 0;
+ for (int expressionTypeIndex = 0; expressionTypeIndex < expressionTypeCount; expressionTypeIndex++)
+ {
+ int startIndex = matcher.start(expressionTypeIndex + 1);
+ if (startIndex >= 0)
+ {
+ int endIndex = matcher.end(expressionTypeIndex + 1);
+ String match = matcher.group(expressionTypeIndex + 1);
+
+ // Copy a literal piece of the input line.
+ formattedBuffer.append(line.substring(lineIndex, startIndex));
+
+ // Copy a matched and translated piece of the input line.
+ char expressionType = expressionTypes[expressionTypeIndex];
+ switch (expressionType)
+ {
+ case 'c':
+ formattedBuffer.append(frameInfo.getClassName());
+ break;
+
+ case 'C':
+ formattedBuffer.append(ClassUtil.internalClassName(frameInfo.getClassName()));
+ break;
+
+ case 's':
+ formattedBuffer.append(frameInfo.getSourceFile());
+ break;
+
+ case 'l':
+ formattedBuffer.append(frameInfo.getLineNumber());
+ break;
+
+ case 't':
+ formattedBuffer.append(frameInfo.getType());
+ break;
+
+ case 'f':
+ if (verbose)
+ {
+ formattedBuffer.append(frameInfo.getType()).append(' ');
+ }
+ formattedBuffer.append(frameInfo.getFieldName());
+ break;
+
+ case 'm':
+ if (verbose)
+ {
+ formattedBuffer.append(frameInfo.getType()).append(' ');
+ }
+ formattedBuffer.append(frameInfo.getMethodName());
+ if (verbose)
+ {
+ formattedBuffer.append('(').append(frameInfo.getArguments()).append(')');
+ }
+ break;
+
+ case 'a':
+ formattedBuffer.append(frameInfo.getArguments());
+ break;
+ }
+
+ // Skip the original element whose replacement value
+ // has just been appended.
+ lineIndex = endIndex;
+ }
+ }
+
+ // Copy the last literal piece of the input line.
+ formattedBuffer.append(line.substring(lineIndex));
+
+ // Return the formatted line.
+ return formattedBuffer.toString();
+ }
+}
diff --git a/src/proguard/retrace/FrameRemapper.java b/src/proguard/retrace/FrameRemapper.java
new file mode 100644
index 0000000..e08d3b8
--- /dev/null
+++ b/src/proguard/retrace/FrameRemapper.java
@@ -0,0 +1,432 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.retrace;
+
+import proguard.obfuscate.MappingProcessor;
+
+import java.util.*;
+
+/**
+ * This class accumulates mapping information and then transforms stack frames
+ * accordingly.
+ *
+ * @author Eric Lafortune
+ */
+public class FrameRemapper implements MappingProcessor
+{
+ private final Map classMap = new HashMap();
+ private final Map classFieldMap = new HashMap();
+ private final Map classMethodMap = new HashMap();
+
+
+ /**
+ * Transforms the given obfuscated frame back to one or more original frames.
+ */
+ public List transform(FrameInfo obfuscatedFrame)
+ {
+ // First remap the class name.
+ String originalClassName = originalClassName(obfuscatedFrame.getClassName());
+ if (originalClassName == null)
+ {
+ return null;
+ }
+
+ List originalFrames = new ArrayList();
+
+ // Create any transformed frames with remapped field names.
+ transformFieldInfo(obfuscatedFrame,
+ originalClassName,
+ originalFrames);
+
+ // Create any transformed frames with remapped method names.
+ transformMethodInfo(obfuscatedFrame,
+ originalClassName,
+ originalFrames);
+
+ if (originalFrames.isEmpty())
+ {
+ // Create a transformed frame with the remapped class name.
+ originalFrames.add(new FrameInfo(originalClassName,
+ sourceFileName(originalClassName),
+ obfuscatedFrame.getLineNumber(),
+ obfuscatedFrame.getType(),
+ obfuscatedFrame.getFieldName(),
+ obfuscatedFrame.getMethodName(),
+ obfuscatedFrame.getArguments()));
+ }
+
+ return originalFrames;
+ }
+
+
+ /**
+ * Transforms the obfuscated frame into one or more original frames,
+ * if the frame contains information about a field that can be remapped.
+ * @param obfuscatedFrame the obfuscated frame.
+ * @param originalFieldFrames the list in which remapped frames can be
+ * collected.
+ */
+ private void transformFieldInfo(FrameInfo obfuscatedFrame,
+ String originalClassName,
+ List originalFieldFrames)
+ {
+ // Class name -> obfuscated field names.
+ Map fieldMap = (Map)classFieldMap.get(originalClassName);
+ if (fieldMap != null)
+ {
+ // Obfuscated field names -> fields.
+ String obfuscatedFieldName = obfuscatedFrame.getFieldName();
+ List fieldList = (List)fieldMap.get(obfuscatedFieldName);
+ if (fieldList != null)
+ {
+ String obfuscatedType = obfuscatedFrame.getType();
+ String originalType = obfuscatedType == null ? null :
+ originalType(obfuscatedType);
+
+ // Find all matching fields.
+ Iterator fieldInfoIterator = fieldList.iterator();
+ while (fieldInfoIterator.hasNext())
+ {
+ FieldInfo fieldInfo = (FieldInfo)fieldInfoIterator.next();
+ if (fieldInfo.matches(originalType))
+ {
+ originalFieldFrames.add(new FrameInfo(fieldInfo.originalClassName,
+ sourceFileName(fieldInfo.originalClassName),
+ obfuscatedFrame.getLineNumber(),
+ fieldInfo.originalType,
+ fieldInfo.originalName,
+ obfuscatedFrame.getMethodName(),
+ obfuscatedFrame.getArguments()));
+ }
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Transforms the obfuscated frame into one or more original frames,
+ * if the frame contains information about a method that can be remapped.
+ * @param obfuscatedFrame the obfuscated frame.
+ * @param originalMethodFrames the list in which remapped frames can be
+ * collected.
+ */
+ private void transformMethodInfo(FrameInfo obfuscatedFrame,
+ String originalClassName,
+ List originalMethodFrames)
+ {
+ // Class name -> obfuscated method names.
+ Map methodMap = (Map)classMethodMap.get(originalClassName);
+ if (methodMap != null)
+ {
+ // Obfuscated method names -> methods.
+ String obfuscatedMethodName = obfuscatedFrame.getMethodName();
+ Set methodList = (Set)methodMap.get(obfuscatedMethodName);
+ if (methodList != null)
+ {
+ int obfuscatedLineNumber = obfuscatedFrame.getLineNumber();
+
+ String obfuscatedType = obfuscatedFrame.getType();
+ String originalType = obfuscatedType == null ? null :
+ originalType(obfuscatedType);
+
+ String obfuscatedArguments = obfuscatedFrame.getArguments();
+ String originalArguments = obfuscatedArguments == null ? null :
+ originalArguments(obfuscatedArguments);
+
+ // Find all matching methods.
+ Iterator methodInfoIterator = methodList.iterator();
+ while (methodInfoIterator.hasNext())
+ {
+ MethodInfo methodInfo = (MethodInfo)methodInfoIterator.next();
+ if (methodInfo.matches(obfuscatedLineNumber,
+ originalType,
+ originalArguments))
+ {
+ // Do we have a different original first line number?
+ // We're allowing unknown values, represented as 0.
+ int lineNumber = obfuscatedFrame.getLineNumber();
+ if (methodInfo.originalFirstLineNumber != methodInfo.obfuscatedFirstLineNumber)
+ {
+ // Do we have an original line number range and
+ // sufficient information to shift the line number?
+ lineNumber = methodInfo.originalLastLineNumber != 0 &&
+ methodInfo.originalLastLineNumber != methodInfo.originalFirstLineNumber &&
+ methodInfo.obfuscatedFirstLineNumber != 0 &&
+ lineNumber != 0 ?
+ methodInfo.originalFirstLineNumber - methodInfo.obfuscatedFirstLineNumber + lineNumber :
+ methodInfo.originalFirstLineNumber;
+ }
+
+ originalMethodFrames.add(new FrameInfo(methodInfo.originalClassName,
+ sourceFileName(methodInfo.originalClassName),
+ lineNumber,
+ methodInfo.originalType,
+ obfuscatedFrame.getFieldName(),
+ methodInfo.originalName,
+ methodInfo.originalArguments));
+ }
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Returns the original argument types.
+ */
+ private String originalArguments(String obfuscatedArguments)
+ {
+ StringBuffer originalArguments = new StringBuffer();
+
+ int startIndex = 0;
+ while (true)
+ {
+ int endIndex = obfuscatedArguments.indexOf(',', startIndex);
+ if (endIndex < 0)
+ {
+ break;
+ }
+
+ originalArguments.append(originalType(obfuscatedArguments.substring(startIndex, endIndex).trim())).append(',');
+
+ startIndex = endIndex + 1;
+ }
+
+ originalArguments.append(originalType(obfuscatedArguments.substring(startIndex).trim()));
+
+ return originalArguments.toString();
+ }
+
+
+ /**
+ * Returns the original type.
+ */
+ private String originalType(String obfuscatedType)
+ {
+ int index = obfuscatedType.indexOf('[');
+
+ return index >= 0 ?
+ originalClassName(obfuscatedType.substring(0, index)) + obfuscatedType.substring(index) :
+ originalClassName(obfuscatedType);
+ }
+
+
+ /**
+ * Returns the original class name.
+ */
+ private String originalClassName(String obfuscatedClassName)
+ {
+ String originalClassName = (String)classMap.get(obfuscatedClassName);
+
+ return originalClassName != null ?
+ originalClassName :
+ obfuscatedClassName;
+ }
+
+
+ /**
+ * Returns the Java source file name that typically corresponds to the
+ * given class name.
+ */
+ private String sourceFileName(String className)
+ {
+ int index1 = className.lastIndexOf('.') + 1;
+ int index2 = className.indexOf('$', index1);
+
+ return (index2 > 0 ?
+ className.substring(index1, index2) :
+ className.substring(index1)) +
+ ".java";
+ }
+
+
+ // Implementations for MappingProcessor.
+
+ public boolean processClassMapping(String className,
+ String newClassName)
+ {
+ // Obfuscated class name -> original class name.
+ classMap.put(newClassName, className);
+
+ return true;
+ }
+
+
+ public void processFieldMapping(String className,
+ String fieldType,
+ String fieldName,
+ String newClassName,
+ String newFieldName)
+ {
+ // Obfuscated class name -> obfuscated field names.
+ Map fieldMap = (Map)classFieldMap.get(newClassName);
+ if (fieldMap == null)
+ {
+ fieldMap = new HashMap();
+ classFieldMap.put(newClassName, fieldMap);
+ }
+
+ // Obfuscated field name -> fields.
+ Set fieldList = (Set)fieldMap.get(newFieldName);
+ if (fieldList == null)
+ {
+ fieldList = new LinkedHashSet();
+ fieldMap.put(newFieldName, fieldList);
+ }
+
+ // Add the field information.
+ fieldList.add(new FieldInfo(className,
+ fieldType,
+ fieldName));
+ }
+
+
+ public void processMethodMapping(String className,
+ int firstLineNumber,
+ int lastLineNumber,
+ String methodReturnType,
+ String methodName,
+ String methodArguments,
+ String newClassName,
+ int newFirstLineNumber,
+ int newLastLineNumber,
+ String newMethodName)
+ {
+ // Original class name -> obfuscated method names.
+ Map methodMap = (Map)classMethodMap.get(newClassName);
+ if (methodMap == null)
+ {
+ methodMap = new HashMap();
+ classMethodMap.put(newClassName, methodMap);
+ }
+
+ // Obfuscated method name -> methods.
+ Set methodList = (Set)methodMap.get(newMethodName);
+ if (methodList == null)
+ {
+ methodList = new LinkedHashSet();
+ methodMap.put(newMethodName, methodList);
+ }
+
+ // Add the method information.
+ methodList.add(new MethodInfo(newFirstLineNumber,
+ newLastLineNumber,
+ className,
+ firstLineNumber,
+ lastLineNumber,
+ methodReturnType,
+ methodName,
+ methodArguments));
+ }
+
+
+ /**
+ * Information about the original version and the obfuscated version of
+ * a field (without the obfuscated class name or field name).
+ */
+ private static class FieldInfo
+ {
+ private final String originalClassName;
+ private final String originalType;
+ private final String originalName;
+
+
+ /**
+ * Creates a new FieldInfo with the given properties.
+ */
+ private FieldInfo(String originalClassName,
+ String originalType,
+ String originalName)
+ {
+ this.originalClassName = originalClassName;
+ this.originalType = originalType;
+ this.originalName = originalName;
+ }
+
+
+ /**
+ * Returns whether the given type matches the original type of this field.
+ * The given type may be a null wildcard.
+ */
+ private boolean matches(String originalType)
+ {
+ return
+ originalType == null || originalType.equals(this.originalType);
+ }
+ }
+
+
+ /**
+ * Information about the original version and the obfuscated version of
+ * a method (without the obfuscated class name or method name).
+ */
+ private static class MethodInfo
+ {
+ private final int obfuscatedFirstLineNumber;
+ private final int obfuscatedLastLineNumber;
+ private final String originalClassName;
+ private final int originalFirstLineNumber;
+ private final int originalLastLineNumber;
+ private final String originalType;
+ private final String originalName;
+ private final String originalArguments;
+
+
+ /**
+ * Creates a new MethodInfo with the given properties.
+ */
+ private MethodInfo(int obfuscatedFirstLineNumber,
+ int obfuscatedLastLineNumber,
+ String originalClassName,
+ int originalFirstLineNumber,
+ int originalLastLineNumber,
+ String originalType,
+ String originalName,
+ String originalArguments)
+ {
+ this.obfuscatedFirstLineNumber = obfuscatedFirstLineNumber;
+ this.obfuscatedLastLineNumber = obfuscatedLastLineNumber;
+ this.originalType = originalType;
+ this.originalArguments = originalArguments;
+ this.originalClassName = originalClassName;
+ this.originalName = originalName;
+ this.originalFirstLineNumber = originalFirstLineNumber;
+ this.originalLastLineNumber = originalLastLineNumber;
+ }
+
+
+ /**
+ * Returns whether the given properties match the properties of this
+ * method. The given properties may be null wildcards.
+ */
+ private boolean matches(int obfuscatedLineNumber,
+ String originalType,
+ String originalArguments)
+ {
+ return
+ (obfuscatedLineNumber == 0 ? obfuscatedLastLineNumber == 0 :
+ obfuscatedFirstLineNumber <= obfuscatedLineNumber && obfuscatedLineNumber <= obfuscatedLastLineNumber) &&
+ (originalType == null || originalType.equals(this.originalType)) &&
+ (originalArguments == null || originalArguments.equals(this.originalArguments));
+ }
+ }
+}
diff --git a/src/proguard/retrace/ReTrace.java b/src/proguard/retrace/ReTrace.java
index fae47e5..631cef1 100644
--- a/src/proguard/retrace/ReTrace.java
+++ b/src/proguard/retrace/ReTrace.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -20,13 +20,10 @@
*/
package proguard.retrace;
-import proguard.classfile.util.ClassUtil;
-import proguard.obfuscate.*;
+import proguard.obfuscate.MappingReader;
import java.io.*;
import java.util.*;
-import java.util.regex.*;
-
/**
* Tool for de-obfuscating stack traces of applications that were obfuscated
@@ -35,35 +32,22 @@ import java.util.regex.*;
* @author Eric Lafortune
*/
public class ReTrace
-implements MappingProcessor
{
+ private static final String USAGE = "Usage: java proguard.ReTrace [-regex <regex>] [-verbose] <mapping_file> [<stacktrace_file>]";
private static final String REGEX_OPTION = "-regex";
private static final String VERBOSE_OPTION = "-verbose";
+ public static final String STACK_TRACE_EXPRESSION = "(?:.*?\\bat\\s+%c\\.%m\\s*\\(%s(?::%l)?\\)\\s*)|(?:(?:.*?[:\"]\\s+)?%c(?::.*)?)";
- public static final String STACK_TRACE_EXPRESSION = "(?:.*?\\bat\\s+%c\\.%m\\s*\\(.*?(?::%l)?\\)\\s*)|(?:(?:.*?[:\"]\\s+)?%c(?::.*)?)";
-
- private static final String REGEX_CLASS = "\\b(?:[A-Za-z0-9_$]+\\.)*[A-Za-z0-9_$]+\\b";
- private static final String REGEX_CLASS_SLASH = "\\b(?:[A-Za-z0-9_$]+/)*[A-Za-z0-9_$]+\\b";
- private static final String REGEX_LINE_NUMBER = "\\b[0-9]+\\b";
- private static final String REGEX_TYPE = REGEX_CLASS + "(?:\\[\\])*";
- private static final String REGEX_MEMBER = "<?\\b[A-Za-z0-9_$]+\\b>?";
- private static final String REGEX_ARGUMENTS = "(?:" + REGEX_TYPE + "(?:\\s*,\\s*" + REGEX_TYPE + ")*)?";
- // The class settings.
+ // The settings.
private final String regularExpression;
private final boolean verbose;
private final File mappingFile;
- private final File stackTraceFile;
-
- private Map classMap = new HashMap();
- private Map classFieldMap = new HashMap();
- private Map classMethodMap = new HashMap();
/**
- * Creates a new ReTrace object to process stack traces on the standard
- * input, based on the given mapping file name.
+ * Creates a new ReTrace instance.
* @param regularExpression the regular expression for parsing the lines in
* the stack trace.
* @param verbose specifies whether the de-obfuscated stack trace
@@ -75,611 +59,152 @@ implements MappingProcessor
boolean verbose,
File mappingFile)
{
- this(regularExpression, verbose, mappingFile, null);
- }
-
-
- /**
- * Creates a new ReTrace object to process a stack trace from the given file,
- * based on the given mapping file name.
- * @param regularExpression the regular expression for parsing the lines in
- * the stack trace.
- * @param verbose specifies whether the de-obfuscated stack trace
- * should be verbose.
- * @param mappingFile the mapping file that was written out by
- * ProGuard.
- * @param stackTraceFile the optional name of the file that contains the
- * stack trace.
- */
- public ReTrace(String regularExpression,
- boolean verbose,
- File mappingFile,
- File stackTraceFile)
- {
this.regularExpression = regularExpression;
this.verbose = verbose;
this.mappingFile = mappingFile;
- this.stackTraceFile = stackTraceFile;
}
/**
- * Performs the subsequent ReTrace operations.
+ * De-obfuscates a given stack trace.
+ * @param stackTraceReader a reader for the obfuscated stack trace.
+ * @param stackTraceWriter a writer for the de-obfuscated stack trace.
*/
- public void execute() throws IOException
+ public void retrace(LineNumberReader stackTraceReader,
+ PrintWriter stackTraceWriter) throws IOException
{
+ // Create a pattern for stack frames.
+ FramePattern pattern = new FramePattern(regularExpression, verbose);
+
+ // Create a remapper.
+ FrameRemapper mapper = new FrameRemapper();
+
// Read the mapping file.
MappingReader mappingReader = new MappingReader(mappingFile);
- mappingReader.pump(this);
+ mappingReader.pump(mapper);
- // Construct the regular expression.
- StringBuffer expressionBuffer = new StringBuffer(regularExpression.length() + 32);
- char[] expressionTypes = new char[32];
- int expressionTypeCount = 0;
- int index = 0;
+ // Read and process the lines of the stack trace.
while (true)
{
- int nextIndex = regularExpression.indexOf('%', index);
- if (nextIndex < 0 ||
- nextIndex == regularExpression.length()-1 ||
- expressionTypeCount == expressionTypes.length)
+ // Read a line.
+ String obfuscatedLine = stackTraceReader.readLine();
+ if (obfuscatedLine == null)
{
break;
}
- expressionBuffer.append(regularExpression.substring(index, nextIndex));
- expressionBuffer.append('(');
-
- char expressionType = regularExpression.charAt(nextIndex + 1);
- switch(expressionType)
+ // Try to match it against the regular expression.
+ FrameInfo obfuscatedFrame = pattern.parse(obfuscatedLine);
+ if (obfuscatedFrame != null)
{
- case 'c':
- expressionBuffer.append(REGEX_CLASS);
- break;
-
- case 'C':
- expressionBuffer.append(REGEX_CLASS_SLASH);
- break;
-
- case 'l':
- expressionBuffer.append(REGEX_LINE_NUMBER);
- break;
-
- case 't':
- expressionBuffer.append(REGEX_TYPE);
- break;
-
- case 'f':
- expressionBuffer.append(REGEX_MEMBER);
- break;
-
- case 'm':
- expressionBuffer.append(REGEX_MEMBER);
- break;
-
- case 'a':
- expressionBuffer.append(REGEX_ARGUMENTS);
- break;
- }
-
- expressionBuffer.append(')');
-
- expressionTypes[expressionTypeCount++] = expressionType;
+ // Transform the obfuscated frame back to one or more
+ // original frames.
+ Iterator retracedFrames =
+ mapper.transform(obfuscatedFrame).iterator();
- index = nextIndex + 2;
- }
-
- expressionBuffer.append(regularExpression.substring(index));
-
- Pattern pattern = Pattern.compile(expressionBuffer.toString());
-
- // Open the stack trace file.
- LineNumberReader reader =
- new LineNumberReader(stackTraceFile == null ?
- (Reader)new InputStreamReader(System.in) :
- (Reader)new BufferedReader(new FileReader(stackTraceFile)));
-
- // Read and process the lines of the stack trace.
- try
- {
- StringBuffer outLine = new StringBuffer(256);
- List extraOutLines = new ArrayList();
+ String previousLine = null;
- String className = null;
-
- // Read all lines from the stack trace.
- while (true)
- {
- // Read a line.
- String line = reader.readLine();
- if (line == null)
+ while (retracedFrames.hasNext())
{
- break;
- }
-
- // Try to match it against the regular expression.
- Matcher matcher = pattern.matcher(line);
-
- if (matcher.matches())
- {
- // The line matched the regular expression.
- int lineNumber = 0;
- String type = null;
- String arguments = null;
-
- // Extract a class name, a line number, a type, and
- // arguments.
- for (int expressionTypeIndex = 0; expressionTypeIndex < expressionTypeCount; expressionTypeIndex++)
- {
- int startIndex = matcher.start(expressionTypeIndex + 1);
- if (startIndex >= 0)
- {
- String match = matcher.group(expressionTypeIndex + 1);
-
- char expressionType = expressionTypes[expressionTypeIndex];
- switch (expressionType)
- {
- case 'c':
- className = originalClassName(match);
- break;
-
- case 'C':
- className = originalClassName(ClassUtil.externalClassName(match));
- break;
-
- case 'l':
- lineNumber = Integer.parseInt(match);
- break;
-
- case 't':
- type = originalType(match);
- break;
-
- case 'a':
- arguments = originalArguments(match);
- break;
- }
- }
- }
-
- // Deconstruct the input line and reconstruct the output
- // line. Also collect any additional output lines for this
- // line.
- int lineIndex = 0;
-
- outLine.setLength(0);
- extraOutLines.clear();
-
- for (int expressionTypeIndex = 0; expressionTypeIndex < expressionTypeCount; expressionTypeIndex++)
+ // Retrieve the next retraced frame.
+ FrameInfo retracedFrame =
+ (FrameInfo)retracedFrames.next();
+
+ // Format the retraced line.
+ String retracedLine =
+ pattern.format(obfuscatedLine, retracedFrame);
+
+ // Clear the common first part of ambiguous alternative
+ // retraced lines, to present a cleaner list of
+ // alternatives.
+ String trimmedLine =
+ previousLine != null &&
+ obfuscatedFrame.getLineNumber() == 0 ?
+ trim(retracedLine, previousLine) :
+ retracedLine;
+
+ // Print out the retraced line.
+ if (trimmedLine != null)
{
- int startIndex = matcher.start(expressionTypeIndex + 1);
- if (startIndex >= 0)
- {
- int endIndex = matcher.end(expressionTypeIndex + 1);
- String match = matcher.group(expressionTypeIndex + 1);
-
- // Copy a literal piece of the input line.
- outLine.append(line.substring(lineIndex, startIndex));
-
- // Copy a matched and translated piece of the input line.
- char expressionType = expressionTypes[expressionTypeIndex];
- switch (expressionType)
- {
- case 'c':
- className = originalClassName(match);
- outLine.append(className);
- break;
-
- case 'C':
- className = originalClassName(ClassUtil.externalClassName(match));
- outLine.append(ClassUtil.internalClassName(className));
- break;
-
- case 'l':
- lineNumber = Integer.parseInt(match);
- outLine.append(match);
- break;
-
- case 't':
- type = originalType(match);
- outLine.append(type);
- break;
-
- case 'f':
- originalFieldName(className,
- match,
- type,
- outLine,
- extraOutLines);
- break;
-
- case 'm':
- originalMethodName(className,
- match,
- lineNumber,
- type,
- arguments,
- outLine,
- extraOutLines);
- break;
-
- case 'a':
- arguments = originalArguments(match);
- outLine.append(arguments);
- break;
- }
-
- // Skip the original element whose processed version
- // has just been appended.
- lineIndex = endIndex;
- }
+ stackTraceWriter.println(trimmedLine);
}
- // Copy the last literal piece of the input line.
- outLine.append(line.substring(lineIndex));
-
- // Print out the processed line.
- System.out.println(outLine);
-
- // Print out any additional lines.
- for (int extraLineIndex = 0; extraLineIndex < extraOutLines.size(); extraLineIndex++)
- {
- System.out.println(extraOutLines.get(extraLineIndex));
- }
- }
- else
- {
- // The line didn't match the regular expression.
- // Print out the original line.
- System.out.println(line);
- }
- }
- }
- catch (IOException ex)
- {
- throw new IOException("Can't read stack trace (" + ex.getMessage() + ")");
- }
- finally
- {
- if (stackTraceFile != null)
- {
- try
- {
- reader.close();
- }
- catch (IOException ex)
- {
- // This shouldn't happen.
+ previousLine = retracedLine;
}
}
- }
- }
-
-
- /**
- * Finds the original field name(s), appending the first one to the out
- * line, and any additional alternatives to the extra lines.
- */
- private void originalFieldName(String className,
- String obfuscatedFieldName,
- String type,
- StringBuffer outLine,
- List extraOutLines)
- {
- int extraIndent = -1;
-
- // Class name -> obfuscated field names.
- Map fieldMap = (Map)classFieldMap.get(className);
- if (fieldMap != null)
- {
- // Obfuscated field names -> fields.
- Set fieldSet = (Set)fieldMap.get(obfuscatedFieldName);
- if (fieldSet != null)
+ else
{
- // Find all matching fields.
- Iterator fieldInfoIterator = fieldSet.iterator();
- while (fieldInfoIterator.hasNext())
- {
- FieldInfo fieldInfo = (FieldInfo)fieldInfoIterator.next();
- if (fieldInfo.matches(type))
- {
- // Is this the first matching field?
- if (extraIndent < 0)
- {
- extraIndent = outLine.length();
-
- // Append the first original name.
- if (verbose)
- {
- outLine.append(fieldInfo.type).append(' ');
- }
- outLine.append(fieldInfo.originalName);
- }
- else
- {
- // Create an additional line with the proper
- // indentation.
- StringBuffer extraBuffer = new StringBuffer();
- for (int counter = 0; counter < extraIndent; counter++)
- {
- extraBuffer.append(' ');
- }
-
- // Append the alternative name.
- if (verbose)
- {
- extraBuffer.append(fieldInfo.type).append(' ');
- }
- extraBuffer.append(fieldInfo.originalName);
-
- // Store the additional line.
- extraOutLines.add(extraBuffer);
- }
- }
- }
+ // Print out the original line.
+ stackTraceWriter.println(obfuscatedLine);
}
}
- // Just append the obfuscated name if we haven't found any matching
- // fields.
- if (extraIndent < 0)
- {
- outLine.append(obfuscatedFieldName);
- }
+ stackTraceWriter.flush();
}
/**
- * Finds the original method name(s), appending the first one to the out
- * line, and any additional alternatives to the extra lines.
+ * Returns the first given string, with any leading characters that it has
+ * in common with the second string replaced by spaces.
*/
- private void originalMethodName(String className,
- String obfuscatedMethodName,
- int lineNumber,
- String type,
- String arguments,
- StringBuffer outLine,
- List extraOutLines)
+ private String trim(String string1, String string2)
{
- int extraIndent = -1;
+ StringBuffer line = new StringBuffer(string1);
- // Class name -> obfuscated method names.
- Map methodMap = (Map)classMethodMap.get(className);
- if (methodMap != null)
+ // Find the common part.
+ int trimEnd = firstNonCommonIndex(string1, string2);
+ if (trimEnd == string1.length())
{
- // Obfuscated method names -> methods.
- Set methodSet = (Set)methodMap.get(obfuscatedMethodName);
- if (methodSet != null)
- {
- // Find all matching methods.
- Iterator methodInfoIterator = methodSet.iterator();
- while (methodInfoIterator.hasNext())
- {
- MethodInfo methodInfo = (MethodInfo)methodInfoIterator.next();
- if (methodInfo.matches(lineNumber, type, arguments))
- {
- // Is this the first matching method?
- if (extraIndent < 0)
- {
- extraIndent = outLine.length();
-
- // Append the first original name.
- if (verbose)
- {
- outLine.append(methodInfo.type).append(' ');
- }
- outLine.append(methodInfo.originalName);
- if (verbose)
- {
- outLine.append('(').append(methodInfo.arguments).append(')');
- }
- }
- else
- {
- // Create an additional line with the proper
- // indentation.
- StringBuffer extraBuffer = new StringBuffer();
- for (int counter = 0; counter < extraIndent; counter++)
- {
- extraBuffer.append(' ');
- }
-
- // Append the alternative name.
- if (verbose)
- {
- extraBuffer.append(methodInfo.type).append(' ');
- }
- extraBuffer.append(methodInfo.originalName);
- if (verbose)
- {
- extraBuffer.append('(').append(methodInfo.arguments).append(')');
- }
-
- // Store the additional line.
- extraOutLines.add(extraBuffer);
- }
- }
- }
- }
+ return null;
}
- // Just append the obfuscated name if we haven't found any matching
- // methods.
- if (extraIndent < 0)
- {
- outLine.append(obfuscatedMethodName);
- }
- }
-
-
- /**
- * Returns the original argument types.
- */
- private String originalArguments(String obfuscatedArguments)
- {
- StringBuffer originalArguments = new StringBuffer();
+ // Don't clear the last identifier characters.
+ trimEnd = lastNonIdentifierIndex(string1, trimEnd) + 1;
- int startIndex = 0;
- while (true)
+ // Clear the common characters.
+ for (int index = 0; index < trimEnd; index++)
{
- int endIndex = obfuscatedArguments.indexOf(',', startIndex);
- if (endIndex < 0)
+ if (!Character.isWhitespace(string1.charAt(index)))
{
- break;
+ line.setCharAt(index, ' ');
}
-
- originalArguments.append(originalType(obfuscatedArguments.substring(startIndex, endIndex).trim())).append(',');
-
- startIndex = endIndex + 1;
}
- originalArguments.append(originalType(obfuscatedArguments.substring(startIndex).trim()));
-
- return originalArguments.toString();
- }
-
-
- /**
- * Returns the original type.
- */
- private String originalType(String obfuscatedType)
- {
- int index = obfuscatedType.indexOf('[');
-
- return index >= 0 ?
- originalClassName(obfuscatedType.substring(0, index)) + obfuscatedType.substring(index) :
- originalClassName(obfuscatedType);
+ return line.toString();
}
/**
- * Returns the original class name.
+ * Returns the index of the first character that is not the same in both
+ * given strings.
*/
- private String originalClassName(String obfuscatedClassName)
- {
- String originalClassName = (String)classMap.get(obfuscatedClassName);
-
- return originalClassName != null ?
- originalClassName :
- obfuscatedClassName;
- }
-
-
- // Implementations for MappingProcessor.
-
- public boolean processClassMapping(String className, String newClassName)
- {
- // Obfuscated class name -> original class name.
- classMap.put(newClassName, className);
-
- return true;
- }
-
-
- public void processFieldMapping(String className, String fieldType, String fieldName, String newFieldName)
+ private int firstNonCommonIndex(String string1, String string2)
{
- // Original class name -> obfuscated field names.
- Map fieldMap = (Map)classFieldMap.get(className);
- if (fieldMap == null)
- {
- fieldMap = new HashMap();
- classFieldMap.put(className, fieldMap);
- }
-
- // Obfuscated field name -> fields.
- Set fieldSet = (Set)fieldMap.get(newFieldName);
- if (fieldSet == null)
- {
- fieldSet = new LinkedHashSet();
- fieldMap.put(newFieldName, fieldSet);
- }
-
- // Add the field information.
- fieldSet.add(new FieldInfo(fieldType,
- fieldName));
- }
-
-
- public void processMethodMapping(String className, int firstLineNumber, int lastLineNumber, String methodReturnType, String methodName, String methodArguments, String newMethodName)
- {
- // Original class name -> obfuscated method names.
- Map methodMap = (Map)classMethodMap.get(className);
- if (methodMap == null)
- {
- methodMap = new HashMap();
- classMethodMap.put(className, methodMap);
- }
-
- // Obfuscated method name -> methods.
- Set methodSet = (Set)methodMap.get(newMethodName);
- if (methodSet == null)
- {
- methodSet = new LinkedHashSet();
- methodMap.put(newMethodName, methodSet);
- }
-
- // Add the method information.
- methodSet.add(new MethodInfo(firstLineNumber,
- lastLineNumber,
- methodReturnType,
- methodArguments,
- methodName));
- }
-
-
- /**
- * A field record.
- */
- private static class FieldInfo
- {
- private String type;
- private String originalName;
-
-
- private FieldInfo(String type, String originalName)
+ int index = 0;
+ while (index < string1.length() &&
+ index < string2.length() &&
+ string1.charAt(index) == string2.charAt(index))
{
- this.type = type;
- this.originalName = originalName;
+ index++;
}
-
- private boolean matches(String type)
- {
- return
- type == null || type.equals(this.type);
- }
+ return index;
}
/**
- * A method record.
+ * Returns the index of the last character that is not an identifier
+ * character in the given string, at or before the given index.
*/
- private static class MethodInfo
+ private int lastNonIdentifierIndex(String line, int index)
{
- private int firstLineNumber;
- private int lastLineNumber;
- private String type;
- private String arguments;
- private String originalName;
-
-
- private MethodInfo(int firstLineNumber, int lastLineNumber, String type, String arguments, String originalName)
+ while (index >= 0 &&
+ Character.isJavaIdentifierPart(line.charAt(index)))
{
- this.firstLineNumber = firstLineNumber;
- this.lastLineNumber = lastLineNumber;
- this.type = type;
- this.arguments = arguments;
- this.originalName = originalName;
+ index--;
}
-
- private boolean matches(int lineNumber, String type, String arguments)
- {
- return
- (lineNumber == 0 || (firstLineNumber <= lineNumber && lineNumber <= lastLineNumber) || lastLineNumber == 0) &&
- (type == null || type.equals(this.type)) &&
- (arguments == null || arguments.equals(this.arguments));
- }
+ return index;
}
@@ -688,9 +213,10 @@ implements MappingProcessor
*/
public static void main(String[] args)
{
+ // Parse the arguments.
if (args.length < 1)
{
- System.err.println("Usage: java proguard.ReTrace [-verbose] <mapping_file> [<stacktrace_file>]");
+ System.err.println(USAGE);
System.exit(-1);
}
@@ -719,21 +245,45 @@ implements MappingProcessor
if (argumentIndex >= args.length)
{
- System.err.println("Usage: java proguard.ReTrace [-regex <regex>] [-verbose] <mapping_file> [<stacktrace_file>]");
+ System.err.println(USAGE);
System.exit(-1);
}
+ // Convert the arguments into File instances.
File mappingFile = new File(args[argumentIndex++]);
File stackTraceFile = argumentIndex < args.length ?
new File(args[argumentIndex]) :
null;
- ReTrace reTrace = new ReTrace(regularExpresssion, verbose, mappingFile, stackTraceFile);
-
try
{
- // Execute ReTrace with its given settings.
- reTrace.execute();
+ // Open the input stack trace. We're always using the UTF-8
+ // character encoding, even for reading from the standard
+ // input.
+ LineNumberReader reader =
+ new LineNumberReader(
+ new BufferedReader(
+ new InputStreamReader(stackTraceFile == null ? System.in :
+ new FileInputStream(stackTraceFile), "UTF-8")));
+
+ // Open the output stack trace, again using UTF-8 encoding.
+ PrintWriter writer =
+ new PrintWriter(new OutputStreamWriter(System.out, "UTF-8"));
+
+ try
+ {
+ // Execute ReTrace with the collected settings.
+ new ReTrace(regularExpresssion, verbose, mappingFile)
+ .retrace(reader, writer);
+ }
+ finally
+ {
+ // Close the input stack trace if it was a file.
+ if (stackTraceFile != null)
+ {
+ reader.close();
+ }
+ }
}
catch (IOException ex)
{
diff --git a/src/proguard/shrink/AnnotationUsageMarker.java b/src/proguard/shrink/AnnotationUsageMarker.java
index 2cc0266..3852863 100644
--- a/src/proguard/shrink/AnnotationUsageMarker.java
+++ b/src/proguard/shrink/AnnotationUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/shrink/ClassShrinker.java b/src/proguard/shrink/ClassShrinker.java
index 79f9aed..e9acf99 100644
--- a/src/proguard/shrink/ClassShrinker.java
+++ b/src/proguard/shrink/ClassShrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -73,10 +73,13 @@ implements ClassVisitor,
{
// Shrink the arrays for constant pool, interfaces, fields, methods,
// and class attributes.
- programClass.u2interfacesCount =
- shrinkConstantIndexArray(programClass.constantPool,
- programClass.u2interfaces,
- programClass.u2interfacesCount);
+ if (programClass.u2interfacesCount > 0)
+ {
+ new InterfaceDeleter(shrinkFlags(programClass.constantPool,
+ programClass.u2interfaces,
+ programClass.u2interfacesCount))
+ .visitProgramClass(programClass);
+ }
// Shrinking the constant pool also sets up an index map.
int newConstantPoolCount =
@@ -111,10 +114,11 @@ implements ClassVisitor,
constantPoolRemapper.visitProgramClass(programClass);
}
- // Remove the unused classes from the signatures.
- programClass.fieldsAccept(new AllAttributeVisitor(new MySignatureShrinker()));
- programClass.methodsAccept(new AllAttributeVisitor(new MySignatureShrinker()));
- programClass.attributesAccept(new MySignatureShrinker());
+ // Replace any unused classes in the signatures.
+ MySignatureCleaner signatureCleaner = new MySignatureCleaner();
+ programClass.fieldsAccept(new AllAttributeVisitor(signatureCleaner));
+ programClass.methodsAccept(new AllAttributeVisitor(signatureCleaner));
+ programClass.attributesAccept(signatureCleaner);
// Compact the extra field pointing to the subclasses of this class.
programClass.subClasses =
@@ -272,7 +276,7 @@ implements ClassVisitor,
* This AttributeVisitor updates the Utf8 constants of signatures
* of classes, fields, and methods.
*/
- private class MySignatureShrinker
+ private class MySignatureCleaner
extends SimplifiedVisitor
implements AttributeVisitor
{
@@ -284,171 +288,41 @@ implements ClassVisitor,
Clazz[] referencedClasses = signatureAttribute.referencedClasses;
if (referencedClasses != null)
{
- // Go over the generic definitions, superclass, implemented
- // interfaces, etc.
+ // Go over the classes in the signature.
String signature = signatureAttribute.getSignature(clazz);
- InternalTypeEnumeration typeEnumeration =
- new InternalTypeEnumeration(signature);
+ DescriptorClassEnumeration classEnumeration =
+ new DescriptorClassEnumeration(signature);
- StringBuffer newSignatureBuffer = new StringBuffer();
+ int referencedClassIndex = 0;
- if (typeEnumeration.isMethodSignature())
- {
- newSignatureBuffer.append(typeEnumeration.formalTypeParameters());
- newSignatureBuffer.append(ClassConstants.METHOD_ARGUMENTS_OPEN);
- }
+ // Start construction a new signature.
+ StringBuffer newSignatureBuffer = new StringBuffer();
- int referencedClassIndex = 0;
- int newReferencedClassIndex = 0;
+ newSignatureBuffer.append(classEnumeration.nextFluff());
- // Consider the classes referenced by this signature.
- while (typeEnumeration.hasMoreTypes())
+ while (classEnumeration.hasMoreClassNames())
{
- String type = typeEnumeration.nextType();
+ String className = classEnumeration.nextClassName();
- DescriptorClassEnumeration classEnumeration =
- new DescriptorClassEnumeration(type);
-
- String initialFluff = classEnumeration.nextFluff();
-
- if (classEnumeration.hasMoreClassNames())
- {
- // Is the main type being used?
- Clazz referencedClass = referencedClasses[referencedClassIndex];
- if (referencedClass == null ||
- usageMarker.isUsed(referencedClass))
- {
- newSignatureBuffer.append(initialFluff);
-
- // Append the main type and its parameter types.
- while (classEnumeration.hasMoreClassNames())
- {
- String className = classEnumeration.nextClassName();
- boolean isInnerClassName = classEnumeration.isInnerClassName();
- String fluff = classEnumeration.nextFluff();
-
- referencedClass = referencedClasses[referencedClassIndex++];
-
- // Clear the parameter type if it is unused.
- if (referencedClass != null &&
- !usageMarker.isUsed(referencedClass))
- {
- className = ClassConstants.NAME_JAVA_LANG_OBJECT;
-
- referencedClass = null;
- }
-
- // Strip the outer class name again, if it's an inner class.
- else if (isInnerClassName)
- {
- className =
- className.substring(className.lastIndexOf(ClassConstants.INNER_CLASS_SEPARATOR)+1);
- }
-
- newSignatureBuffer.append(className);
- newSignatureBuffer.append(fluff);
-
- referencedClasses[newReferencedClassIndex++] =
- referencedClass;
- }
- }
- else
- {
- // Skip the type and all of its referenced classes.
- // This is only really suitable for superclass types
- // and interface types.
- referencedClassIndex += classEnumeration.classCount();
- }
- }
- else
+ // Replace the class name if it is unused.
+ Clazz referencedClass = referencedClasses[referencedClassIndex];
+ if (referencedClass != null &&
+ !usageMarker.isUsed(referencedClass))
{
- newSignatureBuffer.append(initialFluff);
- }
- }
+ className = ClassConstants.NAME_JAVA_LANG_OBJECT;
- if (typeEnumeration.isMethodSignature())
- {
- newSignatureBuffer.append(ClassConstants.METHOD_ARGUMENTS_CLOSE);
-
- // Is the main return type being used?
- String type = typeEnumeration.returnType();
-
- DescriptorClassEnumeration classEnumeration =
- new DescriptorClassEnumeration(type);
-
- String initialFluff = classEnumeration.nextFluff();
-
- if (classEnumeration.hasMoreClassNames())
- {
- // Is the main type being used?
- Clazz referencedClass = referencedClasses[referencedClassIndex];
- if (referencedClass == null ||
- usageMarker.isUsed(referencedClass))
- {
- newSignatureBuffer.append(initialFluff);
-
- // Append the main type and its parameter types.
- while (classEnumeration.hasMoreClassNames())
- {
- String className = classEnumeration.nextClassName();
- boolean isInnerClassName = classEnumeration.isInnerClassName();
- String fluff = classEnumeration.nextFluff();
-
- referencedClass = referencedClasses[referencedClassIndex++];
-
- // Clear the parameter type if it is unused.
- if (referencedClass != null &&
- !usageMarker.isUsed(referencedClass))
- {
- className = ClassConstants.NAME_JAVA_LANG_OBJECT;
-
- referencedClass = null;
- }
-
- // Strip the outer class name again, if it's an inner class.
- else if (isInnerClassName)
- {
- className =
- className.substring(className.lastIndexOf(ClassConstants.INNER_CLASS_SEPARATOR)+1);
- }
-
- newSignatureBuffer.append(className);
- newSignatureBuffer.append(fluff);
-
- referencedClasses[newReferencedClassIndex++] =
- referencedClass;
- }
- }
- else
- {
- newSignatureBuffer.append(ClassConstants.TYPE_JAVA_LANG_OBJECT);
-
- referencedClassIndex += classEnumeration.classCount();
-
- referencedClasses[newReferencedClassIndex++] = null;
- }
+ referencedClasses[referencedClassIndex] = null;
}
- else
- {
- newSignatureBuffer.append(initialFluff);
- }
- }
+ referencedClassIndex++;
- String newSignature = newSignatureBuffer.toString();
-
- if (!newSignature.equals(signature))
- {
- // Update the signature.
- ((Utf8Constant)((ProgramClass)clazz).constantPool[signatureAttribute.u2signatureIndex]).setString(newSignature);
-
- // Clear the unused entries.
- while (newReferencedClassIndex < referencedClassIndex)
- {
- referencedClasses[newReferencedClassIndex++] = null;
- }
+ newSignatureBuffer.append(className);
+ newSignatureBuffer.append(classEnumeration.nextFluff());
}
+
+ // Update the signature.
+ ((Utf8Constant)((ProgramClass)clazz).constantPool[signatureAttribute.u2signatureIndex]).setString(newSignatureBuffer.toString());
}
}
}
@@ -503,7 +377,8 @@ implements ClassVisitor,
Constant constant = constantPool[index];
- // Don't update the flag if this is the second half of a long entry.
+ // Is the constant being used? Don't update the flag if this is the
+ // second half of a long entry.
if (constant != null)
{
isUsed = usageMarker.isUsed(constant);
@@ -511,8 +386,17 @@ implements ClassVisitor,
if (isUsed)
{
+ // Remember the new index.
+ constantIndexMap[index] = counter;
+
+ // Shift the constant pool entry.
constantPool[counter++] = constant;
}
+ else
+ {
+ // Remember an invalid index.
+ constantIndexMap[index] = -1;
+ }
}
// Clear the remaining constant pool elements.
@@ -523,6 +407,28 @@ implements ClassVisitor,
/**
+ * Creates an array marking unused constant pool entries for all the
+ * elements in the given array of constant pool indices.
+ * @return an array of flags indicating unused elements.
+ */
+ private boolean[] shrinkFlags(Constant[] constantPool, int[] array, int length)
+ {
+ boolean[] unused = new boolean[length];
+
+ // Shift the used objects together.
+ for (int index = 0; index < length; index++)
+ {
+ if (!usageMarker.isUsed(constantPool[array[index]]))
+ {
+ unused[index] = true;
+ }
+ }
+
+ return unused;
+ }
+
+
+ /**
* Removes all indices that point to unused constant pool entries
* from the given array.
* @return the new number of indices.
@@ -598,14 +504,22 @@ implements ClassVisitor,
// Shift the used bootstrap methods together.
for (int index = 0; index < length; index++)
{
- bootstrapMethodIndexMap[index] = counter;
-
BootstrapMethodInfo bootstrapMethod = bootstrapMethods[index];
+ // Is the entry being used?
if (usageMarker.isUsed(bootstrapMethod))
{
+ // Remember the new index.
+ bootstrapMethodIndexMap[index] = counter;
+
+ // Shift the entry.
bootstrapMethods[counter++] = bootstrapMethod;
}
+ else
+ {
+ // Remember an invalid index.
+ bootstrapMethodIndexMap[index] = -1;
+ }
}
// Clear the remaining bootstrap methods.
diff --git a/src/proguard/shrink/InnerUsageMarker.java b/src/proguard/shrink/InnerUsageMarker.java
index a65b519..58f2e65 100644
--- a/src/proguard/shrink/InnerUsageMarker.java
+++ b/src/proguard/shrink/InnerUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/shrink/InterfaceUsageMarker.java b/src/proguard/shrink/InterfaceUsageMarker.java
index ecdf678..74eaf46 100644
--- a/src/proguard/shrink/InterfaceUsageMarker.java
+++ b/src/proguard/shrink/InterfaceUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -42,7 +42,7 @@ implements ClassVisitor,
{
private final UsageMarker usageMarker;
- // Fields acting as a return parameters for several methods.
+ // Fields acting as return parameters for the visitor methods.
private boolean used;
private boolean anyUsed;
diff --git a/src/proguard/shrink/LocalVariableTypeUsageMarker.java b/src/proguard/shrink/LocalVariableTypeUsageMarker.java
index 59af49e..27356a4 100644
--- a/src/proguard/shrink/LocalVariableTypeUsageMarker.java
+++ b/src/proguard/shrink/LocalVariableTypeUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -18,7 +18,6 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
package proguard.shrink;
import proguard.classfile.*;
@@ -48,7 +47,7 @@ implements AttributeVisitor,
{
private final UsageMarker usageMarker;
- // Fields acting as a return parameters for several methods.
+ // Fields acting as return values for several visitor methods.
private boolean tableUsed;
private boolean variableInfoUsed;
diff --git a/src/proguard/shrink/ShortestUsageMark.java b/src/proguard/shrink/ShortestUsageMark.java
index 80d1c8f..1f30500 100644
--- a/src/proguard/shrink/ShortestUsageMark.java
+++ b/src/proguard/shrink/ShortestUsageMark.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/shrink/ShortestUsageMarker.java b/src/proguard/shrink/ShortestUsageMarker.java
index 6718e68..b7207ff 100644
--- a/src/proguard/shrink/ShortestUsageMarker.java
+++ b/src/proguard/shrink/ShortestUsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/shrink/ShortestUsagePrinter.java b/src/proguard/shrink/ShortestUsagePrinter.java
index c6075ea..46f5051 100644
--- a/src/proguard/shrink/ShortestUsagePrinter.java
+++ b/src/proguard/shrink/ShortestUsagePrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/shrink/Shrinker.java b/src/proguard/shrink/Shrinker.java
index 753e569..1a2f07d 100644
--- a/src/proguard/shrink/Shrinker.java
+++ b/src/proguard/shrink/Shrinker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -88,6 +88,7 @@ public class Shrinker
// Mark the seeds.
programClassPool.accept(classPoolvisitor);
libraryClassPool.accept(classPoolvisitor);
+ libraryClassPool.classesAccept(usageMarker);
// Mark interfaces that have to be kept.
programClassPool.classesAccept(new InterfaceUsageMarker(usageMarker));
@@ -100,7 +101,6 @@ public class Shrinker
{
new InnerUsageMarker(usageMarker),
new AnnotationUsageMarker(usageMarker),
- new SignatureUsageMarker(usageMarker),
new LocalVariableTypeUsageMarker(usageMarker)
}))));
diff --git a/src/proguard/shrink/SignatureUsageMarker.java b/src/proguard/shrink/SignatureUsageMarker.java
deleted file mode 100644
index 91bfcdd..0000000
--- a/src/proguard/shrink/SignatureUsageMarker.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * ProGuard -- shrinking, optimization, obfuscation, and preverification
- * of Java bytecode.
- *
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-package proguard.shrink;
-
-import proguard.classfile.*;
-import proguard.classfile.attribute.*;
-import proguard.classfile.attribute.visitor.AttributeVisitor;
-import proguard.classfile.constant.Constant;
-import proguard.classfile.constant.visitor.ConstantVisitor;
-import proguard.classfile.util.SimplifiedVisitor;
-import proguard.classfile.visitor.ClassVisitor;
-
-/**
- * This AttributeVisitor recursively marks all Signature attributes that it
- * visits and that point to used classes.
- *
- * @see UsageMarker
- *
- * @author Eric Lafortune
- */
-public class SignatureUsageMarker
-extends SimplifiedVisitor
-implements AttributeVisitor,
- ClassVisitor,
- ConstantVisitor
-{
- private final UsageMarker usageMarker;
-
- // Fields acting as a return parameters for several methods.
- private boolean attributeUsed;
-
-
- /**
- * Creates a new SignatureUsageMarker.
- * @param usageMarker the usage marker that is used to mark the classes
- * and class members.
- */
- public SignatureUsageMarker(UsageMarker usageMarker)
- {
- this.usageMarker = usageMarker;
- }
-
-
- // Implementations for AttributeVisitor.
-
- public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}
-
-
- public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
- {
- // Only keep the signature if any of its classes are used.
- attributeUsed = false;
- signatureAttribute.referencedClassesAccept(this);
-
- if (attributeUsed)
- {
- // We got a positive used flag, so the signature is useful.
- usageMarker.markAsUsed(signatureAttribute);
-
- markConstant(clazz, signatureAttribute.u2attributeNameIndex);
- markConstant(clazz, signatureAttribute.u2signatureIndex);
- }
- }
-
-
- // Implementations for ClassVisitor.
-
- public void visitLibraryClass(LibraryClass libraryClass)
- {
- attributeUsed = true;
- }
-
-
- public void visitProgramClass(ProgramClass programClass)
- {
- // Don't keep the signature if one of its classes is not used.
- if (usageMarker.isUsed(programClass))
- {
- attributeUsed = true;
- }
- }
-
-
- // Implementations for ConstantVisitor.
-
- public void visitAnyConstant(Clazz clazz, Constant constant)
- {
- usageMarker.markAsUsed(constant);
- }
-
-
- // Small utility methods.
-
- /**
- * Marks the given constant pool entry of the given class.
- */
- private void markConstant(Clazz clazz, int index)
- {
- clazz.constantPoolEntryAccept(index, this);
- }
-}
diff --git a/src/proguard/shrink/UsageMarker.java b/src/proguard/shrink/UsageMarker.java
index 949ca2c..3c5e1c6 100644
--- a/src/proguard/shrink/UsageMarker.java
+++ b/src/proguard/shrink/UsageMarker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -33,7 +33,6 @@ import proguard.classfile.instruction.visitor.InstructionVisitor;
import proguard.classfile.util.*;
import proguard.classfile.visitor.*;
-
/**
* This ClassVisitor and MemberVisitor recursively marks all classes and class
* elements that are being used.
@@ -67,6 +66,7 @@ implements ClassVisitor,
private final MyInterfaceUsageMarker interfaceUsageMarker = new MyInterfaceUsageMarker();
+ private final MyDefaultMethodUsageMarker defaultMethodUsageMarker = new MyDefaultMethodUsageMarker();
private final MyPossiblyUsedMemberUsageMarker possiblyUsedMemberUsageMarker = new MyPossiblyUsedMemberUsageMarker();
private final MemberVisitor nonEmptyMethodUsageMarker = new AllAttributeVisitor(
new MyNonEmptyMethodUsageMarker());
@@ -181,6 +181,32 @@ implements ClassVisitor,
/**
+ * This MemberVisitor marks ProgramMethod objects of default
+ * implementations that may be present in interface classes.
+ */
+ private class MyDefaultMethodUsageMarker
+ extends SimplifiedVisitor
+ implements MemberVisitor
+ {
+ // Implementations for MemberVisitor.
+
+ public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
+ {
+ if (shouldBeMarkedAsUsed(programMethod))
+ {
+ markAsUsed(programMethod);
+
+ // Mark the method body.
+ markProgramMethodBody(programClass, programMethod);
+
+ // Note that, if the method has been marked as possibly used,
+ // the method hierarchy has already been marked (cfr. below).
+ }
+ }
+ }
+
+
+ /**
* This MemberVisitor marks ProgramField and ProgramMethod objects that
* have already been marked as possibly used.
*/
@@ -354,6 +380,8 @@ implements ClassVisitor,
*/
protected void markMethodHierarchy(Clazz clazz, Method method)
{
+ // Only visit the hierarchy if the method is not private, static, or
+ // an initializer.
int accessFlags = method.getAccessFlags();
if ((accessFlags &
(ClassConstants.ACC_PRIVATE |
@@ -369,6 +397,19 @@ implements ClassVisitor,
((accessFlags & ClassConstants.ACC_PUBLIC) == 0 ? 0 :
ClassConstants.ACC_ABSTRACT);
+ // Mark default implementations in interfaces down the hierarchy,
+ // if this is an interface itself.
+ // TODO: This may be premature if there aren't any concrete implementing classes.
+ clazz.accept(new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0,
+ new ClassHierarchyTraveler(false, false, false, true,
+ new ProgramClassFilter(
+ new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0,
+ new NamedMethodVisitor(method.getName(clazz),
+ method.getDescriptor(clazz),
+ new MemberAccessFilter(0, requiredUnsetAccessFlags,
+ defaultMethodUsageMarker)))))));
+
+ // Mark other implementations.
clazz.accept(new ConcreteClassDownTraveler(
new ClassHierarchyTraveler(true, true, false, true,
new NamedMethodVisitor(method.getName(clazz),
@@ -449,6 +490,9 @@ implements ClassVisitor,
markConstant(clazz, invokeDynamicConstant.u2nameAndTypeIndex);
+ // Mark the referenced descriptor classes.
+ invokeDynamicConstant.referencedClassesAccept(this);
+
// Mark the bootstrap methods attribute.
clazz.attributesAccept(new MyBootStrapMethodUsageMarker(invokeDynamicConstant.u2bootstrapMethodAttributeIndex));
}
@@ -662,12 +706,15 @@ implements ClassVisitor,
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
{
- // Don't mark the attribute and its contents yet. We may mark them later,
- // in SignatureUsageMarker.
- //markAsUsed(signatureAttribute);
- //
- //markConstant(clazz, signatureAttribute.u2attributeNameIndex);
- //markConstant(clazz, signatureAttribute.u2signatureIndex);
+ markAsUsed(signatureAttribute);
+
+ markConstant(clazz, signatureAttribute.u2attributeNameIndex);
+ markConstant(clazz, signatureAttribute.u2signatureIndex);
+
+ // Don't mark the referenced classes. We'll clean them up in
+ // ClassShrinker, if they appear unused.
+ //// Mark the classes referenced in the descriptor string.
+ //signatureAttribute.referencedClassesAccept(this);
}
@@ -802,12 +849,12 @@ implements ClassVisitor,
{
// Don't mark the attribute and its contents yet. We may mark them later,
// in AnnotationUsageMarker.
-// markAsUsed(annotationDefaultAttribute);
-//
-// markConstant(clazz, annotationDefaultAttribute.u2attributeNameIndex);
-//
-// // Mark the constant pool entries referenced by the element value.
-// annotationDefaultAttribute.defaultValueAccept(clazz, this);
+ //markAsUsed(annotationDefaultAttribute);
+ //
+ //markConstant(clazz, annotationDefaultAttribute.u2attributeNameIndex);
+ //
+ //// Mark the constant pool entries referenced by the element value.
+ //annotationDefaultAttribute.defaultValueAccept(clazz, this);
}
diff --git a/src/proguard/shrink/UsagePrinter.java b/src/proguard/shrink/UsagePrinter.java
index 2b1a9d8..9ca381e 100644
--- a/src/proguard/shrink/UsagePrinter.java
+++ b/src/proguard/shrink/UsagePrinter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/shrink/UsedClassFilter.java b/src/proguard/shrink/UsedClassFilter.java
index 93548c5..45fe7bf 100644
--- a/src/proguard/shrink/UsedClassFilter.java
+++ b/src/proguard/shrink/UsedClassFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/shrink/UsedMemberFilter.java b/src/proguard/shrink/UsedMemberFilter.java
index d5ff5b0..c15f861 100644
--- a/src/proguard/shrink/UsedMemberFilter.java
+++ b/src/proguard/shrink/UsedMemberFilter.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/AndMatcher.java b/src/proguard/util/AndMatcher.java
index 2322bd0..151119a 100644
--- a/src/proguard/util/AndMatcher.java
+++ b/src/proguard/util/AndMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ArrayUtil.java b/src/proguard/util/ArrayUtil.java
index f2bcfe1..0afb849 100644
--- a/src/proguard/util/ArrayUtil.java
+++ b/src/proguard/util/ArrayUtil.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ClassNameParser.java b/src/proguard/util/ClassNameParser.java
index a756eba..b82dbee 100644
--- a/src/proguard/util/ClassNameParser.java
+++ b/src/proguard/util/ClassNameParser.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ConstantMatcher.java b/src/proguard/util/ConstantMatcher.java
index d8b9223..96a429f 100644
--- a/src/proguard/util/ConstantMatcher.java
+++ b/src/proguard/util/ConstantMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/EmptyStringMatcher.java b/src/proguard/util/EmptyStringMatcher.java
index 65c518d..d652234 100644
--- a/src/proguard/util/EmptyStringMatcher.java
+++ b/src/proguard/util/EmptyStringMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ExtensionMatcher.java b/src/proguard/util/ExtensionMatcher.java
index 5ee9175..e1305d5 100644
--- a/src/proguard/util/ExtensionMatcher.java
+++ b/src/proguard/util/ExtensionMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/FileNameParser.java b/src/proguard/util/FileNameParser.java
index a988ff8..e00fa81 100644
--- a/src/proguard/util/FileNameParser.java
+++ b/src/proguard/util/FileNameParser.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/FixedStringMatcher.java b/src/proguard/util/FixedStringMatcher.java
index bc81343..d6603b5 100644
--- a/src/proguard/util/FixedStringMatcher.java
+++ b/src/proguard/util/FixedStringMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ListMatcher.java b/src/proguard/util/ListMatcher.java
index cad117d..b9efc0b 100644
--- a/src/proguard/util/ListMatcher.java
+++ b/src/proguard/util/ListMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ListParser.java b/src/proguard/util/ListParser.java
index c8e3dc4..c8116c9 100644
--- a/src/proguard/util/ListParser.java
+++ b/src/proguard/util/ListParser.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ListUtil.java b/src/proguard/util/ListUtil.java
index 9004e69..7294a1e 100644
--- a/src/proguard/util/ListUtil.java
+++ b/src/proguard/util/ListUtil.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/NameParser.java b/src/proguard/util/NameParser.java
index 30d7c5f..9b44147 100644
--- a/src/proguard/util/NameParser.java
+++ b/src/proguard/util/NameParser.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/NotMatcher.java b/src/proguard/util/NotMatcher.java
index 7820cc8..32fff61 100644
--- a/src/proguard/util/NotMatcher.java
+++ b/src/proguard/util/NotMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/ObjectUtil.java b/src/proguard/util/ObjectUtil.java
index 4d2c159..05dea47 100644
--- a/src/proguard/util/ObjectUtil.java
+++ b/src/proguard/util/ObjectUtil.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/OrMatcher.java b/src/proguard/util/OrMatcher.java
index b51809c..5bc2976 100644
--- a/src/proguard/util/OrMatcher.java
+++ b/src/proguard/util/OrMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/SettableMatcher.java b/src/proguard/util/SettableMatcher.java
index 3674a3e..8761953 100644
--- a/src/proguard/util/SettableMatcher.java
+++ b/src/proguard/util/SettableMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/StringMatcher.java b/src/proguard/util/StringMatcher.java
index 91fae4c..a58be6f 100644
--- a/src/proguard/util/StringMatcher.java
+++ b/src/proguard/util/StringMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/StringParser.java b/src/proguard/util/StringParser.java
index 8e49293..9026c2b 100644
--- a/src/proguard/util/StringParser.java
+++ b/src/proguard/util/StringParser.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/util/VariableStringMatcher.java b/src/proguard/util/VariableStringMatcher.java
index e83ed05..b1c469d 100644
--- a/src/proguard/util/VariableStringMatcher.java
+++ b/src/proguard/util/VariableStringMatcher.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/src/proguard/wtk/ProGuardObfuscator.java b/src/proguard/wtk/ProGuardObfuscator.java
index d8bbd56..f0f3778 100644
--- a/src/proguard/wtk/ProGuardObfuscator.java
+++ b/src/proguard/wtk/ProGuardObfuscator.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2014 Eric Lafortune (eric at graphics.cornell.edu)
+ * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/proguard.git
More information about the pkg-java-commits
mailing list