Annotation Interface Metadata


@Retention(RUNTIME) @Target(TYPE) public @interface Metadata
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<? extends io.codemodder.CodeChanger>
    The codemod being tested.
    The GAV coordinates of any dependencies that should be added to the project after the codemod's execution.
    The classpath-based test directory containing the test case artifacts.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to re-run the transformed code through a second transformation with the same inputs, but with the transformed code, to see if another transformation is erroneously made.
    Class<? extends io.codemodder.ProjectProvider>[]
    Some codemods change their behavior based on the context of the app -- like which versions of libraries are present.
    Test files should always be renamed to this before execution.
  • Element Details

    • codemodType

      Class<? extends io.codemodder.CodeChanger> codemodType
      The codemod being tested.
    • testResourceDir

      String testResourceDir
      The classpath-based test directory containing the test case artifacts.
    • dependencies

      String[] dependencies
      The GAV coordinates of any dependencies that should be added to the project after the codemod's execution.
    • renameTestFile

      String renameTestFile
      Test files should always be renamed to this before execution. Helps test codemods that only target certain file names. Also supports directories in the path.
      Default:
      ""
    • doRetransformTest

      boolean doRetransformTest
      Whether to re-run the transformed code through a second transformation with the same inputs, but with the transformed code, to see if another transformation is erroneously made.
      Default:
      true
    • projectProviders

      Class<? extends io.codemodder.ProjectProvider>[] projectProviders
      Some codemods change their behavior based on the context of the app -- like which versions of libraries are present. If you want to simulate specific contextual conditions related to dependencies, you can add a customized provider here A usage example can be found at HardenXStreamCodemodTestProjectProvider
      Default:
      {}