proguard

16:51:03.590 INFO  jd.cli.Main - Decompiling proguard.jar
package proguard;

import java.io.PrintStream;
import java.util.List;
import proguard.io.CascadingDataEntryWriter;
import proguard.io.DataEntryNameFilter;
import proguard.io.DataEntryParentFilter;
import proguard.io.DataEntryWriter;
import proguard.io.DirectoryWriter;
import proguard.io.FilteredDataEntryWriter;
import proguard.io.JarWriter;
import proguard.io.ParentDataEntryWriter;
import proguard.util.ExtensionMatcher;
import proguard.util.FileNameParser;
import proguard.util.ListParser;

public class DataEntryWriterFactory
{
  public static DataEntryWriter createDataEntryWriter(ClassPath paramClassPath, int paramInt1, int paramInt2)
  {
    DataEntryWriter localDataEntryWriter = null;
    for (int i = paramInt2 - 1; i >= paramInt1; i--)
    {
      ClassPathEntry localClassPathEntry = paramClassPath.get(i);
      localDataEntryWriter = createClassPathEntryWriter(localClassPathEntry, localDataEntryWriter);
    }
    return localDataEntryWriter;
  }
  
  private static DataEntryWriter createClassPathEntryWriter(ClassPathEntry paramClassPathEntry, DataEntryWriter paramDataEntryWriter)
  {
    boolean bool1 = paramClassPathEntry.isJar();
    boolean bool2 = paramClassPathEntry.isWar();
    boolean bool3 = paramClassPathEntry.isEar();
    boolean bool4 = paramClassPathEntry.isZip();
    
    List localList1 = paramClassPathEntry.getFilter();
    List localList2 = paramClassPathEntry.getJarFilter();
    List localList3 = paramClassPathEntry.getWarFilter();
    List localList4 = paramClassPathEntry.getEarFilter();
    List localList5 = paramClassPathEntry.getZipFilter();
    
    System.out.println("Preparing output " + (bool4 ? "zip" : bool3 ? "ear" : bool2 ? "war" : bool1 ? "jar" : "directory") + " [" + paramClassPathEntry.getName() + "]" + ((localList1 != null) || (localList2 != null) || (localList3 != null) || (localList4 != null) || (localList5 != null) ? " (filtered)" : ""));
    
    Object localObject = new DirectoryWriter(paramClassPathEntry.getFile(), (bool1) || (bool2) || (bool3) || (bool4));
    
    localObject = wrapInJarWriter((DataEntryWriter)localObject, bool4, localList5, ".zip", (bool1) || (bool2) || (bool3));
    localObject = wrapInJarWriter((DataEntryWriter)localObject, bool3, localList4, ".ear", (bool1) || (bool2));
    localObject = wrapInJarWriter((DataEntryWriter)localObject, bool2, localList3, ".war", bool1);
    localObject = wrapInJarWriter((DataEntryWriter)localObject, bool1, localList2, ".jar", false);
    
    localObject = localList1 != null ? new FilteredDataEntryWriter(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(localList1)), (DataEntryWriter)localObject) : localObject;
    
    return paramDataEntryWriter != null ? new CascadingDataEntryWriter((DataEntryWriter)localObject, paramDataEntryWriter) : localObject;
  }
  
  private static DataEntryWriter wrapInJarWriter(DataEntryWriter paramDataEntryWriter, boolean paramBoolean1, List paramList, String paramString, boolean paramBoolean2)
  {
    JarWriter localJarWriter1 = paramBoolean2 ? new ParentDataEntryWriter(paramDataEntryWriter) : new JarWriter(paramDataEntryWriter);
    
    JarWriter localJarWriter2 = paramList != null ? new FilteredDataEntryWriter(new DataEntryParentFilter(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(paramList))), localJarWriter1) : localJarWriter1;
    
    return new FilteredDataEntryWriter(new DataEntryParentFilter(new DataEntryNameFilter(new ExtensionMatcher(paramString))), localJarWriter2, paramBoolean1 ? localJarWriter1 : paramDataEntryWriter);
  }
}

