mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -25,6 +25,7 @@ import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.IdeEventQueue;
|
||||
import com.intellij.ide.actions.CopyReferenceAction;
|
||||
import com.intellij.ide.actions.GotoFileAction;
|
||||
import com.intellij.ide.actions.WindowAction;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder;
|
||||
import com.intellij.ide.ui.laf.darcula.ui.DarculaTextFieldUI;
|
||||
@@ -62,6 +63,7 @@ import com.intellij.psi.statistics.StatisticsManager;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.popup.AbstractPopup;
|
||||
import com.intellij.ui.popup.PopupOwner;
|
||||
import com.intellij.ui.popup.PopupPositionManager;
|
||||
import com.intellij.ui.popup.PopupUpdateProcessor;
|
||||
@@ -887,6 +889,12 @@ public abstract class ChooseByNameBase {
|
||||
}
|
||||
});
|
||||
myTextPopup.show(layeredPane);
|
||||
if (myTextPopup instanceof AbstractPopup) {
|
||||
Window window = ((AbstractPopup)myTextPopup).getPopupWindow();
|
||||
if (window instanceof JDialog) {
|
||||
((JDialog)window).getRootPane().putClientProperty(WindowAction.NO_WINDOW_ACTIONS, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private JLayeredPane getLayeredPane() {
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class ChangeBrowserSettings implements JDOMExternalizable {
|
||||
|
||||
@Nullable
|
||||
private static Date parseDate(@Nullable String dateStr) {
|
||||
if (dateStr == null) return null;
|
||||
if (dateStr == null || dateStr.isEmpty()) return null;
|
||||
try {
|
||||
return DATE_FORMAT.parse(dateStr);
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2011 Bas Leijdekkers
|
||||
* Copyright 2008-2014 Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.util.InheritanceUtil;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.Query;
|
||||
import com.siyeh.InspectionGadgetsBundle;
|
||||
import com.siyeh.ig.BaseInspection;
|
||||
@@ -57,11 +58,10 @@ public class ThrowableResultOfMethodCallIgnoredInspection
|
||||
extends BaseInspectionVisitor {
|
||||
|
||||
@Override
|
||||
public void visitMethodCallExpression(
|
||||
PsiMethodCallExpression expression) {
|
||||
public void visitMethodCallExpression(PsiMethodCallExpression expression) {
|
||||
super.visitMethodCallExpression(expression);
|
||||
PsiElement parent = expression.getParent();
|
||||
while (parent instanceof PsiParenthesizedExpression) {
|
||||
while (parent instanceof PsiParenthesizedExpression || parent instanceof PsiTypeCastExpression) {
|
||||
parent = parent.getParent();
|
||||
}
|
||||
if (parent instanceof PsiReturnStatement ||
|
||||
|
||||
+9
-1
@@ -5,7 +5,7 @@ package com.siyeh.igtest.bugs.throwable_result_of_method_call_ignored;
|
||||
public class A {
|
||||
public static void test() {
|
||||
try {
|
||||
firstNonNull(new Throwable(), null);
|
||||
<warning descr="Result of 'firstNonNull()' not thrown">firstNonNull</warning>(new Throwable(), null);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(firstNonNull(e.getCause(), e));
|
||||
@@ -15,4 +15,12 @@ public class A {
|
||||
public static <T> T firstNonNull(T first, T second) {
|
||||
return first != null ? first : second;
|
||||
}
|
||||
|
||||
void m() {
|
||||
throw (RuntimeException) b();
|
||||
}
|
||||
|
||||
public Exception b() {
|
||||
return new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>A.java</file>
|
||||
<line>8</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Throwable result of method call ignored</problem_class>
|
||||
<description>Result of <code>firstNonNull()</code> not thrown #loc</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+10
-5
@@ -1,12 +1,17 @@
|
||||
package com.siyeh.ig.bugs;
|
||||
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.siyeh.ig.IGInspectionTestCase;
|
||||
import com.siyeh.ig.LightInspectionTestCase;
|
||||
|
||||
public class ThrowableResultOfMethodCallIgnoredInspectionTest
|
||||
extends IGInspectionTestCase {
|
||||
public class ThrowableResultOfMethodCallIgnoredInspectionTest extends LightInspectionTestCase {
|
||||
|
||||
public void test() throws Exception {
|
||||
doTest("com/siyeh/igtest/bugs/throwable_result_of_method_call_ignored",
|
||||
new ThrowableResultOfMethodCallIgnoredInspection());
|
||||
public void testA() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InspectionProfileEntry getInspection() {
|
||||
return new ThrowableResultOfMethodCallIgnoredInspection();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user