diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextImpl.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextImpl.java index 17e1abdc983d..b0e2ab81d146 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextImpl.java @@ -26,7 +26,6 @@ import com.intellij.openapi.util.UserDataHolderBase; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.Navigatable; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.UUID; @@ -41,8 +40,6 @@ public final class CompileContextImpl extends UserDataHolderBase implements Comp private final boolean myMake; private final boolean myIsRebuild; private final boolean myIsAnnotationProcessorsEnabled; - private boolean myRebuildRequested; - private String myRebuildReason; private final ProjectFileIndex myProjectFileIndex; // cached for performance reasons private final ProjectCompileScope myProjectCompileScope; private final long myStartCompilationStamp; @@ -137,24 +134,6 @@ public final class CompileContextImpl extends UserDataHolderBase implements Comp return myProjectCompileScope; } - @Override - public void requestRebuildNextTime(String message) { - if (!myRebuildRequested) { - myRebuildRequested = true; - myRebuildReason = message; - } - } - - @Override - public boolean isRebuildRequested() { - return myRebuildRequested; - } - - @Override - public @Nullable String getRebuildReason() { - return myRebuildReason; - } - @Override public @NotNull ProgressIndicator getProgressIndicator() { return myBuildSession.getIndicator(); diff --git a/java/compiler/impl/src/com/intellij/compiler/server/AutomakeCompileContext.java b/java/compiler/impl/src/com/intellij/compiler/server/AutomakeCompileContext.java index 345bf9103e5a..f314a6e37bae 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/AutomakeCompileContext.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/AutomakeCompileContext.java @@ -94,20 +94,6 @@ final class AutomakeCompileContext extends UserDataHolderBase implements Compile return myIndicator; } - @Override - public void requestRebuildNextTime(String message) { - } - - @Override - public boolean isRebuildRequested() { - return false; - } - - @Override - public @Nullable String getRebuildReason() { - return null; - } - @Override public Module getModuleByFile(@NotNull VirtualFile file) { return ProjectRootManager.getInstance(myProject).getFileIndex().getModuleForFile(file); diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/CompileContext.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompileContext.java index 0fa50a783b22..acdf364c4a28 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/CompileContext.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompileContext.java @@ -7,6 +7,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.UserDataHolder; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.Navigatable; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -17,6 +18,7 @@ import java.util.Collections; /** * An interface allowing access and modification of the data associated with the current compile session. */ +@ApiStatus.NonExtendable public interface CompileContext extends UserDataHolder { /** * Allows adding a message to be shown in `Compiler` message view. @@ -111,13 +113,32 @@ public interface CompileContext extends UserDataHolder { /** * A compiler may call this method to request complete project rebuild. * This may be necessary, for example, when compiler caches are corrupted. + * @deprecated calls of this method don't affect the behavior of the compilation engine; code which performs compilation should be + * migrated to be run in a separate JPS build process, see {@link Compiler} for details. */ - void requestRebuildNextTime(String message); + @Deprecated(forRemoval = true) + default void requestRebuildNextTime(String message) { + } - boolean isRebuildRequested(); + /** + * @deprecated the compilation engine doesn't support triggering rebuild from the IDE process; code which performs compilation should be + * migrated to be run in a separate JPS build process, see {@link Compiler} for details. + */ + @Deprecated(forRemoval = true) + default boolean isRebuildRequested() { + return false; + } + + /** + * @deprecated the compilation engine doesn't support triggering rebuild from the IDE process; code which performs compilation should be + * migrated to be run in a separate JPS build process, see {@link Compiler} for details. + */ + @Deprecated(forRemoval = true) @Nullable - String getRebuildReason(); + default String getRebuildReason() { + return null; + } /** * Returns the module to which the specified file belongs. This method is aware of the file->module mapping diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java index 2b6b7578dfc9..9c36cf50eddc 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java @@ -64,20 +64,6 @@ public class DummyCompileContext implements CompileContext { return null; } - @Override - public void requestRebuildNextTime(String message) { - } - - @Override - public boolean isRebuildRequested() { - return false; - } - - @Override - public @Nullable String getRebuildReason() { - return null; - } - @Override public Module getModuleByFile(@NotNull VirtualFile file) { return null;