/** * Removes all VisitorAccepter objects that are not marked as being used * from the given array. * @return the new number of VisitorAccepter objects. */ private static int shrinkArray(VisitorAccepter[] array, int length) { int counter = 0; // Shift the used objects together. for (int index = 0; index < length; index++) { if (AttributeUsageMarker.isUsed(array[index])) { array[counter++] = array[index]; } } // Clear the remaining array elements. for (int index = counter; index < length; index++) { array[index] = null; } return counter; } }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { markAsUsed(attribute); }
/** * Removes all VisitorAccepter objects that are not marked as being used * from the given array. * @return the new number of VisitorAccepter objects. */ private static int shrinkArray(VisitorAccepter[] array, int length) { int counter = 0; // Shift the used objects together. for (int index = 0; index < length; index++) { if (AttributeUsageMarker.isUsed(array[index])) { array[counter++] = array[index]; } } // Clear the remaining array elements. Arrays.fill(array, counter, length, null); return counter; } }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { markAsUsed(attribute); }
/** * Removes all VisitorAccepter objects that are not marked as being used * from the given array. * @return the new number of VisitorAccepter objects. */ private static int shrinkArray(VisitorAccepter[] array, int length) { int counter = 0; // Shift the used objects together. for (int index = 0; index < length; index++) { if (AttributeUsageMarker.isUsed(array[index])) { array[counter++] = array[index]; } } // Clear the remaining array elements. Arrays.fill(array, counter, length, null); return counter; } }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { markAsUsed(attribute); }
/** * Removes all VisitorAccepter objects that are not marked as being used * from the given array. * @return the new number of VisitorAccepter objects. */ private static int shrinkArray(VisitorAccepter[] array, int length) { int counter = 0; // Shift the used objects together. for (int index = 0; index < length; index++) { if (AttributeUsageMarker.isUsed(array[index])) { array[counter++] = array[index]; } } // Clear the remaining array elements. Arrays.fill(array, counter, length, null); return counter; } }
public void visitAnyAttribute(Clazz clazz, Attribute attribute) { markAsUsed(attribute); }
public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute) { if (!AttributeUsageMarker.isUsed(localVariableTypeTableAttribute) && hasParameters(clazz, method)) { // Shift the entries that start at offset 0 to the front. int newIndex = 0; for (int index = 0; index < localVariableTypeTableAttribute.u2localVariableTypeTableLength; index++) { LocalVariableTypeInfo localVariableTypeInfo = localVariableTypeTableAttribute.localVariableTypeTable[index]; if (localVariableTypeInfo.u2startPC == 0) { localVariableTypeTableAttribute.localVariableTypeTable[newIndex++] = localVariableTypeInfo; } } // Trim the table. localVariableTypeTableAttribute.u2localVariableTypeTableLength = newIndex; // Mark the table if there are any entries. if (newIndex > 0) { attributeUsageMarker.visitLocalVariableTypeTableAttribute(clazz, method, codeAttribute, localVariableTypeTableAttribute); } } }
public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute) { if (!AttributeUsageMarker.isUsed(localVariableTableAttribute) && hasParameters(clazz, method)) { // Shift the entries that start at offset 0 to the front. int newIndex = 0; for (int index = 0; index < localVariableTableAttribute.u2localVariableTableLength; index++) { LocalVariableInfo localVariableInfo = localVariableTableAttribute.localVariableTable[index]; if (localVariableInfo.u2startPC == 0) { localVariableTableAttribute.localVariableTable[newIndex++] = localVariableInfo; } } // Trim the table. localVariableTableAttribute.u2localVariableTableLength = newIndex; // Mark the table if there are any entries. if (newIndex > 0) { attributeUsageMarker.visitLocalVariableTableAttribute(clazz, method, codeAttribute, localVariableTableAttribute); } } }
public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute) { if (!AttributeUsageMarker.isUsed(localVariableTypeTableAttribute) && hasParameters(clazz, method)) { // Shift the entries that start at offset 0 to the front. int newIndex = 0; for (int index = 0; index < localVariableTypeTableAttribute.u2localVariableTypeTableLength; index++) { LocalVariableTypeInfo localVariableTypeInfo = localVariableTypeTableAttribute.localVariableTypeTable[index]; if (localVariableTypeInfo.u2startPC == 0) { localVariableTypeTableAttribute.localVariableTypeTable[newIndex++] = localVariableTypeInfo; } } // Trim the table. localVariableTypeTableAttribute.u2localVariableTypeTableLength = newIndex; // Mark the table if there are any entries. if (newIndex > 0) { attributeUsageMarker.visitLocalVariableTypeTableAttribute(clazz, method, codeAttribute, localVariableTypeTableAttribute); } } }
public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute) { if (!AttributeUsageMarker.isUsed(localVariableTypeTableAttribute) && hasParameters(clazz, method)) { // Shift the entries that start at offset 0 to the front. int newIndex = 0; for (int index = 0; index < localVariableTypeTableAttribute.u2localVariableTypeTableLength; index++) { LocalVariableTypeInfo localVariableTypeInfo = localVariableTypeTableAttribute.localVariableTypeTable[index]; if (localVariableTypeInfo.u2startPC == 0) { localVariableTypeTableAttribute.localVariableTypeTable[newIndex++] = localVariableTypeInfo; } } // Trim the table. localVariableTypeTableAttribute.u2localVariableTypeTableLength = newIndex; // Mark the table if there are any entries. if (newIndex > 0) { attributeUsageMarker.visitLocalVariableTypeTableAttribute(clazz, method, codeAttribute, localVariableTypeTableAttribute); } } }
public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute) { if (!AttributeUsageMarker.isUsed(localVariableTableAttribute) && hasParameters(clazz, method)) { // Shift the entries that start at offset 0 to the front. int newIndex = 0; for (int index = 0; index < localVariableTableAttribute.u2localVariableTableLength; index++) { LocalVariableInfo localVariableInfo = localVariableTableAttribute.localVariableTable[index]; if (localVariableInfo.u2startPC == 0) { localVariableTableAttribute.localVariableTable[newIndex++] = localVariableInfo; } } // Trim the table. localVariableTableAttribute.u2localVariableTableLength = newIndex; // Mark the table if there are any entries. if (newIndex > 0) { attributeUsageMarker.visitLocalVariableTableAttribute(clazz, method, codeAttribute, localVariableTableAttribute); } } }
public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute) { if (!AttributeUsageMarker.isUsed(localVariableTableAttribute) && hasParameters(clazz, method)) { // Shift the entries that start at offset 0 to the front. int newIndex = 0; for (int index = 0; index < localVariableTableAttribute.u2localVariableTableLength; index++) { LocalVariableInfo localVariableInfo = localVariableTableAttribute.localVariableTable[index]; if (localVariableInfo.u2startPC == 0) { localVariableTableAttribute.localVariableTable[newIndex++] = localVariableInfo; } } // Trim the table. localVariableTableAttribute.u2localVariableTableLength = newIndex; // Mark the table if there are any entries. if (newIndex > 0) { attributeUsageMarker.visitLocalVariableTableAttribute(clazz, method, codeAttribute, localVariableTableAttribute); } } }