# HG changeset patch # User Doug Simon # Date 1358024707 -3600 # Node ID f965b7a96f16059e453cd9f2f773600e27d83adb # Parent c07a49b27b89f2aaf07ff258b7aee3b8ccc5d017 added support for supplying an explicit signature in @MethodAnnotation to private types in the signature of the substituted method diff -r c07a49b27b89 -r f965b7a96f16 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java Sat Jan 12 21:53:22 2013 +0100 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java Sat Jan 12 22:05:07 2013 +0100 @@ -24,8 +24,11 @@ import java.lang.annotation.*; +import com.oracle.graal.api.meta.*; + /** * Denotes a class that substitutes methods of another specified class with snippets. + * The substitute methods are exactly those annotated by {@link MethodSubstitution}. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @@ -51,21 +54,30 @@ String className() default ""; /** - * Used to map a substitute method to an original method where the default mapping - * of name and signature is not possible due to name clashes with final methods in - * {@link Object} or signature types that are not public. + * Denotes a substitute method. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface MethodSubstitution { /** - * Get the name of the original method. + * Gets the name of the substituted method. + *

+ * If the default value is specified for this element, then the + * name of the substituted method is same as the substitute method. */ String value() default ""; /** - * Determine if the substituted method is static. + * Determines if the substituted method is static. */ boolean isStatic() default true; + + /** + * Gets the {@linkplain Signature#getString() signature} of the substituted method. + *

+ * If the default value is specified for this element, then the + * signature of the substituted method is the same as the substitute method. + */ + String signature() default ""; } }