mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+1
-1
@@ -1732,7 +1732,7 @@ public class DaemonRespondToChangesTest extends DaemonAnalyzerTestCase {
|
||||
long max = Arrays.stream(interruptTimes).max().getAsLong();
|
||||
long min = Arrays.stream(interruptTimes).min().getAsLong();
|
||||
System.out.println("Average among the N/3 median times: " + mean + "ms; max: "+max+"; min:"+min+"; avg: "+avg);
|
||||
assertTrue(mean < 10);
|
||||
assertTrue(String.valueOf(mean), mean < 10);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+8
-7
@@ -16,7 +16,6 @@
|
||||
package com.intellij.openapi.components.impl;
|
||||
|
||||
import com.intellij.diagnostic.PluginException;
|
||||
import com.intellij.ide.StartupProgress;
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -26,6 +25,7 @@ import com.intellij.openapi.components.ComponentManager;
|
||||
import com.intellij.openapi.components.NamedComponent;
|
||||
import com.intellij.openapi.components.ex.ComponentManagerEx;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.extensions.PluginId;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
@@ -53,8 +53,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.intellij.openapi.extensions.Extensions.isComponentSuitableForOs;
|
||||
|
||||
public abstract class ComponentManagerImpl extends UserDataHolderBase implements ComponentManagerEx, Disposable {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.components.ComponentManager");
|
||||
|
||||
@@ -159,7 +157,6 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements
|
||||
myComponentConfigCount = -1;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public final <T> T getComponent(@NotNull Class<T> interfaceClass) {
|
||||
if (myDisposeCompleted) {
|
||||
@@ -168,15 +165,16 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements
|
||||
}
|
||||
|
||||
ComponentAdapter adapter = getPicoContainer().getComponentAdapter(interfaceClass);
|
||||
//noinspection unchecked
|
||||
if (!(adapter instanceof ComponentConfigComponentAdapter)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (myDisposed) {
|
||||
// getComponent could be called during some component.dispose() call, in this case we don't attempt to instantiate component
|
||||
//noinspection unchecked
|
||||
return (T)((ComponentConfigComponentAdapter)adapter).myInitializedComponentInstance;
|
||||
}
|
||||
//noinspection unchecked
|
||||
return (T)adapter.getComponentInstance(getPicoContainer());
|
||||
}
|
||||
|
||||
@@ -268,7 +266,7 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements
|
||||
|
||||
protected boolean isComponentSuitable(@Nullable Map<String, String> options) {
|
||||
return options == null ||
|
||||
isComponentSuitableForOs(options.get("os")) &&
|
||||
Extensions.isComponentSuitableForOs(options.get("os")) &&
|
||||
(!Boolean.parseBoolean(options.get("internal")) || ApplicationManager.getApplication().isInternal());
|
||||
}
|
||||
|
||||
@@ -441,7 +439,10 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements
|
||||
|
||||
final boolean isWorkspaceComponent;
|
||||
|
||||
public ComponentConfigComponentAdapter(@NotNull Class<?> interfaceClass, @NotNull Class<?> implementationClass, @Nullable PluginId pluginId, boolean isWorkspaceComponent) {
|
||||
ComponentConfigComponentAdapter(@NotNull Class<?> interfaceClass,
|
||||
@NotNull Class<?> implementationClass,
|
||||
@Nullable PluginId pluginId,
|
||||
boolean isWorkspaceComponent) {
|
||||
super(interfaceClass, implementationClass, null, true);
|
||||
|
||||
myPluginId = pluginId;
|
||||
|
||||
+6
-11
@@ -91,12 +91,7 @@ public class TemplateManagerImpl extends TemplateManager implements Disposable {
|
||||
public static void setTemplateTesting(Project project, Disposable parentDisposable) {
|
||||
final TemplateManagerImpl instance = (TemplateManagerImpl)getInstance(project);
|
||||
instance.myTemplateTesting = true;
|
||||
Disposer.register(parentDisposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
instance.myTemplateTesting = false;
|
||||
}
|
||||
});
|
||||
Disposer.register(parentDisposable, () -> instance.myTemplateTesting = false);
|
||||
}
|
||||
|
||||
private static void disposeState(@NotNull TemplateState state) {
|
||||
@@ -389,11 +384,11 @@ public class TemplateManagerImpl extends TemplateManager implements Disposable {
|
||||
};
|
||||
}
|
||||
|
||||
public static List<TemplateImpl> findMatchingTemplates(CharSequence text,
|
||||
int caretOffset,
|
||||
@Nullable Character shortcutChar,
|
||||
TemplateSettings settings,
|
||||
boolean hasArgument) {
|
||||
private static List<TemplateImpl> findMatchingTemplates(CharSequence text,
|
||||
int caretOffset,
|
||||
@Nullable Character shortcutChar,
|
||||
TemplateSettings settings,
|
||||
boolean hasArgument) {
|
||||
List<TemplateImpl> candidates = Collections.emptyList();
|
||||
for (int i = settings.getMaxKeyLength(); i >= 1; i--) {
|
||||
int wordStart = caretOffset - i;
|
||||
|
||||
@@ -27,7 +27,7 @@ import javax.swing.event.HyperlinkListener;
|
||||
|
||||
/**
|
||||
* If you want to register a toolwindow, which will be enabled during the dumb mode, please use {@link ToolWindowManager}'s
|
||||
* registration methods which have 'canWorkInDumMode' parameter.
|
||||
* registration methods which have 'canWorkInDumbMode' parameter.
|
||||
*/
|
||||
public abstract class ToolWindowManager {
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@ public class CommandMerger {
|
||||
private EditorAndState myStateAfter;
|
||||
private UndoConfirmationPolicy myUndoConfirmationPolicy = UndoConfirmationPolicy.DEFAULT;
|
||||
|
||||
public CommandMerger(@NotNull UndoManagerImpl manager) {
|
||||
CommandMerger(@NotNull UndoManagerImpl manager) {
|
||||
myManager = manager;
|
||||
}
|
||||
|
||||
public CommandMerger(@NotNull UndoManagerImpl manager, boolean isTransparent) {
|
||||
CommandMerger(@NotNull UndoManagerImpl manager, boolean isTransparent) {
|
||||
myManager = manager;
|
||||
myTransparent = isTransparent;
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ public abstract class ToolWindowManagerEx extends ToolWindowManager {
|
||||
public abstract void removeToolWindowManagerListener(@NotNull ToolWindowManagerListener listener);
|
||||
|
||||
/**
|
||||
* @return <code>ID</code> of tool window that was activated last time.
|
||||
* @return {@code ID} of tool window that was activated last time.
|
||||
*/
|
||||
@Nullable
|
||||
public abstract String getLastActiveToolWindowId();
|
||||
|
||||
/**
|
||||
* @return <code>ID</code> of tool window which was last activated among tool windows satisfying the current condition
|
||||
* @return {@code ID} of tool window which was last activated among tool windows satisfying the current condition
|
||||
*/
|
||||
@Nullable
|
||||
public abstract String getLastActiveToolWindowId(@Nullable Condition<JComponent> condition);
|
||||
@@ -61,7 +61,7 @@ public abstract class ToolWindowManagerEx extends ToolWindowManager {
|
||||
public abstract DesktopLayout getLayoutToRestoreLater();
|
||||
|
||||
/**
|
||||
* Copied <code>layout</code> into internal layout and rearranges tool windows.
|
||||
* Copied {@code layout} into internal layout and rearranges tool windows.
|
||||
*/
|
||||
public abstract void setLayout(@NotNull DesktopLayout layout);
|
||||
|
||||
|
||||
+4
-5
@@ -651,7 +651,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase {
|
||||
public void testUndoShouldAddToCommitQueue() throws IOException {
|
||||
VirtualFile virtualFile = getVirtualFile(createTempFile("X.java", ""));
|
||||
PsiFile file = findFile(virtualFile);
|
||||
assertTrue(file.getFileType().getName().equals("JAVA"));
|
||||
assertEquals("JAVA", file.getFileType().getName());
|
||||
|
||||
assertNotNull(file);
|
||||
assertTrue(file.isPhysical());
|
||||
@@ -766,9 +766,8 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase {
|
||||
assertTrue(pdm.isCommitted(document));
|
||||
assertFalse(file.isValid());
|
||||
|
||||
WriteCommandAction.runWriteCommandAction(null, () -> {
|
||||
document.replaceString(0, document.getTextLength(), "xxxxxxxxxxxxxxxxxxxx");
|
||||
});
|
||||
WriteCommandAction.runWriteCommandAction(null, () ->
|
||||
document.replaceString(0, document.getTextLength(), "xxxxxxxxxxxxxxxxxxxx"));
|
||||
pdm.commitAllDocuments();
|
||||
assertTrue(pdm.isCommitted(document));
|
||||
|
||||
@@ -789,7 +788,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase {
|
||||
return StringUtil.repeat("a", FileUtilRt.LARGE_FOR_CONTENT_LOADING + 1);
|
||||
}
|
||||
|
||||
private static abstract class FileTooBigExceptionCase extends AbstractExceptionCase {
|
||||
private abstract static class FileTooBigExceptionCase extends AbstractExceptionCase {
|
||||
@Override
|
||||
public Class getExpectedExceptionClass() {
|
||||
return FileTooBigException.class;
|
||||
|
||||
Reference in New Issue
Block a user