Class DescriptionBasedDiff
java.lang.Object
com.google.errorprone.apply.DescriptionBasedDiff
- All Implemented Interfaces:
Diff, DescriptionListener
Implementation of a
Diff that performs the modifications that are passed to its onDescribed(Description) method, with no formatting.
If imports are changed, they are resorted as per Google Java style.
- Author:
- lowasser@google.com (Louis Wasserman)
-
Nested Class Summary
Nested classes/interfaces inherited from interface DescriptionListener
DescriptionListener.Factory -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDifferences(SourceFile sourceFile) Applies this difference to the suppliedsourceFile.static DescriptionBasedDiffcreate(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit, ImportOrganizer importOrganizer) static DescriptionBasedDiffcreateIgnoringOverlaps(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit, ImportOrganizer importOrganizer) Gets the name of the file this difference applies tovoidbooleanisEmpty()voidonDescribed(Description description) Reports a suggested modification to the code.
-
Method Details
-
create
public static DescriptionBasedDiff create(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit, ImportOrganizer importOrganizer) -
createIgnoringOverlaps
public static DescriptionBasedDiff createIgnoringOverlaps(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit, ImportOrganizer importOrganizer) -
getRelevantFileName
Description copied from interface:DiffGets the name of the file this difference applies to- Specified by:
getRelevantFileNamein interfaceDiff
-
isEmpty
public boolean isEmpty() -
onDescribed
Description copied from interface:DescriptionListenerReports a suggested modification to the code.- Specified by:
onDescribedin interfaceDescriptionListener
-
handleFix
-
applyDifferences
Description copied from interface:DiffApplies this difference to the suppliedsourceFile.- Specified by:
applyDifferencesin interfaceDiff
-