mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+3
-3
@@ -170,8 +170,8 @@ public class TrafficLightRenderer implements ErrorStripeRenderer, Disposable {
|
||||
public boolean errorAnalyzingFinished; // all passes done
|
||||
List<ProgressableTextEditorHighlightingPass> passStati = Collections.emptyList();
|
||||
public int[] errorCount = ArrayUtil.EMPTY_INT_ARRAY;
|
||||
public String reasonWhyDisabled;
|
||||
public String reasonWhySuspended;
|
||||
String reasonWhyDisabled;
|
||||
String reasonWhySuspended;
|
||||
|
||||
public DaemonCodeAnalyzerStatus() {
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public class TrafficLightRenderer implements ErrorStripeRenderer, Disposable {
|
||||
status.errorAnalyzingFinished = true;
|
||||
return status;
|
||||
}
|
||||
else if (myFile instanceof PsiCompiledElement) {
|
||||
if (myFile instanceof PsiCompiledElement) {
|
||||
status.reasonWhyDisabled = "File is decompiled";
|
||||
status.errorAnalyzingFinished = true;
|
||||
return status;
|
||||
|
||||
@@ -62,9 +62,6 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static java.awt.event.MouseEvent.MOUSE_MOVED;
|
||||
import static java.awt.event.MouseEvent.MOUSE_PRESSED;
|
||||
|
||||
/**
|
||||
* @author Vladimir Kondratyev
|
||||
* @author Anton Katilin
|
||||
@@ -641,11 +638,11 @@ public class IdeEventQueue extends EventQueue {
|
||||
}
|
||||
else if (e instanceof MouseEvent) {
|
||||
MouseEvent me = (MouseEvent)e;
|
||||
if (me.getID() == MOUSE_PRESSED && me.getModifiers() > 0 && me.getModifiersEx() == 0 ) {
|
||||
if (me.getID() == MouseEvent.MOUSE_PRESSED && me.getModifiers() > 0 && me.getModifiersEx() == 0 ) {
|
||||
// In case of these modifiers java.awt.Container#LightweightDispatcher.processMouseEvent() uses a recent 'active' component
|
||||
// from inner WeakReference (see mouseEventTarget field) even if the component has been already removed from component hierarchy.
|
||||
// So we have to reset this WeakReference with synthetic event just before processing of actual event
|
||||
super.dispatchEvent(new MouseEvent(me.getComponent(), MOUSE_MOVED, me.getWhen(), 0, me.getX(), me.getY(), 0, false, 0));
|
||||
super.dispatchEvent(new MouseEvent(me.getComponent(), MouseEvent.MOUSE_MOVED, me.getWhen(), 0, me.getX(), me.getY(), 0, false, 0));
|
||||
}
|
||||
if (IdeMouseEventDispatcher.patchClickCount(me) && me.getID() == MouseEvent.MOUSE_CLICKED) {
|
||||
final MouseEvent toDispatch =
|
||||
@@ -1256,7 +1253,9 @@ public class IdeEventQueue extends EventQueue {
|
||||
myPostEventListeners.addListener(listener, parentDisposable);
|
||||
}
|
||||
|
||||
private static Ref<Method> unsafeNonBlockingExecuteRef;
|
||||
private static class Holder {
|
||||
private static final Method unsafeNonBlockingExecuteRef = ReflectionUtil.getDeclaredMethod(SunToolkit.class, "unsafeNonblockingExecute", Runnable.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called on the Event Dispatching thread.
|
||||
@@ -1267,13 +1266,10 @@ public class IdeEventQueue extends EventQueue {
|
||||
*/
|
||||
public static void unsafeNonblockingExecute(Runnable r) {
|
||||
assert EventQueue.isDispatchThread();
|
||||
if (unsafeNonBlockingExecuteRef == null) {
|
||||
// The method is available in JBSDK.
|
||||
unsafeNonBlockingExecuteRef = Ref.create(ReflectionUtil.getDeclaredMethod(SunToolkit.class, "unsafeNonblockingExecute", Runnable.class));
|
||||
}
|
||||
if (unsafeNonBlockingExecuteRef.get() != null) {
|
||||
// The method is available in JBSDK.
|
||||
if (Holder.unsafeNonBlockingExecuteRef != null) {
|
||||
try {
|
||||
unsafeNonBlockingExecuteRef.get().invoke(Toolkit.getDefaultToolkit(), r);
|
||||
Holder.unsafeNonBlockingExecuteRef.invoke(Toolkit.getDefaultToolkit(), r);
|
||||
return;
|
||||
}
|
||||
catch (Exception ignore) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public final class IdePopupManager implements IdeEventQueue.EventDispatcher {
|
||||
return myDispatchStack.size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatch(@NotNull final AWTEvent e) {
|
||||
LOG.assertTrue(isPopupActive());
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public class IdeGlassPaneImpl extends JPanel implements IdeGlassPaneEx, IdeEvent
|
||||
super.addNotify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatch(@NotNull final AWTEvent e) {
|
||||
JRootPane eventRootPane = myRootPane;
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
myFilesToDelete.add(moduleFile);
|
||||
return new WriteAction<Module>() {
|
||||
@Override
|
||||
protected void run(@NotNull Result<Module> result) throws Throwable {
|
||||
protected void run(@NotNull Result<Module> result) {
|
||||
VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(moduleFile);
|
||||
assertNotNull(virtualFile);
|
||||
Module module = ModuleManager.getInstance(project).newModule(virtualFile.getPath(), moduleType.getId());
|
||||
@@ -478,15 +478,15 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
// don't use method references here to make stack trace reading easier
|
||||
//noinspection Convert2MethodRef
|
||||
new RunAll()
|
||||
.append(this::disposeRootDisposable)
|
||||
.append(() -> disposeRootDisposable())
|
||||
.append(() -> {
|
||||
if (project != null) {
|
||||
LightPlatformTestCase.doTearDown(project, ourApplication);
|
||||
}
|
||||
})
|
||||
.append(this::disposeProject)
|
||||
.append(() -> disposeProject())
|
||||
.append(() -> UIUtil.dispatchAllInvocationEvents())
|
||||
.append(this::checkForSettingsDamage)
|
||||
.append(() -> checkForSettingsDamage())
|
||||
.append(() -> {
|
||||
if (project != null) {
|
||||
InjectedLanguageManagerImpl.checkInjectorsAreDisposed(project);
|
||||
@@ -518,7 +518,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
myThreadTracker.checkLeak();
|
||||
}
|
||||
})
|
||||
.append(LightPlatformTestCase::checkEditorsReleased)
|
||||
.append(() -> LightPlatformTestCase.checkEditorsReleased())
|
||||
.append(() -> myOldSdks.checkForJdkTableLeaks())
|
||||
.append(() -> myVirtualFilePointerTracker.assertPointersAreDisposed())
|
||||
.append(() -> {
|
||||
|
||||
Reference in New Issue
Block a user