tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r1076811 - in /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5: internal/services/InternalClassTransformationImpl.java services/ClassTransformation.java
Date Thu, 03 Mar 2011 21:42:42 GMT
Author: hlship
Date: Thu Mar  3 21:42:41 2011
New Revision: 1076811

URL: http://svn.apache.org/viewvc?rev=1076811&view=rev
Log:
TAP5-1467: Remove deprecated methods from ClassTransformation

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalClassTransformationImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ClassTransformation.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalClassTransformationImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalClassTransformationImpl.java?rev=1076811&r1=1076810&r2=1076811&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalClassTransformationImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalClassTransformationImpl.java
Thu Mar  3 21:42:41 2011
@@ -1249,11 +1249,6 @@ public final class InternalClassTransfor
         return false;
     }
 
-    public void addMethod(TransformMethodSignature signature, String methodBody)
-    {
-        removed("addMethod(TransformMethodSignature,String)");
-    }
-
     public TransformMethod addNewMethod(TransformMethodSignature signature, String methodBody)
     {
         return addOrReplaceMethod(signature, methodBody, true);
@@ -1342,11 +1337,6 @@ public final class InternalClassTransfor
         return result;
     }
 
-    public void addTransformedMethod(TransformMethodSignature signature, String methodBody)
-    {
-        removed("addTransformedMethod(TransformMethodSignature,String)");
-    }
-
     private CtClass[] buildCtClassList(String[] typeNames)
     {
         CtClass[] result = new CtClass[typeNames.length];
@@ -1369,16 +1359,6 @@ public final class InternalClassTransfor
         }
     }
 
-    public void extendMethod(TransformMethodSignature methodSignature, String methodBody)
-    {
-        removed("extendMethod(TransformMethodSignature, String)");
-    }
-
-    public void extendExistingMethod(TransformMethodSignature methodSignature, String methodBody)
-    {
-        removed("extendExistingMethod(TransformMethodSignature, String)");
-    }
-
     public void copyMethod(TransformMethodSignature sourceMethod, int modifiers, String newMethodName)
     {
         failIfFrozen();
@@ -1421,16 +1401,6 @@ public final class InternalClassTransfor
         formatter.format("\n%s renamed to %s\n\n", sourceMethod, newMethodName);
     }
 
