private static String prependParameterToMethodDescriptor(String methodDescriptor, String type) { StringBuilder methodDescBuilder = new StringBuilder(); methodDescBuilder.append('('); methodDescBuilder.append(type); InternalTypeEnumeration typeEnumeration = new InternalTypeEnumeration(methodDescriptor); while (typeEnumeration.hasMoreTypes()) { methodDescBuilder.append(typeEnumeration.nextType()); } methodDescBuilder.append(')'); methodDescBuilder.append(typeEnumeration.returnType()); return methodDescBuilder.toString(); }
private static String prependParameterToMethodDescriptor(String methodDescriptor, String type) { StringBuilder methodDescBuilder = new StringBuilder(); methodDescBuilder.append('('); methodDescBuilder.append(type); InternalTypeEnumeration typeEnumeration = new InternalTypeEnumeration(methodDescriptor); while (typeEnumeration.hasMoreTypes()) { methodDescBuilder.append(typeEnumeration.nextType()); } methodDescBuilder.append(')'); methodDescBuilder.append(typeEnumeration.returnType()); return methodDescBuilder.toString(); }
private static String prependParameterToMethodDescriptor(String methodDescriptor, String type) { StringBuilder methodDescBuilder = new StringBuilder(); methodDescBuilder.append('('); methodDescBuilder.append(type); InternalTypeEnumeration typeEnumeration = new InternalTypeEnumeration(methodDescriptor); while (typeEnumeration.hasMoreTypes()) { methodDescBuilder.append(typeEnumeration.nextType()); } methodDescBuilder.append(')'); methodDescBuilder.append(typeEnumeration.returnType()); return methodDescBuilder.toString(); }
/** * Returns the number of parameters of the given internal method descriptor. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(ID)Z</code>". * @return the number of parameters, * e.g. 2. */ public static int internalMethodParameterCount(String internalMethodDescriptor) { InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); int counter = 0; while (internalTypeEnumeration.hasMoreTypes()) { internalTypeEnumeration.nextType(); counter++; } return counter; }
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(JavaConstants.METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(JavaConstants.METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(ClassConstants.EXTERNAL_METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
System.out.println(" Type ["+enumeration.nextType()+"]");
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(JavaConstants.METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
String type = internalTypeEnumeration.nextType(); if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
String type = internalTypeEnumeration.nextType(); if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
System.out.println(" Type ["+enumeration.nextType()+"]");
/** * Returns the size taken up on the stack by the parameters of the given * internal method descriptor. This accounts for long and double parameters * taking up two spaces, and a non-static method taking up an additional * entry. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(ID)Z</code>". * @param isStatic specifies whether the method is static, * e.g. false. * @return the size taken up on the stack, * e.g. 4. */ public static int internalMethodParameterSize(String internalMethodDescriptor, boolean isStatic) { InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); int size = isStatic ? 0 : 1; while (internalTypeEnumeration.hasMoreTypes()) { String internalType = internalTypeEnumeration.nextType(); size += internalTypeSize(internalType); } return size; }
/** * Checks the classes mentioned in the given class member descriptor, * printing notes if necessary. */ private void checkDescriptor(String descriptor) { if (descriptor != null) { InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(descriptor); checkType(internalTypeEnumeration.returnType()); while (internalTypeEnumeration.hasMoreTypes()) { checkType(internalTypeEnumeration.nextType()); } } }
/** * Checks the classes mentioned in the given class member descriptor, * printing notes if necessary. */ private void checkDescriptor(String descriptor) { if (descriptor != null) { InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(descriptor); checkType(internalTypeEnumeration.returnType()); while (internalTypeEnumeration.hasMoreTypes()) { checkType(internalTypeEnumeration.nextType()); } } }
/** * Checks the classes mentioned in the given class member descriptor, * printing notes if necessary. */ private void checkDescriptor(String descriptor) { if (descriptor != null) { InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(descriptor); checkType(internalTypeEnumeration.returnType()); while (internalTypeEnumeration.hasMoreTypes()) { checkType(internalTypeEnumeration.nextType()); } } }
/** * Checks the classes mentioned in the given class member descriptor, * printing notes if necessary. */ private void checkDescriptor(String descriptor) { if (descriptor != null) { InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(descriptor); checkType(internalTypeEnumeration.returnType()); while (internalTypeEnumeration.hasMoreTypes()) { checkType(internalTypeEnumeration.nextType()); } } }
String type = internalTypeEnumeration.nextType(); if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
String type = internalTypeEnumeration.nextType(); if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
String type = internalTypeEnumeration.nextType(); if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))