From 9bea871427c39b9f8df006d4eb21e5a5fdd0b4a9 Mon Sep 17 00:00:00 2001 From: ghm Date: Thu, 14 Sep 2023 14:39:08 -0700 Subject: [PATCH] Restrict the inheritance of Fix. I believe we meant to do this after removing MinimalFix, then forgot. PiperOrigin-RevId: 565481056 --- .../src/main/java/com/google/errorprone/fixes/Fix.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check_api/src/main/java/com/google/errorprone/fixes/Fix.java b/check_api/src/main/java/com/google/errorprone/fixes/Fix.java index 261434e986e..ac71b1065ec 100644 --- a/check_api/src/main/java/com/google/errorprone/fixes/Fix.java +++ b/check_api/src/main/java/com/google/errorprone/fixes/Fix.java @@ -16,6 +16,7 @@ package com.google.errorprone.fixes; +import com.google.errorprone.annotations.RestrictedInheritance; import com.sun.tools.javac.tree.EndPosTable; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; import java.util.Collection; @@ -26,6 +27,11 @@ * * @author eaftan@google.com (Eddie Aftandilian) */ +@RestrictedInheritance( + explanation = "This should only be subclassed within ErrorProne.", + allowedOnPath = + ".*/third_party/java_src/error_prone/project/check_api/src/main/java/com/google/errorprone/fixes/.*" + + "|.*third_party/java_src/error_prone/project/check_api/src/main/java/com/google/errorprone/_javac/check_api/libcheck_api-class_sources/com/google/errorprone/fixes/.*") public interface Fix { String toString(JCCompilationUnit compilationUnit);