-    public void addCatch(TransformMethodSignature methodSignature, String exceptionType,
String body)
-    {
-        removed("addCatch(TransformMethodSignature, String, String)");
-    }
-
-    public void prefixMethod(TransformMethodSignature methodSignature, String methodBody)
-    {
-        removed("prefixMethod(TransformMethodSignature, String)");
-    }
-
     private void addMethodToDescription(String operation, TransformMethodSignature methodSignature,
String methodBody)
     {
         formatter.format("%s method: %s %s %s(", operation, Modifier.toString(methodSignature.getModifiers()),
@@ -2104,11 +2074,6 @@ public final class InternalClassTransfor
         return builder.toString();
     }
 
-    public void removeField(String fieldName)
-    {
-        removed("removeField(String)");
-    }
-
     public void replaceReadAccess(String fieldName, String methodName)
     {
         getTransformFieldImpl(fieldName).replaceReadAccess(methodName);
@@ -2239,11 +2204,6 @@ public final class InternalClassTransfor
         return logger;
     }
 
-    public void extendConstructor(String statement)
-    {
-        removed("extendConstructor(String)");
-    }
-
     void addToConstructor(String statement)
     {
         constructor.append(statement);
@@ -2317,13 +2277,6 @@ public final class InternalClassTransfor
         return methods.containsKey(signature);
     }
 
-    private void removed(String methodName)
-    {
-        throw new RuntimeException(String.format(
-                "Method ClassTransformation.%s has been deprecated and is no longer functional.
"
-                        + "Please consult the JavaDoc for a suitable replacement.", methodName));
-    }
-
     private static ComponentMethodAdvice toBeforeAdvice(final ComponentInstanceOperation
operation)
     {
         return new ComponentMethodAdvice()

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ClassTransformation.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ClassTransformation.java?rev=1076811&r1=1076810&r2=1076811&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ClassTransformation.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ClassTransformation.java
Thu Mar  3 21:42:41 2011
@@ -237,68 +237,6 @@ public interface ClassTransformation ext
     void addImplementedInterface(Class interfaceClass);
 
     /**
-     * Extends an existing method. The provided method body is inserted at the end of the
existing
-     * method (i.e. {@link javassist.CtBehavior#insertAfter(java.lang.String)}). To access
or change
-     * the return value, use the <code>$_</code> pseudo variable.
-     * <p/>
-     * The method may be declared in the class, or may be inherited from a super-class. For
inherited methods, a method
-     * body is added that first invokes the super implementation. Use
-     * {@link #addMethod(TransformMethodSignature, String)} when it is necessary to control
when the super-class method
-     * is invoked.
-     * <p/>
-     * The extended method is considered <em>new</em>. New methods <em>are
not</em> scanned for
-     * {@linkplain #removeField(String)} removed}, {@linkplain #replaceReadAccess(String,
String)} read replaced}, or
-     * {@linkplain #replaceWriteAccess(String, String) write replaced} fields. Generally
that's what you want!
-     * 
-     * @param methodSignature
-     *            the signature of the method to extend
-     * @param methodBody
-     *            the body of code
-     * @throws org.apache.tapestry5.internal.services.MethodCompileException
-     *             if the provided Javassist method body can not be compiled
-     * @deprecated Use {@link TransformMethod#addAdvice(ComponentMethodAdvice)} instead.
This method is non-functional
-     *             as of Tapestry 5.2.
-     */
-    void extendMethod(TransformMethodSignature methodSignature, String methodBody);
-
-    /**
-     * Like {@link #extendMethod(TransformMethodSignature, String)}, but the extension does
not mark
-     * the method as new,
-     * and field changes <em>will</em> be processed. Note: at some point, this
is not longer true; extend and
-     * extendMethod work identically.
-     * 
-     * @param methodSignature
-     *            signature of the method to extend
-     * @param methodBody
-     *            the body of code
-     * @throws org.apache.tapestry5.internal.services.MethodCompileException
-     *             if the provided method body can not be compiled
-     * @see #prefixMethod(TransformMethodSignature, String)
-     * @deprecated Use {@link TransformMethod#addAdvice(ComponentMethodAdvice) instead}.
This method is non-functional
-     *             as of Tapestry 5.2.
-     */
-    void extendExistingMethod(TransformMethodSignature methodSignature, String methodBody);
-
-    /**
-     * Inserts code at the beginning of a method body (i.e. {@link CtBehavior#insertBefore(String)}.
-     * <p/>
-     * The method may be declared in the class, or may be inherited from a super-class. For
inherited methods, a method
-     * is added that first invokes the super implementation. Use {@link #addMethod(TransformMethodSignature,
String)}
-     * when it is necessary to control when the super-class method is invoked.
-     * <p/>
-     * Like {@link #extendExistingMethod(TransformMethodSignature, String)}, this method
is generally used to "wrap" an
-     * existing method adding additional functionality such as caching or transaction support.
-     * 
-     * @param methodSignature
-     * @param methodBody
-     * @throws org.apache.tapestry5.internal.services.MethodCompileException
-     *             if the provided method body can not be compiled
-     * @deprecated Use {@link TransformMethod#addAdvice(ComponentMethodAdvice)} instead.
This method is non-functional
-     *             as of Tapestry 5.2.
-     */
-    void prefixMethod(TransformMethodSignature methodSignature, String methodBody);
-
-    /**
      * Returns the name of a field that provides the {@link org.apache.tapestry5.ComponentResources}
for the transformed
      * component. This will be a protected field, accessible to the class and subclasses.
      * 
@@ -309,39 +247,6 @@ public interface ClassTransformation ext
     String getResourcesFieldName();
 
     /**
-     * Adds a new method to the transformed class. Replaces any existing method declared
for the
-     * class. When overriding
-     * a super-class method, you should use {@link #extendMethod(TransformMethodSignature,
String)},
-     * or you should
-     * remember to invoke the super class implemetation explicitly. Use this method to control
when
-     * the super-class
-     * implementation is invoked.
-     * 
-     * @deprecated Use {@link #getOrCreateMethod(TransformMethodSignature)} instead. This
method is non-functional as of
-     *             Tapestry 5.2.
-     */
-    void addMethod(TransformMethodSignature signature, String methodBody);
-
-    /**
-     * As with {@link #addMethod(TransformMethodSignature, String)}, but field references
inside the
-     * method <em>will</em> be transformed, and the method <em>must not
already exist</em>.
-     * 
-     * @deprecated Use {@link #getOrCreateMethod(TransformMethodSignature)} instead. This
method is non-functional as of
-     *             Tapestry 5.2.
-     */
-    void addTransformedMethod(TransformMethodSignature methodSignature, String methodBody);
-
-    /**
-     * Adds a statement to the constructor. The statement is added as is, though a newline
is added.
-     * 
-     * @param statement
-     *            the statement to add, which should end with a semicolon
-     * @deprecated Use methods that create or inject fields (directly or indirectly)
-     * @see ComponentValueProvider
-     */
-    void extendConstructor(String statement);
-
-    /**
      * Replaces all read-references to the specified field with invocations of the specified
method
      * name. Replacements
      * do not occur in methods added via {@link #addMethod(TransformMethodSignature, String)}
or
@@ -363,18 +268,6 @@ public interface ClassTransformation ext
     void replaceWriteAccess(String fieldName, String methodName);
 
     /**
-     * Removes a field entirely; this is useful for fields that are replaced entirely by
computed
-     * values.
-     * 
-     * @param fieldName
-     *            the name of the field to remove
-     * @see #replaceReadAccess(String, String)
-     * @see #replaceWriteAccess(String, String)
-     * @deprecated This method is non-functional as of Tapestry 5.2
-     */
-    void removeField(String fieldName);
-
-    /**
      * Converts a type name into a corresponding class (possibly, a transformed class). Primitive
      * type names are returned as wrapper types.
      */
@@ -415,22 +308,6 @@ public interface ClassTransformation ext
     boolean isRootTransformation();
 
     /**
-     * Adds a catch block to the method. The body should end with a return or a throw. The
special
-     * Javassist variable
-     * $e is the exception instance.
-     * 
-     * @param methodSignature
-     *            method to be extended.
-     * @param exceptionType
-     *            fully qualified class name of exception
-     * @param body
-     *            code to execute
-     * @deprecated Use {@link TransformMethod#addAdvice(ComponentMethodAdvice)} instead.
This method is non-functional
-     *             as of Tapestry 5.2.
-     */
-    void addCatch(TransformMethodSignature methodSignature, String exceptionType, String
body);
-
-    /**
      * Adds method advice for the indicated method.
      * 
      * @deprecated Use {@link TransformMethod#addAdvice(ComponentMethodAdvice)} instead



Mime
View raw message