Class MethodStaticnessCorrector


  • public class MethodStaticnessCorrector
    extends AbstractStaticnessCorrector
    Transformer that checks whether an instance method is used like a static method, and can easily be made static, i.e., does not reference any field or method in the "this" object. In this case, we make the method static, so that it complies with the invocations. Attention: This is not really a body transformer. It checks the current body, but modifies the invocation target.
    Author:
    Steven Arzt
    • Constructor Detail

      • MethodStaticnessCorrector

        public MethodStaticnessCorrector​(Singletons.Global g)
    • Method Detail

      • internalTransform

        protected void internalTransform​(Body b,
                                         String phaseName,
                                         Map<String,​String> options)
        Description copied from class: BodyTransformer
        This method is called to perform the transformation itself. It is declared abstract; subclasses must implement this method by making it the entry point to their actual Body transformation.
        Specified by:
        internalTransform in class BodyTransformer
        Parameters:
        b - the body on which to apply the transformation
        phaseName - the phasename for this transform; not typically used by implementations.
        options - the actual computed options; a combination of default options and Scene specified options.