diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java
index f9d6392d81a3..a5426cd1c564 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java
@@ -1,18 +1,4 @@
-/*
- * Copyright 2000-2017 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-2019 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;
@@ -57,8 +43,6 @@ import java.awt.event.MouseEvent;
import java.util.*;
public class JavaLineMarkerProvider extends LineMarkerProviderDescriptor {
- protected final DaemonCodeAnalyzerSettings myDaemonSettings;
- protected final EditorColorsManager myColorsManager;
private final Option myLambdaOption = new Option("java.lambda", "Lambda", AllIcons.Gutter.ImplementingFunctionalInterface);
private final Option myOverriddenOption = new Option("java.overridden", "Overridden method", AllIcons.Gutter.OverridenMethod);
private final Option myImplementedOption = new Option("java.implemented", "Implemented method", AllIcons.Gutter.ImplementedMethod);
@@ -69,9 +53,12 @@ public class JavaLineMarkerProvider extends LineMarkerProviderDescriptor {
private static final CallMatcher SERVICE_LOADER_LOAD = CallMatcher.staticCall("java.util.ServiceLoader", "load", "loadInstalled");
+ public JavaLineMarkerProvider() {
+ }
+
+ @SuppressWarnings("unused")
+ @Deprecated
public JavaLineMarkerProvider(DaemonCodeAnalyzerSettings daemonSettings, EditorColorsManager colorsManager) {
- myDaemonSettings = daemonSettings;
- myColorsManager = colorsManager;
}
@Override
@@ -112,7 +99,7 @@ public class JavaLineMarkerProvider extends LineMarkerProviderDescriptor {
}
}
- if (myDaemonSettings.SHOW_METHOD_SEPARATORS && element.getFirstChild() == null) {
+ if (DaemonCodeAnalyzerSettings.getInstance().SHOW_METHOD_SEPARATORS && element.getFirstChild() == null) {
PsiElement element1 = element;
boolean isMember = false;
while (element1 != null && !(element1 instanceof PsiFile) && element1.getPrevSibling() == null) {
@@ -139,7 +126,7 @@ public class JavaLineMarkerProvider extends LineMarkerProviderDescriptor {
}
if (drawSeparator) {
- return LineMarkersPass.createMethodSeparatorLineMarker(element, myColorsManager);
+ return LineMarkersPass.createMethodSeparatorLineMarker(element, EditorColorsManager.getInstance());
}
}
}
diff --git a/java/manifest/src/org/jetbrains/lang/manifest/completion/ManifestCompletionContributor.java b/java/manifest/src/org/jetbrains/lang/manifest/completion/ManifestCompletionContributor.java
index e4870790eacf..7b4e76010673 100644
--- a/java/manifest/src/org/jetbrains/lang/manifest/completion/ManifestCompletionContributor.java
+++ b/java/manifest/src/org/jetbrains/lang/manifest/completion/ManifestCompletionContributor.java
@@ -41,8 +41,8 @@ import org.jetbrains.lang.manifest.psi.ManifestTokenType;
* @author Jan Thomä
* @author Robert F. Beeger (robert@beeger.net)
*/
-public class ManifestCompletionContributor extends CompletionContributor {
- public ManifestCompletionContributor(@NotNull final HeaderParserRepository repository) {
+final class ManifestCompletionContributor extends CompletionContributor {
+ ManifestCompletionContributor() {
extend(CompletionType.BASIC,
PlatformPatterns.psiElement(ManifestTokenType.HEADER_NAME).withLanguage(ManifestLanguage.INSTANCE),
new CompletionProvider() {
@@ -50,7 +50,7 @@ public class ManifestCompletionContributor extends CompletionContributor {
public void addCompletions(@NotNull CompletionParameters parameters,
@NotNull ProcessingContext context,
@NotNull CompletionResultSet resultSet) {
- for (String header : repository.getAllHeaderNames()) {
+ for (String header : HeaderParserRepository.getInstance().getAllHeaderNames()) {
resultSet.addElement(LookupElementBuilder.create(header).withInsertHandler(HEADER_INSERT_HANDLER));
}
}
diff --git a/java/manifest/src/org/jetbrains/lang/manifest/highlighting/HeaderAnnotator.java b/java/manifest/src/org/jetbrains/lang/manifest/highlighting/HeaderAnnotator.java
index 9131877a0279..13031ed0f55e 100644
--- a/java/manifest/src/org/jetbrains/lang/manifest/highlighting/HeaderAnnotator.java
+++ b/java/manifest/src/org/jetbrains/lang/manifest/highlighting/HeaderAnnotator.java
@@ -37,13 +37,7 @@ import org.jetbrains.lang.manifest.psi.Header;
/**
* @author Robert F. Beeger (robert@beeger.net)
*/
-public class HeaderAnnotator implements Annotator {
- private final HeaderParserRepository myRepository;
-
- public HeaderAnnotator(@NotNull HeaderParserRepository repository) {
- myRepository = repository;
- }
-
+final class HeaderAnnotator implements Annotator {
@Override
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) {
if (psiElement instanceof Header) {
@@ -53,7 +47,7 @@ public class HeaderAnnotator implements Annotator {
holder.createAnnotation(HighlightSeverity.ERROR, header.getNameElement().getTextRange(), ManifestBundle.message("header.name.invalid"));
}
else {
- HeaderParser headerParser = myRepository.getHeaderParser(name);
+ HeaderParser headerParser = HeaderParserRepository.getInstance().getHeaderParser(name);
if (headerParser != null) {
headerParser.annotate(header, holder);
}
diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/ThreadLocalAnnotatorMap.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/ThreadLocalAnnotatorMap.java
index 893b2e50fba8..95adfa907571 100644
--- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/ThreadLocalAnnotatorMap.java
+++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/ThreadLocalAnnotatorMap.java
@@ -1,21 +1,9 @@
-/*
- * 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-2019 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.lang.annotation.Annotator;
import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.util.ReflectionUtil;
import com.intellij.util.pico.CachingConstructorInjectionComponentAdapter;
import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
@@ -52,7 +40,14 @@ abstract class ThreadLocalAnnotatorMap {
PicoContainer container = ApplicationManager.getApplication().getPicoContainer();
for (V template : templates) {
Class extends V> aClass = (Class extends V>)template.getClass();
- V clone = (V)new CachingConstructorInjectionComponentAdapter(aClass.getName(), aClass).getComponentInstance(container);
+ V clone;
+ // todo in general CachingConstructorInjectionComponentAdapter should be not used at all, but for now disable it only for known cases
+ if (Annotator.class.isAssignableFrom(aClass)) {
+ clone = ReflectionUtil.newInstance(aClass);
+ }
+ else {
+ clone = (V)new CachingConstructorInjectionComponentAdapter(aClass.getName(), aClass, null, true).getComponentInstance(container);
+ }
result.add(clone);
}
return result;
diff --git a/platform/extensions/src/com/intellij/openapi/extensions/AbstractExtensionPointBean.java b/platform/extensions/src/com/intellij/openapi/extensions/AbstractExtensionPointBean.java
index 2511b2412df9..07b68c8214b5 100644
--- a/platform/extensions/src/com/intellij/openapi/extensions/AbstractExtensionPointBean.java
+++ b/platform/extensions/src/com/intellij/openapi/extensions/AbstractExtensionPointBean.java
@@ -1,4 +1,4 @@
-// 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.
+// Copyright 2000-2019 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.openapi.extensions;
import com.intellij.openapi.diagnostic.Logger;
@@ -12,7 +12,8 @@ import org.picocontainer.PicoContainer;
* @author peter
*/
public abstract class AbstractExtensionPointBean implements PluginAware {
- private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.extensions.AbstractExtensionPointBean");
+ protected static final Logger LOG = Logger.getInstance("#com.intellij.openapi.extensions.AbstractExtensionPointBean");
+
protected PluginDescriptor myPluginDescriptor;
@Transient
diff --git a/platform/extensions/src/com/intellij/openapi/extensions/CustomLoadingExtensionPointBean.java b/platform/extensions/src/com/intellij/openapi/extensions/CustomLoadingExtensionPointBean.java
index e13544076a9f..21677c6742d7 100644
--- a/platform/extensions/src/com/intellij/openapi/extensions/CustomLoadingExtensionPointBean.java
+++ b/platform/extensions/src/com/intellij/openapi/extensions/CustomLoadingExtensionPointBean.java
@@ -1,21 +1,8 @@
-/*
- * 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-2019 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.openapi.extensions;
+import com.intellij.util.ReflectionUtil;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;
import org.picocontainer.PicoContainer;
@@ -43,7 +30,19 @@ public class CustomLoadingExtensionPointBean extends AbstractExtensionPointBean
(myPluginDescriptor == null ? "" : myPluginDescriptor.getPluginId()) + ". " +
"Check if 'implementationClass' attribute is specified");
}
- return instantiate(findClass(implementationClass), picoContainer, true);
+ Class