Class SourceCode

java.lang.Object
tech.picnic.errorprone.bugpatterns.util.SourceCode

public final class SourceCode extends Object
A collection of Error Prone utility methods for dealing with the source code representation of AST nodes.
  • Method Details

    • treeToString

      public static String treeToString(Tree tree, com.google.errorprone.VisitorState state)
      Returns a string representation of the given Tree, preferring the original source code (if available) over its prettified representation.
      Parameters:
      tree - The AST node of interest.
      state - A VisitorState describing the context in which the given Tree is found.
      Returns:
      A non-null string.