diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/JavaSoftKeywordHighlighting.kt b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/JavaSoftKeywordHighlighting.kt index 57a6640420b9..dedbf3311ebf 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/JavaSoftKeywordHighlighting.kt +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/JavaSoftKeywordHighlighting.kt @@ -5,17 +5,13 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPass import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar import com.intellij.lang.java.lexer.JavaLexer -import com.intellij.openapi.components.AbstractProjectComponent import com.intellij.openapi.editor.Document import com.intellij.openapi.editor.Editor import com.intellij.openapi.progress.ProgressIndicator -import com.intellij.openapi.project.Project import com.intellij.pom.java.LanguageLevel import com.intellij.psi.* -class JavaSoftKeywordHighlightingPassFactory(project: Project, registrar: TextEditorHighlightingPassRegistrar) : - AbstractProjectComponent(project), TextEditorHighlightingPassFactory { - +class JavaSoftKeywordHighlightingPassFactory(registrar: TextEditorHighlightingPassRegistrar) : TextEditorHighlightingPassFactory { init { registrar.registerTextEditorHighlightingPass(this, null, null, false, -1) } diff --git a/java/java-impl/src/com/intellij/codeInsight/hints/MethodChainHintsPassFactory.kt b/java/java-impl/src/com/intellij/codeInsight/hints/MethodChainHintsPassFactory.kt index b42414547fde..22f3431b084a 100644 --- a/java/java-impl/src/com/intellij/codeInsight/hints/MethodChainHintsPassFactory.kt +++ b/java/java-impl/src/com/intellij/codeInsight/hints/MethodChainHintsPassFactory.kt @@ -4,16 +4,12 @@ package com.intellij.codeInsight.hints import com.intellij.codeHighlighting.TextEditorHighlightingPass import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar -import com.intellij.openapi.components.AbstractProjectComponent import com.intellij.openapi.editor.Editor -import com.intellij.openapi.project.Project import com.intellij.openapi.util.Key import com.intellij.psi.PsiFile import com.intellij.psi.PsiJavaFile -class MethodChainHintsPassFactory(project: Project, registrar: TextEditorHighlightingPassRegistrar) : AbstractProjectComponent( - project), TextEditorHighlightingPassFactory { - +class MethodChainHintsPassFactory(registrar: TextEditorHighlightingPassRegistrar) : TextEditorHighlightingPassFactory { init { registrar.registerTextEditorHighlightingPass(this, null, null, false, -1) } @@ -28,5 +24,4 @@ class MethodChainHintsPassFactory(project: Project, registrar: TextEditorHighlig companion object { val modificationStampHolder: ModificationStampHolder = ModificationStampHolder(Key.create("METHOD_CHAIN_PASS_LAST_MODIFICATION_TIMESTAMP")) } - } \ No newline at end of file diff --git a/platform/analysis-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPassFactory.java b/platform/analysis-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPassFactory.java index 14903ea72cb7..dea9a3bc904f 100644 --- a/platform/analysis-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPassFactory.java +++ b/platform/analysis-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPassFactory.java @@ -1,13 +1,12 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeHighlighting; -import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.editor.Editor; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public interface TextEditorHighlightingPassFactory extends ProjectComponent { +public interface TextEditorHighlightingPassFactory { @Nullable TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPassFactory.java index 8c60af24b13e..80455ecf3e18 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPassFactory.java @@ -13,7 +13,6 @@ import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; import com.intellij.util.ui.update.MergingUpdateQueue; import com.intellij.util.ui.update.Update; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -31,13 +30,6 @@ public class ExternalToolPassFactory implements TextEditorHighlightingPassFactor myExternalActivitiesQueue.setPassThrough(ApplicationManager.getApplication().isUnitTestMode()); } - @Override - @NonNls - @NotNull - public String getComponentName() { - return "ExternalToolPassFactory"; - } - @Override @Nullable public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPassFactory.java index c03426a24f46..492f4e8b8da1 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPassFactory.java @@ -1,53 +1,31 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.daemon.impl; -import com.intellij.codeHighlighting.*; +import com.intellij.codeHighlighting.MainHighlightingPassFactory; +import com.intellij.codeHighlighting.Pass; +import com.intellij.codeHighlighting.TextEditorHighlightingPass; +import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar; import com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.EmptyPass; -import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.ProperTextRange; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -/** - * @author cdr -*/ -public class GeneralHighlightingPassFactory extends AbstractProjectComponent implements MainHighlightingPassFactory { +public class GeneralHighlightingPassFactory implements MainHighlightingPassFactory { + private final Project myProject; + public GeneralHighlightingPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar, DefaultHighlightVisitor dhi) { - super(project); + myProject = project; highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_FOLDING}, false, Pass.UPDATE_ALL); assert dhi != null; } - @Override - @NonNls - @NotNull - public String getComponentName() { - return "GeneralHighlightingPassFactory"; - } - @Override @Nullable public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPassFactory.java index f27c664c44dc..9daea7c98d8b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPassFactory.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.daemon.impl; import com.intellij.codeHighlighting.Pass; @@ -21,7 +7,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory; import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar; import com.intellij.codeInsight.CodeInsightSettings; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; @@ -29,16 +14,14 @@ import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.TestOnly; -/** - * @author yole - */ -public class IdentifierHighlighterPassFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory { +public class IdentifierHighlighterPassFactory implements TextEditorHighlightingPassFactory { private static final int[] AFTER_PASSES = {Pass.UPDATE_ALL}; private static boolean ourTestingIdentifierHighlighting; - + private final Project myProject; + public IdentifierHighlighterPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) { - super(project); + myProject = project; highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, AFTER_PASSES, false, -1); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPassFactory.java index 591ce93fc97b..513c48b3a9b1 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPassFactory.java @@ -9,7 +9,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; public class IndentsPassFactory implements TextEditorHighlightingPassFactory { @@ -20,13 +19,6 @@ public class IndentsPassFactory implements TextEditorHighlightingPassFactory { highlightingPassRegistrar.registerTextEditorHighlightingPass(this, TextEditorHighlightingPassRegistrar.Anchor.BEFORE, Pass.UPDATE_FOLDING, false, false); } - @Override - @NonNls - @NotNull - public String getComponentName() { - return "IndentsPassFactory"; - } - @Override @NotNull public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPassFactory.java index c9fa325d7c62..bc1e89a4c215 100755 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPassFactory.java @@ -8,7 +8,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; public class InjectedCodeFoldingPassFactory implements TextEditorHighlightingPassFactory { @@ -19,13 +18,6 @@ public class InjectedCodeFoldingPassFactory implements TextEditorHighlightingPas highlightingPassRegistrar.registerTextEditorHighlightingPass(this, new int[]{Pass.UPDATE_ALL}, null, false, -1); } - @Override - @NonNls - @NotNull - public String getComponentName() { - return "InjectedCodeFoldingPassFactory"; - } - @Override @NotNull public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedGeneralHighlightingPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedGeneralHighlightingPassFactory.java index 83ed3c351cfa..3918db1999ab 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedGeneralHighlightingPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedGeneralHighlightingPassFactory.java @@ -11,7 +11,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.ProperTextRange; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -23,13 +22,6 @@ public class InjectedGeneralHighlightingPassFactory implements MainHighlightingP highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, false, -1); } - @Override - @NonNls - @NotNull - public String getComponentName() { - return "InjectedGeneralHighlightingPassFactory"; - } - @Override @Nullable public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPassFactory.java index b1fa2327047d..bf03ef58d57d 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPassFactory.java @@ -1,26 +1,10 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.daemon.impl; import com.intellij.codeHighlighting.Pass; import com.intellij.codeHighlighting.TextEditorHighlightingPass; import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory; import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar; -import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.impl.MarkupModelImpl; @@ -28,26 +12,17 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.ProperTextRange; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -/** - * @author cdr -*/ -public class LineMarkersPassFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory { +public class LineMarkersPassFactory implements TextEditorHighlightingPassFactory { + private final Project myProject; + public LineMarkersPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) { - super(project); + myProject = project; highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, false, Pass.LINE_MARKERS); } - @Override - @NonNls - @NotNull - public String getComponentName() { - return "LineMarkersPassFactory"; - } - @Override @Nullable public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java index 37d4b2d78658..e5c8e1798c76 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.daemon.impl; @@ -22,7 +8,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPass; import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar; import com.intellij.codeInspection.ex.InspectionProfileWrapper; import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; -import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; @@ -30,28 +15,20 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiUtilCore; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; -/** - * @author cdr -*/ -public class LocalInspectionsPassFactory extends AbstractProjectComponent implements MainHighlightingPassFactory { - private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.LocalInspectionsPassFactory"); - public LocalInspectionsPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) { - super(project); - highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, true, Pass.LOCAL_INSPECTIONS); - } +public class LocalInspectionsPassFactory implements MainHighlightingPassFactory { + private static final Logger LOG = Logger.getInstance(LocalInspectionsPassFactory.class); - @Override - @NonNls - @NotNull - public String getComponentName() { - return "LocalInspectionsPassFactory"; + private final Project myProject; + + public LocalInspectionsPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) { + myProject = project; + highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, true, Pass.LOCAL_INSPECTIONS); } @Override diff --git a/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java b/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java index 68297fcc64e4..98eb7647205f 100644 --- a/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java +++ b/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java @@ -16,6 +16,7 @@ import com.intellij.notification.NotificationType; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.progress.ProgressIndicator; @@ -39,7 +40,7 @@ import org.jetbrains.annotations.TestOnly; import java.util.*; -public class FrameworkDetectionManager implements FrameworkDetectionIndexListener, TextEditorHighlightingPassFactory, Disposable { +public class FrameworkDetectionManager implements FrameworkDetectionIndexListener, TextEditorHighlightingPassFactory, Disposable, ProjectComponent { private static final Logger LOG = Logger.getInstance(FrameworkDetectionManager.class); private static final NotificationGroup FRAMEWORK_DETECTION_NOTIFICATION = NotificationGroup.balloonGroup("Framework Detection"); private final Update myDetectionUpdate = new Update("detection") { diff --git a/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTracker.java b/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTracker.java index 8a655b8c4a06..76e850e2a720 100644 --- a/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTracker.java +++ b/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTracker.java @@ -1,37 +1,15 @@ -/* - * Copyright 2000-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide; -import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; -/** - * @author nik - */ -public abstract class GeneratedSourceFileChangeTracker extends AbstractProjectComponent { +public abstract class GeneratedSourceFileChangeTracker { @NotNull public static GeneratedSourceFileChangeTracker getInstance(@NotNull Project project) { return project.getComponent(GeneratedSourceFileChangeTracker.class); } - protected GeneratedSourceFileChangeTracker(Project project) { - super(project); - } - public abstract boolean isEditedGeneratedFile(@NotNull VirtualFile file); } diff --git a/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTrackerImpl.java b/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTrackerImpl.java index 99a8dc5ab410..a10a6a2ccc25 100644 --- a/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTrackerImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/GeneratedSourceFileChangeTrackerImpl.java @@ -4,6 +4,7 @@ package com.intellij.ide; import com.intellij.AppTopics; import com.intellij.ProjectTopics; import com.intellij.openapi.application.ReadAction; +import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.EditorFactory; import com.intellij.openapi.editor.event.DocumentEvent; @@ -30,15 +31,16 @@ import java.util.*; /** * @author nik */ -public class GeneratedSourceFileChangeTrackerImpl extends GeneratedSourceFileChangeTracker { +public class GeneratedSourceFileChangeTrackerImpl extends GeneratedSourceFileChangeTracker implements ProjectComponent { + private final Project myProject; private final FileDocumentManager myDocumentManager; private final EditorNotifications myEditorNotifications; private final MergingUpdateQueue myCheckingQueue; - private final Set myFilesToCheck = Collections.synchronizedSet(new HashSet()); - private final Set myEditedGeneratedFiles = Collections.synchronizedSet(new HashSet()); + private final Set myFilesToCheck = Collections.synchronizedSet(new HashSet<>()); + private final Set myEditedGeneratedFiles = Collections.synchronizedSet(new HashSet<>()); public GeneratedSourceFileChangeTrackerImpl(Project project, FileDocumentManager documentManager, EditorNotifications editorNotifications) { - super(project); + myProject = project; myDocumentManager = documentManager; myEditorNotifications = editorNotifications; myCheckingQueue = new MergingUpdateQueue("Checking for changes in generated sources", 500, false, null, project, null, Alarm.ThreadToUse.POOLED_THREAD); diff --git a/plugins/gradle/java/src/integrations/maven/MavenRepositoriesHolder.java b/plugins/gradle/java/src/integrations/maven/MavenRepositoriesHolder.java index f58220437898..c4105474473d 100644 --- a/plugins/gradle/java/src/integrations/maven/MavenRepositoriesHolder.java +++ b/plugins/gradle/java/src/integrations/maven/MavenRepositoriesHolder.java @@ -7,7 +7,6 @@ import com.intellij.notification.NotificationDisplayType; import com.intellij.notification.NotificationListener; import com.intellij.notification.impl.NotificationsConfigurationImpl; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.externalSystem.service.notification.ExternalSystemNotificationManager; import com.intellij.openapi.externalSystem.service.notification.NotificationCategory; import com.intellij.openapi.externalSystem.service.notification.NotificationData; @@ -31,19 +30,16 @@ import java.util.stream.Collectors; import static org.jetbrains.idea.maven.indices.MavenIndicesManager.IndexUpdatingState.IDLE; -/** - * @author Vladislav.Soroka - * @since 10/28/13 - */ -public class MavenRepositoriesHolder extends AbstractProjectComponent { +public class MavenRepositoriesHolder { private static final String UNINDEXED_MAVEN_REPOSITORIES_NOTIFICATION_GROUP = "Unindexed maven repositories gradle detection"; private static final Key NOTIFICATION_KEY = Key.create(UNINDEXED_MAVEN_REPOSITORIES_NOTIFICATION_GROUP); + private final Project myProject; private volatile Set myRemoteRepositories; private volatile Set myNotIndexedUrls; public MavenRepositoriesHolder(Project project) { - super(project); + myProject = project; myRemoteRepositories = Collections.emptySet(); myNotIndexedUrls = Collections.emptySet(); } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java index f549009ed5af..2adb6f09363d 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java @@ -1,14 +1,10 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.annotator; import com.intellij.codeHighlighting.TextEditorHighlightingPass; import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory; import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar; -import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.project.Project; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.plugins.groovy.GroovyLanguage; @@ -17,12 +13,8 @@ import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase; import org.jetbrains.plugins.groovy.util.GrFileIndexUtil; -/** - * @author Max Medvedev - */ -public class GrReferenceHighlighterFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory { - public GrReferenceHighlighterFactory(Project project, TextEditorHighlightingPassRegistrar registrar) { - super(project); +public class GrReferenceHighlighterFactory implements TextEditorHighlightingPassFactory { + public GrReferenceHighlighterFactory(TextEditorHighlightingPassRegistrar registrar) { registrar.registerTextEditorHighlightingPass(this, null, null, false, -1); } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/highlighter/declarations.kt b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/highlighter/declarations.kt index c1241477da1b..d7173fda1ece 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/highlighter/declarations.kt +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/highlighter/declarations.kt @@ -1,15 +1,13 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.highlighter import com.intellij.codeHighlighting.TextEditorHighlightingPass import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar -import com.intellij.openapi.components.AbstractProjectComponent import com.intellij.openapi.editor.Document import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.colors.TextAttributesKey import com.intellij.openapi.progress.ProgressIndicator -import com.intellij.openapi.project.Project import com.intellij.psi.* import org.jetbrains.plugins.groovy.annotator.GrHighlightUtil.isReassigned import org.jetbrains.plugins.groovy.highlighter.GroovySyntaxHighlighter.* @@ -27,9 +25,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrAnonymousC import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTraitTypeDefinition import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil.isScriptField -class GroovyDeclarationHighlightingPassFactory(project: Project, registrar: TextEditorHighlightingPassRegistrar) - : AbstractProjectComponent(project), TextEditorHighlightingPassFactory { - +class GroovyDeclarationHighlightingPassFactory(registrar: TextEditorHighlightingPassRegistrar) : TextEditorHighlightingPassFactory { init { registrar.registerTextEditorHighlightingPass(this, null, null, false, -1) } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java index b7fb96687b2c..b43e5b094105 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java @@ -1,34 +1,14 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.compiler; import com.intellij.openapi.compiler.CompilerManager; -import com.intellij.openapi.components.AbstractProjectComponent; -import com.intellij.openapi.project.Project; -import org.jetbrains.annotations.NotNull; +import com.intellij.openapi.components.ProjectComponent; import org.jetbrains.plugins.groovy.GroovyFileType; -/** - * @author ilyas - */ -public class GroovyCompilerLoader extends AbstractProjectComponent { +public class GroovyCompilerLoader implements ProjectComponent { private final CompilerManager myCompilerManager; - public GroovyCompilerLoader(Project project, CompilerManager manager) { - super(project); + public GroovyCompilerLoader(CompilerManager manager) { myCompilerManager = manager; } @@ -36,10 +16,4 @@ public class GroovyCompilerLoader extends AbstractProjectComponent { public void projectOpened() { myCompilerManager.addCompilableFileType(GroovyFileType.GROOVY_FILE_TYPE); } - - @Override - @NotNull - public String getComponentName() { - return "GroovyCompilerLoader"; - } } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java index c0b309bf5cc1..d9734795d442 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.mvc; import com.intellij.ProjectTopics; @@ -8,7 +6,7 @@ import com.intellij.codeInsight.actions.ReformatCodeProcessor; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; -import com.intellij.openapi.components.AbstractProjectComponent; +import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.module.ModuleUtilCore; @@ -40,17 +38,16 @@ import com.intellij.util.messages.MessageBusConnection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; +import org.jetbrains.plugins.groovy.mvc.MvcModuleStructureSynchronizer.SyncAction; import org.jetbrains.plugins.groovy.mvc.projectView.MvcToolWindowDescriptor; import java.util.*; import java.util.concurrent.ExecutorService; -/** - * @author peter - */ -public class MvcModuleStructureSynchronizer extends AbstractProjectComponent { +public class MvcModuleStructureSynchronizer implements ProjectComponent { private static final ExecutorService ourExecutor = SequentialTaskExecutor.createSequentialApplicationPoolExecutor("MvcModuleStructureSynchronizer Pool"); private final Set> myOrders = new LinkedHashSet<>(); + private final Project myProject; private Set myPluginRoots = Collections.emptySet(); @@ -61,7 +58,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent { private final SimpleModificationTracker myModificationTracker = new SimpleModificationTracker(); public MvcModuleStructureSynchronizer(Project project) { - super(project); + myProject = project; } public SimpleModificationTracker getFileAndRootsModificationTracker() { @@ -259,7 +256,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent { final Set> orderSnapshot = takeOrderSnapshot(); ReadTask task = new ReadTask() { - @Nullable + @NotNull @Override public Continuation performInReadAction(@NotNull final ProgressIndicator indicator) throws ProcessCanceledException { final Set> actions = isUpToDate() ? computeRawActions(orderSnapshot)