mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -93,6 +93,7 @@ public class VcsLogGraphTable extends JBTable implements DataProvider, CopyProvi
|
||||
@NotNull private final TableCellRenderer myDummyRenderer = new DefaultTableCellRenderer();
|
||||
@NotNull private final GraphCommitCellRender myGraphCommitCellRenderer;
|
||||
private boolean myColumnsSizeInitialized = false;
|
||||
@Nullable private Selection mySelection = null;
|
||||
|
||||
@NotNull private final Collection<VcsLogHighlighter> myHighlighters = ContainerUtil.newArrayList();
|
||||
|
||||
@@ -121,6 +122,8 @@ public class VcsLogGraphTable extends JBTable implements DataProvider, CopyProvi
|
||||
addMouseMotionListener(mouseAdapter);
|
||||
addMouseListener(mouseAdapter);
|
||||
|
||||
getSelectionModel().addListSelectionListener(new MyListSelectionListener());
|
||||
|
||||
PopupHandler.installPopupHandler(this, VcsLogActionPlaces.POPUP_ACTION_GROUP, VcsLogActionPlaces.VCS_LOG_TABLE_PLACE);
|
||||
ScrollingUtil.installActions(this, false);
|
||||
|
||||
@@ -463,7 +466,8 @@ public class VcsLogGraphTable extends JBTable implements DataProvider, CopyProvi
|
||||
|
||||
@NotNull
|
||||
public Selection getSelection() {
|
||||
return new Selection(this);
|
||||
if (mySelection == null) mySelection = new Selection(this);
|
||||
return mySelection;
|
||||
}
|
||||
|
||||
private static class Selection {
|
||||
@@ -917,4 +921,11 @@ public class VcsLogGraphTable extends JBTable implements DataProvider, CopyProvi
|
||||
mouseInputListener.mouseMoved(convertMouseEvent(e));
|
||||
}
|
||||
}
|
||||
|
||||
private class MyListSelectionListener implements ListSelectionListener {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
mySelection = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -99,6 +99,17 @@ public class UnnecessaryBoxingInspection extends BaseInspection {
|
||||
return;
|
||||
}
|
||||
final PsiExpression unboxedExpression = arguments[0];
|
||||
final Object value = ExpressionUtils.computeConstantExpression(unboxedExpression);
|
||||
if (value != null) {
|
||||
if (value == Boolean.TRUE) {
|
||||
PsiReplacementUtil.replaceExpression(expression, "java.lang.Boolean.TRUE");
|
||||
return;
|
||||
}
|
||||
else if (value == Boolean.FALSE) {
|
||||
PsiReplacementUtil.replaceExpression(expression, "java.lang.Boolean.FALSE");
|
||||
return;
|
||||
}
|
||||
}
|
||||
final String replacementText = getUnboxedExpressionText(unboxedExpression, boxedType);
|
||||
if (replacementText == null) {
|
||||
return;
|
||||
|
||||
+6
@@ -56,6 +56,12 @@ public class UnnecessaryBoxingFixTest extends IGQuickFixesTestCase {
|
||||
"Double l = 1d;");
|
||||
}
|
||||
|
||||
public void testBooleanLiteral() {
|
||||
doMemberTest(InspectionGadgetsBundle.message("unnecessary.boxing.remove.quickfix"),
|
||||
"final Boolean aBoolean = Boolean.valueOf(/**/true);",
|
||||
"final Boolean aBoolean = Boolean.TRUE;");
|
||||
}
|
||||
|
||||
public void testCast() {
|
||||
doFixTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user