changeset 7358:f965b7a96f16

added support for supplying an explicit signature in @MethodAnnotation to private types in the signature of the substituted method
author Doug Simon <doug.simon@oracle.com>
date Sat, 12 Jan 2013 22:05:07 +0100
parents c07a49b27b89
children 6a16788a29a6
files graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java
diffstat 1 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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.
+         * <p>
+         * 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.
+         * <p>
+         * 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 "";
     }
 }