public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Has the method already been referenced? if (isPossiblyUsed(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). } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { if (shouldBeMarkedAsUsed(programMethod)) { // Is the method's class used? if (isUsed(programClass)) { markAsUsed(programMethod); // Mark the method body. markProgramMethodBody(programClass, programMethod); // Mark the method hierarchy. markMethodHierarchy(programClass, programMethod); } // Hasn't the method been marked as possibly being used yet? else if (shouldBeMarkedAsPossiblyUsed(programMethod)) { // We can't process the method yet, because the class isn't // marked as being used (yet). Give it a preliminary mark. markAsPossiblyUsed(programMethod); // Mark the method hierarchy. markMethodHierarchy(programClass, programMethod); } } }
public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute) { markAsUsed(lineNumberTableAttribute); markConstant(clazz, lineNumberTableAttribute.u2attributeNameIndex); }
public void visitProgramClass(ProgramClass programClass) { if (shouldBeMarkedAsUsed(programClass)) { // Mark this class. markAsUsed(programClass); markProgramClassBody(programClass); } }
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod) { if (shouldBeMarkedAsUsed(libraryMethod)) { markAsUsed(libraryMethod); // Mark the method hierarchy. markMethodHierarchy(libraryClass, libraryMethod); } }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { if (shouldBeMarkedAsUsed(programField)) { // Is the field's class used? if (isUsed(programClass)) { markAsUsed(programField); // Mark the field body. markProgramFieldBody(programClass, programField); } // Hasn't the field been marked as possibly being used yet? else if (shouldBeMarkedAsPossiblyUsed(programField)) { // We can't process the field yet, because the class isn't // marked as being used (yet). Give it a preliminary mark. markAsPossiblyUsed(programField); } } }
public void visitProgramClass(ProgramClass programClass) boolean classUsed = usageMarker.isUsed(programClass); boolean classPossiblyUsed = usageMarker.isPossiblyUsed(programClass); usageMarker.markAsUsed(programClass); usageMarker.markAsUnused(programClass);
public void visitModuleConstant(Clazz clazz, ModuleConstant moduleConstant) { if (shouldBeMarkedAsUsed(moduleConstant)) { markAsUsed(moduleConstant); markConstant(clazz, moduleConstant.u2nameIndex); } }
public void visitProgramClass(ProgramClass programClass) { // Don't keep the local variable info if one of its classes is not used. if (!usageMarker.isUsed(programClass)) { variableInfoUsed = false; } }
public void visitUtf8Constant(Clazz clazz, Utf8Constant utf8Constant) { if (!usageMarker.isUsed(utf8Constant)) { usageMarker.markAsUsed(utf8Constant); } } }
public void visitProgramClass(ProgramClass programClass) { if (shouldBeMarkedAsPossiblyUsed(programClass)) { // We can't process the interface yet, because it might not // be required. Give it a preliminary mark. markAsPossiblyUsed(programClass); } }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { // Has the method already been referenced? if (isPossiblyUsed(programField)) { markAsUsed(programField); // Mark the name and descriptor. markConstant(programClass, programField.u2nameIndex); markConstant(programClass, programField.u2descriptorIndex); // Mark the attributes. programField.attributesAccept(programClass, UsageMarker.this); // Mark the classes referenced in the descriptor string. programField.referencedClassesAccept(UsageMarker.this); } }
protected void markProgramFieldBody(ProgramClass programClass, ProgramField programField) { ShortestUsageMark previousUsageMark = currentUsageMark; currentUsageMark = new ShortestUsageMark(getShortestUsageMark(programField), "is referenced by ", 1, programClass, programField); super.markProgramFieldBody(programClass, programField); currentUsageMark = previousUsageMark; }
protected void markMethodHierarchy(Clazz clazz, Method method) { ShortestUsageMark previousUsageMark = currentUsageMark; currentUsageMark = new ShortestUsageMark(getShortestUsageMark(method), "implements ", 100, clazz, method); super.markMethodHierarchy(clazz, method); currentUsageMark = previousUsageMark; }
protected void markProgramClassBody(ProgramClass programClass) { ShortestUsageMark previousUsageMark = currentUsageMark; currentUsageMark = new ShortestUsageMark(getShortestUsageMark(programClass), "is extended by ", 10000, programClass); super.markProgramClassBody(programClass); currentUsageMark = previousUsageMark; }
new UsageMarker() : new ShortestUsageMarker();
public void visitConstantElementValue(Clazz clazz, Annotation annotation, ConstantElementValue constantElementValue) { if (isReferencedMethodUsed(constantElementValue)) { // Mark the element value as being used. usageMarker.markAsUsed(constantElementValue); markConstant(clazz, constantElementValue.u2elementNameIndex); markConstant(clazz, constantElementValue.u2constantValueIndex); // The return value. elementValueUsed = true; } }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { if (shouldBeMarkedAsUsed(programField)) { // Is the field's class used? if (isUsed(programClass)) { markAsUsed(programField); // Mark the field body. markProgramFieldBody(programClass, programField); } // Hasn't the field been marked as possibly being used yet? else if (shouldBeMarkedAsPossiblyUsed(programField)) { // We can't process the field yet, because the class isn't // marked as being used (yet). Give it a preliminary mark. markAsPossiblyUsed(programField); } } }
public void visitProgramClass(ProgramClass programClass) boolean classUsed = usageMarker.isUsed(programClass); boolean classPossiblyUsed = usageMarker.isPossiblyUsed(programClass); usageMarker.markAsUsed(programClass); usageMarker.markAsUnused(programClass);
public void visitProgramClass(ProgramClass programClass) { if (shouldBeMarkedAsUsed(programClass)) { // Mark this class. markAsUsed(programClass); markProgramClassBody(programClass); } }