/* Location:
 * Qualified Name:     proguard.DataEntryWriterFactory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard;

import java.io.File;
import java.io.IOException;
import java.util.List;
import proguard.util.ListUtil;

public class ClassPathEntry
{
  private File file;
  private boolean output;
  private List filter;
  private List jarFilter;
  private List warFilter;
  private List earFilter;
  private List zipFilter;
  
  public ClassPathEntry(File paramFile, boolean paramBoolean)
  {
    file = paramFile;
    output = paramBoolean;
  }
  
  public String getName()
  {
    try
    {
      return file.getCanonicalPath();
    }
    catch (IOException localIOException) {}
    return file.getPath();
  }
  
  public File getFile()
  {
    return file;
  }
  
  public void setFile(File paramFile)
  {
    file = paramFile;
  }
  
  public boolean isOutput()
  {
    return output;
  }
  
  public void setOutput(boolean paramBoolean)
  {
    output = paramBoolean;
  }
  
  public boolean isJar()
  {
    return hasExtension(".jar");
  }
  
  public boolean isWar()
  {
    return hasExtension(".war");
  }
  
  public boolean isEar()
  {
    return hasExtension(".ear");
  }
  
  public boolean isZip()
  {
    return hasExtension(".zip");
  }
  
  private boolean hasExtension(String paramString)
  {
    return endsWithIgnoreCase(file.getPath(), paramString);
  }
  
  private static boolean endsWithIgnoreCase(String paramString1, String paramString2)
  {
    int i = paramString1.length();
    int j = paramString2.length();
    
    return paramString1.regionMatches(true, i - j, paramString2, 0, j);
  }
  
  public List getFilter()
  {
    return filter;
  }
  
  public void setFilter(List paramList)
  {
    filter = ((paramList == null) || (paramList.size() == 0) ? null : paramList);
  }
  
  public List getJarFilter()
  {
    return jarFilter;
  }
  
  public void setJarFilter(List paramList)
  {
    jarFilter = ((paramList == null) || (paramList.size() == 0) ? null : paramList);
  }
  
  public List getWarFilter()
  {
    return warFilter;
  }
  
  public void setWarFilter(List paramList)
  {
    warFilter = ((paramList == null) || (paramList.size() == 0) ? null : paramList);
  }
  
  public List getEarFilter()
  {
    return earFilter;
  }
  
  public void setEarFilter(List paramList)
  {
    earFilter = ((paramList == null) || (paramList.size() == 0) ? null : paramList);
  }
  
  public List getZipFilter()
  {
    return zipFilter;
  }
  
  public void setZipFilter(List paramList)
  {
    zipFilter = ((paramList == null) || (paramList.size() == 0) ? null : paramList);
  }
  
  public String toString()
  {
    String str = getName();
    if ((filter != null) || (jarFilter != null) || (warFilter != null) || (earFilter != null) || (zipFilter != null)) {
      str = str + "(" + (zipFilter != null ? ListUtil.commaSeparatedString(zipFilter, true) : "") + ";" + (earFilter != null ? ListUtil.commaSeparatedString(earFilter, true) : "") + ";" + (warFilter != null ? ListUtil.commaSeparatedString(warFilter, true) : "") + ";" + (jarFilter != null ? ListUtil.commaSeparatedString(jarFilter, true) : "") + ";" + (filter != null ? ListUtil.commaSeparatedString(filter, true) : "") + ")";
    }
    return str;
  }
}

/* Location:
 * Qualified Name:     proguard.ClassPathEntry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.Clazz;
import proguard.classfile.LibraryClass;
import proguard.classfile.ProgramClass;
import proguard.classfile.attribute.Attribute;
import proguard.classfile.attribute.InnerClassesAttribute;
import proguard.classfile.attribute.InnerClassesInfo;
import proguard.classfile.attribute.visitor.AttributeVisitor;
import proguard.classfile.attribute.visitor.InnerClassesInfoVisitor;
import proguard.classfile.constant.ClassConstant;
import proguard.classfile.constant.Utf8Constant;
import proguard.classfile.constant.visitor.ConstantVisitor;
import proguard.classfile.util.SimplifiedVisitor;
import proguard.classfile.visitor.ClassVisitor;

public class InnerUsageMarker
  extends SimplifiedVisitor
  implements AttributeVisitor, InnerClassesInfoVisitor, ConstantVisitor, ClassVisitor
{
  private final UsageMarker usageMarker;
  private boolean attributeUsed;
  private boolean classUsed;
  
  public InnerUsageMarker(UsageMarker paramUsageMarker)
  {
    usageMarker = paramUsageMarker;
  }
  
  public void visitAnyAttribute(Clazz paramClazz, Attribute paramAttribute) {}
  
  public void visitInnerClassesAttribute(Clazz paramClazz, InnerClassesAttribute paramInnerClassesAttribute)
  {
    attributeUsed = false;
    paramInnerClassesAttribute.innerClassEntriesAccept(paramClazz, this);
    if (attributeUsed)
    {
      usageMarker.markAsUsed(paramInnerClassesAttribute);
      
      markConstant(paramClazz, u2attributeNameIndex);
    }
  }
  
  public void visitInnerClassesInfo(Clazz paramClazz, InnerClassesInfo paramInnerClassesInfo)
  {
    boolean bool = usageMarker.isUsed(paramInnerClassesInfo);
    if (!bool)
    {
      classUsed = true;
      paramInnerClassesInfo.innerClassConstantAccept(paramClazz, this);
      bool = classUsed;
      
      classUsed = true;
      paramInnerClassesInfo.outerClassConstantAccept(paramClazz, this);
      bool &= classUsed;
      if (bool)
      {
        usageMarker.markAsUsed(paramInnerClassesInfo);
        
        paramInnerClassesInfo.innerNameConstantAccept(paramClazz, this);
      }
    }
    attributeUsed |= bool;
  }
  
  public void visitClassConstant(Clazz paramClazz, ClassConstant paramClassConstant)
  {
    classUsed = usageMarker.isUsed(paramClassConstant);
    if (!classUsed)
    {
      classUsed = true;
      paramClassConstant.referencedClassAccept(this);
      if (classUsed)
      {
        usageMarker.markAsUsed(paramClassConstant);
        
        markConstant(paramClazz, u2nameIndex);
      }
    }
  }
  
  public void visitUtf8Constant(Clazz paramClazz, Utf8Constant paramUtf8Constant)
  {
    usageMarker.markAsUsed(paramUtf8Constant);
  }
  
  public void visitProgramClass(ProgramClass paramProgramClass)
  {
    classUsed = usageMarker.isUsed(paramProgramClass);
  }
  
  public void visitLibraryClass(LibraryClass paramLibraryClass)
  {
    classUsed = true;
  }
  
  private void markConstant(Clazz paramClazz, int paramInt)
  {
    paramClazz.constantPoolEntryAccept(paramInt, this);
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.InnerUsageMarker
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.Clazz;
import proguard.classfile.Member;
import proguard.classfile.visitor.ClassVisitor;
import proguard.classfile.visitor.MemberVisitor;

final class ShortestUsageMark
{
  private final boolean certain;
  private final String reason;
  private final int depth;
  private Clazz clazz;
  private Member member;
  
  public ShortestUsageMark(String paramString)
  {
    certain = true;
    reason = paramString;
    depth = 0;
  }
  
  public ShortestUsageMark(ShortestUsageMark paramShortestUsageMark, String paramString, int paramInt, Clazz paramClazz)
  {
    this(paramShortestUsageMark, paramString, paramInt, paramClazz, null);
  }
  
  public ShortestUsageMark(ShortestUsageMark paramShortestUsageMark, String paramString, int paramInt, Clazz paramClazz, Member paramMember)
  {
    certain = true;
    reason = paramString;
    depth += paramInt;
    clazz = paramClazz;
    member = paramMember;
  }
  
  public ShortestUsageMark(ShortestUsageMark paramShortestUsageMark, boolean paramBoolean)
  {
    certain = paramBoolean;
    reason = reason;
    depth = depth;
    clazz = clazz;
    member = member;
  }
  
  public boolean isCertain()
  {
    return certain;
  }
  
  public String getReason()
  {
    return reason;
  }
  
  public boolean isShorter(ShortestUsageMark paramShortestUsageMark)
  {
    return depth < depth;
  }
  
  public boolean isCausedBy(Clazz paramClazz)
  {
    return paramClazz.equals(clazz);
  }
  
  public void acceptClassVisitor(ClassVisitor paramClassVisitor)
  {
    if ((clazz != null) && (member == null)) {
      clazz.accept(paramClassVisitor);
    }
  }
  
  public void acceptMemberVisitor(MemberVisitor paramMemberVisitor)
  {
    if ((clazz != null) && (member != null)) {
      member.accept(clazz, paramMemberVisitor);
    }
  }
  
  public String toString()
  {
    return "certain=" + certain + ", depth=" + depth + ": " + reason + (clazz != null ? clazz.getName() : "(none)") + ": " + (member != null ? member.getName(clazz) : "(none)");
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.ShortestUsageMark
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.Clazz;
import proguard.classfile.LibraryClass;
import proguard.classfile.LibraryField;
import proguard.classfile.LibraryMethod;
import proguard.classfile.ProgramClass;
import proguard.classfile.ProgramField;
import proguard.classfile.ProgramMethod;
import proguard.classfile.VisitorAccepter;
import proguard.classfile.visitor.ClassVisitor;
import proguard.classfile.visitor.MemberVisitor;

class ShortestUsageMarker$MyRecursiveCauseChecker
  implements ClassVisitor, MemberVisitor
{
  private Clazz checkClass;
  private boolean isRecursing;
  private final ShortestUsageMarker this$0;
  
  private ShortestUsageMarker$MyRecursiveCauseChecker(ShortestUsageMarker paramShortestUsageMarker)
  {
    this$0 = paramShortestUsageMarker;
  }
  
  ShortestUsageMarker$MyRecursiveCauseChecker(ShortestUsageMarker paramShortestUsageMarker, ShortestUsageMarker.1 param1)
  {
    this(paramShortestUsageMarker);
  }
  
  public boolean check(ShortestUsageMark paramShortestUsageMark, Clazz paramClazz)
  {
    checkClass = paramClazz;
    isRecursing = false;
    
    paramShortestUsageMark.acceptClassVisitor(this);
    paramShortestUsageMark.acceptMemberVisitor(this);
    
    return isRecursing;
  }
  
  public void visitProgramClass(ProgramClass paramProgramClass)
  {
    checkCause(paramProgramClass);
  }
  
  public void visitLibraryClass(LibraryClass paramLibraryClass)
  {
    checkCause(paramLibraryClass);
  }
  
  public void visitProgramField(ProgramClass paramProgramClass, ProgramField paramProgramField)
  {
    checkCause(paramProgramField);
  }
  
  public void visitProgramMethod(ProgramClass paramProgramClass, ProgramMethod paramProgramMethod)
  {
    checkCause(paramProgramMethod);
  }
  
  public void visitLibraryField(LibraryClass paramLibraryClass, LibraryField paramLibraryField)
  {
    checkCause(paramLibraryField);
  }
  
  public void visitLibraryMethod(LibraryClass paramLibraryClass, LibraryMethod paramLibraryMethod)
  {
    checkCause(paramLibraryMethod);
  }
  
  private void checkCause(VisitorAccepter paramVisitorAccepter)
  {
    if (this$0.isUsed(paramVisitorAccepter))
    {
      ShortestUsageMark localShortestUsageMark = this$0.getShortestUsageMark(paramVisitorAccepter);
      
      isRecursing = localShortestUsageMark.isCausedBy(checkClass);
      if (!isRecursing)
      {
        localShortestUsageMark.acceptClassVisitor(this);
        localShortestUsageMark.acceptMemberVisitor(this);
      }
    }
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.ShortestUsageMarker.MyRecursiveCauseChecker
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.Clazz;
import proguard.classfile.LibraryClass;
import proguard.classfile.ProgramClass;
import proguard.classfile.constant.ClassConstant;
import proguard.classfile.constant.Utf8Constant;
import proguard.classfile.constant.visitor.ConstantVisitor;
import proguard.classfile.util.SimplifiedVisitor;
import proguard.classfile.visitor.ClassVisitor;

public class InterfaceUsageMarker
  extends SimplifiedVisitor
  implements ClassVisitor, ConstantVisitor
{
  private final UsageMarker usageMarker;
  private boolean used;
  private boolean anyUsed;
  
  public InterfaceUsageMarker(UsageMarker paramUsageMarker)
  {
    usageMarker = paramUsageMarker;
  }
  
  public void visitProgramClass(ProgramClass paramProgramClass)
  {
    boolean bool1 = usageMarker.isUsed(paramProgramClass);
    boolean bool2 = usageMarker.isPossiblyUsed(paramProgramClass);
    if ((bool1) || (bool2))
    {
      boolean bool3 = anyUsed;
      anyUsed = false;
      
      paramProgramClass.interfaceConstantsAccept(this);
      
      bool1 |= anyUsed;
      anyUsed = bool3;
      if (bool2) {
        if (bool1)
        {
          usageMarker.markAsUsed(paramProgramClass);
          
          paramProgramClass.thisClassConstantAccept(this);
          
          paramProgramClass.superClassConstantAccept(this);
        }
        else
        {
          usageMarker.markAsUnused(paramProgramClass);
        }
      }
    }
    used = bool1;
  }
  
  public void visitLibraryClass(LibraryClass paramLibraryClass)
  {
    used = true;
    anyUsed = true;
  }
  
  public void visitClassConstant(Clazz paramClazz, ClassConstant paramClassConstant)
  {
    boolean bool = usageMarker.isUsed(paramClassConstant);
    if (!bool)
    {
      paramClassConstant.referencedClassAccept(this);
      bool = used;
      if (bool)
      {
        usageMarker.markAsUsed(paramClassConstant);
        
        paramClazz.constantPoolEntryAccept(u2nameIndex, this);
      }
    }
    used = bool;
    anyUsed |= bool;
  }
  
  public void visitUtf8Constant(Clazz paramClazz, Utf8Constant paramUtf8Constant)
  {
    if (!usageMarker.isUsed(paramUtf8Constant)) {
      usageMarker.markAsUsed(paramUtf8Constant);
    }
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.InterfaceUsageMarker
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import java.io.PrintStream;
import proguard.classfile.LibraryClass;
import proguard.classfile.LibraryField;
import proguard.classfile.LibraryMethod;
import proguard.classfile.ProgramClass;
import proguard.classfile.ProgramField;
import proguard.classfile.ProgramMember;
import proguard.classfile.ProgramMethod;
import proguard.classfile.VisitorAccepter;
import proguard.classfile.util.ClassUtil;
import proguard.classfile.visitor.ClassVisitor;
import proguard.classfile.visitor.MemberVisitor;

public class ShortestUsagePrinter
  implements ClassVisitor, MemberVisitor
{
  private final ShortestUsageMarker shortestUsageMarker;
  private final boolean verbose;
  private final PrintStream ps;
  
  public ShortestUsagePrinter(ShortestUsageMarker paramShortestUsageMarker)
  {
    this(paramShortestUsageMarker, true);
  }
  
  public ShortestUsagePrinter(ShortestUsageMarker paramShortestUsageMarker, boolean paramBoolean)
  {
    this(paramShortestUsageMarker, paramBoolean, System.out);
  }
  
  public ShortestUsagePrinter(ShortestUsageMarker paramShortestUsageMarker, boolean paramBoolean, PrintStream paramPrintStream)
  {
    shortestUsageMarker = paramShortestUsageMarker;
    verbose = paramBoolean;
    ps = paramPrintStream;
  }
  
  public void visitProgramClass(ProgramClass paramProgramClass)
  {
    ps.println(ClassUtil.externalClassName(paramProgramClass.getName()));
    
    printReason(paramProgramClass);
  }
  
  public void visitLibraryClass(LibraryClass paramLibraryClass)
  {
    ps.println(ClassUtil.externalClassName(paramLibraryClass.getName()));
    
    ps.println("  is a library class.\n");
  }
  
  public void visitProgramField(ProgramClass paramProgramClass, ProgramField paramProgramField)
  {
    String str1 = paramProgramField.getName(paramProgramClass);
    String str2 = paramProgramField.getDescriptor(paramProgramClass);
    
    ps.println(ClassUtil.externalClassName(paramProgramClass.getName()) + (verbose ? ": " + ClassUtil.externalFullFieldDescription(0, str1, str2) : new StringBuffer().append(".").append(str1).toString()) + lineNumberRange(paramProgramClass, paramProgramField));
    
    printReason(paramProgramField);
  }
  
  public void visitProgramMethod(ProgramClass paramProgramClass, ProgramMethod paramProgramMethod)
  {
    String str1 = paramProgramMethod.getName(paramProgramClass);
    String str2 = paramProgramMethod.getDescriptor(paramProgramClass);
    
    ps.println(ClassUtil.externalClassName(paramProgramClass.getName()) + (verbose ? ": " + ClassUtil.externalFullMethodDescription(paramProgramClass.getName(), 0, str1, str2) : new StringBuffer().append(".").append(str1).toString()) + lineNumberRange(paramProgramClass, paramProgramMethod));
    
    printReason(paramProgramMethod);
  }
  
  public void visitLibraryField(LibraryClass paramLibraryClass, LibraryField paramLibraryField)
  {
    String str1 = paramLibraryField.getName(paramLibraryClass);
    String str2 = paramLibraryField.getDescriptor(paramLibraryClass);
    
    ps.println(ClassUtil.externalClassName(paramLibraryClass.getName()) + (verbose ? ": " + ClassUtil.externalFullFieldDescription(0, str1, str2) : new StringBuffer().append(".").append(str1).toString()));
    
    ps.println("  is a library field.\n");
  }
  
  public void visitLibraryMethod(LibraryClass paramLibraryClass, LibraryMethod paramLibraryMethod)
  {
    String str1 = paramLibraryMethod.getName(paramLibraryClass);
    String str2 = paramLibraryMethod.getDescriptor(paramLibraryClass);
    
    ps.println(ClassUtil.externalClassName(paramLibraryClass.getName()) + (verbose ? ": " + ClassUtil.externalFullMethodDescription(paramLibraryClass.getName(), 0, str1, str2) : new StringBuffer().append(".").append(str1).toString()));
    
    ps.println("  is a library method.\n");
  }
  
  private void printReason(VisitorAccepter paramVisitorAccepter)
  {
    if (shortestUsageMarker.isUsed(paramVisitorAccepter))
    {
      ShortestUsageMark localShortestUsageMark = shortestUsageMarker.getShortestUsageMark(paramVisitorAccepter);
      
      ps.print("  " + localShortestUsageMark.getReason());
      
      localShortestUsageMark.acceptClassVisitor(this);
      localShortestUsageMark.acceptMemberVisitor(this);
    }
    else
    {
      ps.println("  is not being kept.\n");
    }
  }
  
  private static String lineNumberRange(ProgramClass paramProgramClass, ProgramMember paramProgramMember)
  {
    String str = paramProgramMember.getLineNumberRange(paramProgramClass);
    return str != null ? " (" + str + ")" : "";
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.ShortestUsagePrinter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.Clazz;
import proguard.classfile.LibraryClass;
import proguard.classfile.LibraryField;
import proguard.classfile.LibraryMethod;
import proguard.classfile.Method;
import proguard.classfile.ProgramClass;
import proguard.classfile.ProgramField;
import proguard.classfile.ProgramMethod;
import proguard.classfile.VisitorAccepter;
import proguard.classfile.visitor.ClassVisitor;
import proguard.classfile.visitor.MemberVisitor;

public class ShortestUsageMarker
  extends UsageMarker
{
  private static final ShortestUsageMark INITIAL_MARK = new ShortestUsageMark("is kept by a directive in the configuration.\n\n");
  private ShortestUsageMark currentUsageMark;
  private final MyRecursiveCauseChecker recursiveCauseChecker;
  
  public ShortestUsageMarker()
  {
    currentUsageMark = INITIAL_MARK;
    
    recursiveCauseChecker = new MyRecursiveCauseChecker(null);
  }
  
  protected void markProgramClassBody(ProgramClass paramProgramClass)
  {
    ShortestUsageMark localShortestUsageMark = currentUsageMark;
    
    currentUsageMark = new ShortestUsageMark(getShortestUsageMark(paramProgramClass), "is extended by   ", 10000, paramProgramClass);
    
    super.markProgramClassBody(paramProgramClass);
    
    currentUsageMark = localShortestUsageMark;
  }
  
  protected void markProgramFieldBody(ProgramClass paramProgramClass, ProgramField paramProgramField)
  {
    ShortestUsageMark localShortestUsageMark = currentUsageMark;
    
    currentUsageMark = new ShortestUsageMark(getShortestUsageMark(paramProgramField), "is referenced by ", 1, paramProgramClass, paramProgramField);
    
    super.markProgramFieldBody(paramProgramClass, paramProgramField);
    
    currentUsageMark = localShortestUsageMark;
  }
  
  protected void markProgramMethodBody(ProgramClass paramProgramClass, ProgramMethod paramProgramMethod)
  {
    ShortestUsageMark localShortestUsageMark = currentUsageMark;
    
    currentUsageMark = new ShortestUsageMark(getShortestUsageMark(paramProgramMethod), "is invoked by    ", 1, paramProgramClass, paramProgramMethod);
    
    super.markProgramMethodBody(paramProgramClass, paramProgramMethod);
    
    currentUsageMark = localShortestUsageMark;
  }
  
  protected void markMethodHierarchy(Clazz paramClazz, Method paramMethod)
  {
    ShortestUsageMark localShortestUsageMark = currentUsageMark;
    
    currentUsageMark = new ShortestUsageMark(getShortestUsageMark(paramMethod), "implements       ", 100, paramClazz, paramMethod);
    
    super.markMethodHierarchy(paramClazz, paramMethod);
    
    currentUsageMark = localShortestUsageMark;
  }
  
  protected void markAsUsed(VisitorAccepter paramVisitorAccepter)
  {
    Object localObject = paramVisitorAccepter.getVisitorInfo();
    
    ShortestUsageMark localShortestUsageMark = (localObject != null) && ((localObject instanceof ShortestUsageMark)) && (!((ShortestUsageMark)localObject).isCertain()) && (!currentUsageMark.isShorter((ShortestUsageMark)localObject)) ? new ShortestUsageMark((ShortestUsageMark)localObject, true) : currentUsageMark;
    
    paramVisitorAccepter.setVisitorInfo(localShortestUsageMark);
  }
  
  protected boolean shouldBeMarkedAsUsed(VisitorAccepter paramVisitorAccepter)
  {
    Object localObject = paramVisitorAccepter.getVisitorInfo();
    
    return (localObject == null) || (!(localObject instanceof ShortestUsageMark)) || (!((ShortestUsageMark)localObject).isCertain()) || (currentUsageMark.isShorter((ShortestUsageMark)localObject));
  }
  
  protected boolean isUsed(VisitorAccepter paramVisitorAccepter)
  {
    Object localObject = paramVisitorAccepter.getVisitorInfo();
    
    return (localObject != null) && ((localObject instanceof ShortestUsageMark)) && (((ShortestUsageMark)localObject).isCertain());
  }
  
  protected void markAsPossiblyUsed(VisitorAccepter paramVisitorAccepter)
  {
    paramVisitorAccepter.setVisitorInfo(new ShortestUsageMark(currentUsageMark, false));
  }
  
  protected boolean shouldBeMarkedAsPossiblyUsed(VisitorAccepter paramVisitorAccepter)
  {
    Object localObject = paramVisitorAccepter.getVisitorInfo();
    
    return (localObject == null) || (!(localObject instanceof ShortestUsageMark)) || ((!((ShortestUsageMark)localObject).isCertain()) && (currentUsageMark.isShorter((ShortestUsageMark)localObject)));
  }
  
  protected boolean isPossiblyUsed(VisitorAccepter paramVisitorAccepter)
  {
    Object localObject = paramVisitorAccepter.getVisitorInfo();
    
    return (localObject != null) && ((localObject instanceof ShortestUsageMark)) && (!((ShortestUsageMark)localObject).isCertain());
  }
  
  protected ShortestUsageMark getShortestUsageMark(VisitorAccepter paramVisitorAccepter)
  {
    Object localObject = paramVisitorAccepter.getVisitorInfo();
    
    return (ShortestUsageMark)localObject;
  }
  
  private boolean isCausedBy(ShortestUsageMark paramShortestUsageMark, Clazz paramClazz)
  {
    return recursiveCauseChecker.check(paramShortestUsageMark, paramClazz);
  }
  
  private class MyRecursiveCauseChecker
    implements ClassVisitor, MemberVisitor
  {
    private Clazz checkClass;
    private boolean isRecursing;
    
    MyRecursiveCauseChecker(ShortestUsageMarker.1 param1)
    {
      this();
    }
    
    public boolean check(ShortestUsageMark paramShortestUsageMark, Clazz paramClazz)
    {
      checkClass = paramClazz;
      isRecursing = false;
      
      paramShortestUsageMark.acceptClassVisitor(this);
      paramShortestUsageMark.acceptMemberVisitor(this);
      
      return isRecursing;
    }
    
    public void visitProgramClass(ProgramClass paramProgramClass)
    {
      checkCause(paramProgramClass);
    }
    
    public void visitLibraryClass(LibraryClass paramLibraryClass)
    {
      checkCause(paramLibraryClass);
    }
    
    public void visitProgramField(ProgramClass paramProgramClass, ProgramField paramProgramField)
    {
      checkCause(paramProgramField);
    }
    
    public void visitProgramMethod(ProgramClass paramProgramClass, ProgramMethod paramProgramMethod)
    {
      checkCause(paramProgramMethod);
    }
    
    public void visitLibraryField(LibraryClass paramLibraryClass, LibraryField paramLibraryField)
    {
      checkCause(paramLibraryField);
    }
    
    public void visitLibraryMethod(LibraryClass paramLibraryClass, LibraryMethod paramLibraryMethod)
    {
      checkCause(paramLibraryMethod);
    }
    
    private void checkCause(VisitorAccepter paramVisitorAccepter)
    {
      if (isUsed(paramVisitorAccepter))
      {
        ShortestUsageMark localShortestUsageMark = getShortestUsageMark(paramVisitorAccepter);
        
        isRecursing = localShortestUsageMark.isCausedBy(checkClass);
        if (!isRecursing)
        {
          localShortestUsageMark.acceptClassVisitor(this);
          localShortestUsageMark.acceptMemberVisitor(this);
        }
      }
    }
    
    private MyRecursiveCauseChecker() {}
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.ShortestUsageMarker
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.Clazz;
import proguard.classfile.LibraryClass;
import proguard.classfile.LibraryMethod;
import proguard.classfile.Method;
import proguard.classfile.ProgramClass;
import proguard.classfile.ProgramMethod;
import proguard.classfile.attribute.Attribute;
import proguard.classfile.attribute.annotation.Annotation;
import proguard.classfile.attribute.annotation.AnnotationDefaultAttribute;
import proguard.classfile.attribute.annotation.AnnotationElementValue;
import proguard.classfile.attribute.annotation.AnnotationsAttribute;
import proguard.classfile.attribute.annotation.ArrayElementValue;
import proguard.classfile.attribute.annotation.ClassElementValue;
import proguard.classfile.attribute.annotation.ConstantElementValue;
import proguard.classfile.attribute.annotation.ElementValue;
import proguard.classfile.attribute.annotation.EnumConstantElementValue;
import proguard.classfile.attribute.annotation.ParameterAnnotationsAttribute;
import proguard.classfile.attribute.annotation.visitor.AnnotationVisitor;
import proguard.classfile.attribute.annotation.visitor.ElementValueVisitor;
import proguard.classfile.attribute.visitor.AttributeVisitor;
import proguard.classfile.constant.ClassConstant;
import proguard.classfile.constant.Constant;
import proguard.classfile.constant.visitor.ConstantVisitor;
import proguard.classfile.util.SimplifiedVisitor;
import proguard.classfile.visitor.ClassVisitor;
import proguard.classfile.visitor.MemberVisitor;

public class AnnotationUsageMarker
  extends SimplifiedVisitor
  implements AttributeVisitor, AnnotationVisitor, ElementValueVisitor, ConstantVisitor, ClassVisitor, MemberVisitor
{
  private final UsageMarker usageMarker;
  private boolean attributeUsed;
  private boolean annotationUsed;
  private boolean classUsed;
  private boolean methodUsed;
  
  public AnnotationUsageMarker(UsageMarker paramUsageMarker)
  {
    usageMarker = paramUsageMarker;
  }
  
  public void visitAnyAttribute(Clazz paramClazz, Attribute paramAttribute) {}
  
  public void visitAnyAnnotationsAttribute(Clazz paramClazz, AnnotationsAttribute paramAnnotationsAttribute)
  {
    attributeUsed = false;
    paramAnnotationsAttribute.annotationsAccept(paramClazz, this);
    if (attributeUsed)
    {
      usageMarker.markAsUsed(paramAnnotationsAttribute);
      
      markConstant(paramClazz, u2attributeNameIndex);
    }
  }
  
  public void visitAnyParameterAnnotationsAttribute(Clazz paramClazz, Method paramMethod, ParameterAnnotationsAttribute paramParameterAnnotationsAttribute)
  {
    attributeUsed = false;
    paramParameterAnnotationsAttribute.annotationsAccept(paramClazz, paramMethod, this);
    if (attributeUsed)
    {
      usageMarker.markAsUsed(paramParameterAnnotationsAttribute);
      
      markConstant(paramClazz, u2attributeNameIndex);
    }
  }
  
  public void visitAnnotationDefaultAttribute(Clazz paramClazz, Method paramMethod, AnnotationDefaultAttribute paramAnnotationDefaultAttribute)
  {
    paramAnnotationDefaultAttribute.defaultValueAccept(paramClazz, this);
    
    usageMarker.markAsUsed(paramAnnotationDefaultAttribute);
    
    markConstant(paramClazz, u2attributeNameIndex);
  }
  
  public void visitAnnotation(Clazz paramClazz, Annotation paramAnnotation)
  {
    if (isReferencedClassUsed(paramAnnotation))
    {
      usageMarker.markAsUsed(paramAnnotation);
      
      markConstant(paramClazz, u2typeIndex);
      
      paramAnnotation.elementValuesAccept(paramClazz, this);
      
      annotationUsed = true;
      attributeUsed = true;
    }
  }
  
  public void visitConstantElementValue(Clazz paramClazz, Annotation paramAnnotation, ConstantElementValue paramConstantElementValue)
  {
    if (isReferencedMethodUsed(paramConstantElementValue))
    {
      usageMarker.markAsUsed(paramConstantElementValue);
      
      markConstant(paramClazz, u2elementNameIndex);
      markConstant(paramClazz, u2constantValueIndex);
    }
  }
  
  public void visitEnumConstantElementValue(Clazz paramClazz, Annotation paramAnnotation, EnumConstantElementValue paramEnumConstantElementValue)
  {
    if (isReferencedMethodUsed(paramEnumConstantElementValue))
    {
      classUsed = true;
      paramEnumConstantElementValue.referencedClassesAccept(this);
      if (classUsed)
      {
        usageMarker.markAsUsed(paramEnumConstantElementValue);
        
        markConstant(paramClazz, u2elementNameIndex);
        markConstant(paramClazz, u2typeNameIndex);
        markConstant(paramClazz, u2constantNameIndex);
      }
    }
  }
  
  public void visitClassElementValue(Clazz paramClazz, Annotation paramAnnotation, ClassElementValue paramClassElementValue)
  {
    if (isReferencedMethodUsed(paramClassElementValue))
    {
      classUsed = true;
      paramClassElementValue.referencedClassesAccept(this);
      if (classUsed)
      {
        usageMarker.markAsUsed(paramClassElementValue);
        
        markConstant(paramClazz, u2elementNameIndex);
        markConstant(paramClazz, u2classInfoIndex);
      }
    }
  }
  
  public void visitAnnotationElementValue(Clazz paramClazz, Annotation paramAnnotation, AnnotationElementValue paramAnnotationElementValue)
  {
    if (isReferencedMethodUsed(paramAnnotationElementValue))
    {
      boolean bool = annotationUsed;
      
      annotationUsed = false;
      paramAnnotationElementValue.annotationAccept(paramClazz, this);
      if (annotationUsed)
      {
        usageMarker.markAsUsed(paramAnnotationElementValue);
        
        markConstant(paramClazz, u2elementNameIndex);
      }
      annotationUsed = bool;
    }
  }
  
  public void visitArrayElementValue(Clazz paramClazz, Annotation paramAnnotation, ArrayElementValue paramArrayElementValue)
  {
    if (isReferencedMethodUsed(paramArrayElementValue))
    {
      paramArrayElementValue.elementValuesAccept(paramClazz, paramAnnotation, this);
      
      usageMarker.markAsUsed(paramArrayElementValue);
      
      markConstant(paramClazz, u2elementNameIndex);
    }
  }
  
  public void visitAnyConstant(Clazz paramClazz, Constant paramConstant)
  {
    usageMarker.markAsUsed(paramConstant);
  }
  
  public void visitClassConstant(Clazz paramClazz, ClassConstant paramClassConstant)
  {
    classUsed = usageMarker.isUsed(paramClassConstant);
    if (!classUsed)
    {
      classUsed = true;
      paramClassConstant.referencedClassAccept(this);
      if (classUsed)
      {
        usageMarker.markAsUsed(paramClassConstant);
        
        markConstant(paramClazz, u2nameIndex);
      }
    }
  }
  
  public void visitProgramClass(ProgramClass paramProgramClass)
  {
    classUsed = usageMarker.isUsed(paramProgramClass);
  }
  
  public void visitLibraryClass(LibraryClass paramLibraryClass)
  {
    classUsed = true;
  }
  
  public void visitProgramMethod(ProgramClass paramProgramClass, ProgramMethod paramProgramMethod)
  {
    methodUsed = usageMarker.isUsed(paramProgramMethod);
  }
  
  public void visitLibraryMethod(LibraryClass paramLibraryClass, LibraryMethod paramLibraryMethod)
  {
    classUsed = true;
  }
  
  private boolean isReferencedClassUsed(Annotation paramAnnotation)
  {
    classUsed = true;
    paramAnnotation.referencedClassAccept(this);
    
    return classUsed;
  }
  
  private boolean isReferencedMethodUsed(ElementValue paramElementValue)
  {
    methodUsed = true;
    paramElementValue.referencedMethodAccept(this);
    
    return methodUsed;
  }
  
  private void markConstant(Clazz paramClazz, int paramInt)
  {
    if (paramInt > 0) {
      paramClazz.constantPoolEntryAccept(paramInt, this);
    }
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.AnnotationUsageMarker
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.LibraryClass;
import proguard.classfile.LibraryField;
import proguard.classfile.LibraryMethod;
import proguard.classfile.ProgramClass;
import proguard.classfile.ProgramField;
import proguard.classfile.ProgramMethod;
import proguard.classfile.visitor.MemberVisitor;

public class UsedMemberFilter
  implements MemberVisitor
{
  private final UsageMarker usageMarker;
  private final MemberVisitor memberVisitor;
  
  public UsedMemberFilter(UsageMarker paramUsageMarker, MemberVisitor paramMemberVisitor)
  {
    usageMarker = paramUsageMarker;
    memberVisitor = paramMemberVisitor;
  }
  
  public void visitProgramField(ProgramClass paramProgramClass, ProgramField paramProgramField)
  {
    if (usageMarker.isUsed(paramProgramField)) {
      memberVisitor.visitProgramField(paramProgramClass, paramProgramField);
    }
  }
  
  public void visitProgramMethod(ProgramClass paramProgramClass, ProgramMethod paramProgramMethod)
  {
    if (usageMarker.isUsed(paramProgramMethod)) {
      memberVisitor.visitProgramMethod(paramProgramClass, paramProgramMethod);
    }
  }
  
  public void visitLibraryField(LibraryClass paramLibraryClass, LibraryField paramLibraryField)
  {
    if (usageMarker.isUsed(paramLibraryField)) {
      memberVisitor.visitLibraryField(paramLibraryClass, paramLibraryField);
    }
  }
  
  public void visitLibraryMethod(LibraryClass paramLibraryClass, LibraryMethod paramLibraryMethod)
  {
    if (usageMarker.isUsed(paramLibraryMethod)) {
      memberVisitor.visitLibraryMethod(paramLibraryClass, paramLibraryMethod);
    }
  }
}

/* Location:
 * Qualified Name:     proguard.shrink.UsedMemberFilter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

class UsageMarker$1 {}

/* Location:
 * Qualified Name:     proguard.shrink.UsageMarker.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package proguard.shrink;

import proguard.classfile.ProgramClass;
import proguard.classfile.ProgramField;
import proguard.classfile.ProgramMethod;
import proguard.classfile.util.SimplifiedVisitor;
import proguard.classfile.visitor.MemberVisitor;

class UsageMarker$MyPossiblyUsedMemberUsageMarker
  extends SimplifiedVisitor
  implements MemberVisitor
{
  private final UsageMarker this$0;
  
  private UsageMarker$MyPossiblyUsedMemberUsageMarker(UsageMarker paramUsageMarker)
  {
    this$0 = paramUsageMarker;
  }
  
  UsageMarker$MyPossiblyUsedMemberUsageMarker(UsageMarker paramUsageMarker, UsageMarker.1 param1)
  {
    this(paramUsageMarker);
  }
  
  public void visitProgramField(ProgramClass paramProgramClass, ProgramField paramProgramField)
  {
    if (this$0.isPossiblyUsed(paramProgramField))
    {
      this$0.markAsUsed(paramProgramField);
      
      UsageMarker.access$300(this$0, paramProgramClass, u2nameIndex);
      UsageMarker.access$300(this$0, paramProgramClass, u2descriptorIndex);
      
      paramProg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd