GitOrigin-RevId: e1c1dd47e59769455e4af94a6f776fc530495cb5
This commit is contained in:
Vladimir Krivosheev
2022-01-01 13:29:02 +01:00
committed by intellij-monorepo-bot
parent 6472ca0ddb
commit 099619cf3d
7 changed files with 26 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.facet.impl.pointers;
import com.intellij.facet.pointers.FacetPointersManager;
@@ -6,13 +6,12 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupActivity;
import org.jetbrains.annotations.NotNull;
public class FacetPointersPostStartupActivity implements StartupActivity {
final class FacetPointersPostStartupActivity implements StartupActivity {
@Override
public void runActivity(@NotNull Project project) {
FacetPointersManager manager = FacetPointersManager.getInstance(project);
if (manager instanceof FacetPointersManagerImpl) {
FacetPointersManagerImpl managerImpl = (FacetPointersManagerImpl)manager;
managerImpl.refreshPointers();
((FacetPointersManagerImpl)manager).refreshPointers();
}
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide;
import com.intellij.openapi.diagnostic.Logger;
@@ -6,18 +6,17 @@ import com.intellij.ui.hover.HoverListener;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.NotNull;
import javax.swing.SwingUtilities;
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Point;
import java.awt.Window;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
final class HoverService {
private static final Logger LOG = Logger.getInstance(HoverService.class);
private final SmartList<ComponentPoint> hierarchy = new SmartList<>();
private final List<ComponentPoint> hierarchy = new ArrayList<>();
void process(@NotNull AWTEvent event) {
if (event instanceof MouseEvent) {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.fileEditor.impl;
import com.intellij.openapi.editor.ClientEditorManager;
@@ -9,7 +9,7 @@ import com.intellij.util.ui.UIUtil;
import java.util.Optional;
public class ClientCurrentEditorProvider implements CurrentEditorProvider {
final class ClientCurrentEditorProvider implements CurrentEditorProvider {
@Override
public FileEditor getCurrentEditor() {
Optional<Editor> focusedEditor = ClientEditorManager.getCurrentInstance().editors()

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.fileEditor.impl;
import com.intellij.ide.DataManager;
@@ -6,7 +6,7 @@ import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformCoreDataKeys;
import com.intellij.openapi.fileEditor.FileEditor;
public class FocusBasedCurrentEditorProvider implements CurrentEditorProvider {
public final class FocusBasedCurrentEditorProvider implements CurrentEditorProvider {
@Override
public FileEditor getCurrentEditor() {
DataManager dataManager = DataManager.getInstanceIfCreated();

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.fileTypes.impl;
import com.intellij.diagnostic.PluginException;
@@ -220,7 +220,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
}, this);
}
static class FileTypeWithDescriptor implements Scheme {
static final class FileTypeWithDescriptor implements Scheme {
private static final PluginDescriptor WILD_CARD = new DefaultPluginDescriptor("WILD_CARD");
final @NotNull FileType fileType;

View File

@@ -45,8 +45,6 @@
<stubIndex implementation="com.intellij.util.xml.stubs.index.DomNamespaceKeyIndex"/>
<stubIndex implementation="com.intellij.util.xml.stubs.index.DomElementClassIndex"/>
<applicationService serviceImplementation="com.intellij.util.xml.impl.DomApplicationComponent"/>
<applicationService serviceInterface="com.intellij.util.xml.DomService"
serviceImplementation="com.intellij.util.xml.impl.DomServiceImpl"/>

View File

@@ -1,14 +1,15 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.xml.impl;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.Service;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ReflectionAssignabilityCache;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.containers.ConcurrentFactoryMap;
import com.intellij.util.containers.CollectionFactory;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
import com.intellij.util.xml.DomElement;
@@ -28,23 +29,17 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author peter
*/
@Service(Service.Level.APP)
public final class DomApplicationComponent {
private final MultiMap<String, DomFileMetaData> myRootTagName2FileDescription = MultiMap.createSet();
private final Set<DomFileMetaData> myAcceptingOtherRootTagNamesDescriptions = new HashSet<>();
private final ImplementationClassCache myCachedImplementationClasses = new ImplementationClassCache(DomImplementationClassEP.EP_NAME);
private final TypeChooserManager myTypeChooserManager = new TypeChooserManager();
final ReflectionAssignabilityCache assignabilityCache = new ReflectionAssignabilityCache();
private final Map<Class<?>, DomElementsAnnotator> myClass2Annotator = ConcurrentFactoryMap.createMap(key-> {
final DomFileDescription<?> desc = findFileDescription(key);
return desc == null ? null : desc.createAnnotator();
}
);
private final Map<Class<?>, DomElementsAnnotator> classToAnnotator = new ConcurrentHashMap<>();
private final Map<Class<?>, DomFileDescription<?>> classToDescription = new ConcurrentHashMap<>();
private final Map<Class<?>, InvocationCache> myInvocationCaches = ContainerUtil.createConcurrentSoftValueMap();
private final Map<Class<?>, InvocationCache> myInvocationCaches = CollectionFactory.createConcurrentSoftValueMap();
private final Map<Class<? extends DomElementVisitor>, VisitorDescription> myVisitorDescriptions = new ConcurrentHashMap<>();
public DomApplicationComponent() {
@@ -78,7 +73,7 @@ public final class DomApplicationComponent {
myRootTagName2FileDescription.clear();
myAcceptingOtherRootTagNamesDescriptions.clear();
myClass2Annotator.clear();
classToAnnotator.clear();
classToDescription.clear();
myCachedImplementationClasses.clearCache();
@@ -172,7 +167,10 @@ public final class DomApplicationComponent {
}
public DomElementsAnnotator getAnnotator(@NotNull Class<?> rootElementClass) {
return myClass2Annotator.get(rootElementClass);
return classToAnnotator.computeIfAbsent(rootElementClass, key -> {
DomFileDescription<?> desc = findFileDescription(key);
return desc == null ? null : desc.createAnnotator();
});
}
@Nullable Class<? extends DomElement> getImplementation(Class<?> concreteInterface) {