Merge remote-tracking branch 'origin/master'

This commit is contained in:
Konstantin Bulenkov
2016-04-12 19:24:52 +02:00
46 changed files with 159 additions and 89 deletions
+3 -2
View File
@@ -190,7 +190,7 @@ private String readKotlinClassVersionOfCompiledClasses() {
}
}
private String readKotlinClassFileVersion(InputStream classFileStream) {
private static String readKotlinClassFileVersion(InputStream classFileStream) {
def reader = new ClassReader(classFileStream)
String kotlinBytecodeVersion = null
String kotlinMetaDataVersion = null
@@ -209,7 +209,8 @@ private String readKotlinClassFileVersion(InputStream classFileStream) {
return new AnnotationVisitor(Opcodes.ASM5) {
void visit(String name, Object value) {
if (name == "mv") {
kotlinMetaDataVersion = (value as Integer[]).join(".")
//strip patch number of metadata version because changes in patch updates are forward and backward compatible
kotlinMetaDataVersion = (value as Integer[]).toList().dropRight(1).join(".")
}
else if (name == "bv") {
kotlinBytecodeVersion = (value as Integer[]).join(".")
@@ -18,6 +18,7 @@ package com.intellij.debugger.engine.evaluation;
import com.intellij.codeInsight.completion.CompletionParameters;
import com.intellij.codeInsight.completion.CompletionService;
import com.intellij.codeInsight.completion.JavaCompletionUtil;
import com.intellij.codeInsight.daemon.impl.analysis.HighlightUtil;
import com.intellij.debugger.DebuggerManagerEx;
import com.intellij.debugger.codeinsight.RuntimeTypeEvaluator;
import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilder;
@@ -75,6 +76,7 @@ public class DefaultCodeFragmentFactory extends CodeFragmentFactory {
fragment.setVisibilityChecker(JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE);
//noinspection HardCodedStringLiteral
fragment.putUserData(KEY, "DebuggerComboBoxEditor.IS_DEBUGGER_EDITOR");
fragment.putUserData(HighlightUtil.DISABLE_RETURN_CHECK_IN_CODE_FRAGMENT, true);
fragment.putCopyableUserData(JavaCompletionUtil.DYNAMIC_TYPE_EVALUATOR, new PairFunction<PsiExpression, CompletionParameters, PsiType>() {
public PsiType fun(PsiExpression expression, CompletionParameters parameters) {
if (!RuntimeTypeEvaluator.isSubtypeable(expression)) {
@@ -87,6 +87,8 @@ public class HighlightUtil extends HighlightUtilBase {
@NonNls private static final String SERIAL_PERSISTENT_FIELDS_FIELD_NAME = "serialPersistentFields";
private static final QuickFixFactory QUICK_FIX_FACTORY = QuickFixFactory.getInstance();
public static final Key<Boolean> DISABLE_RETURN_CHECK_IN_CODE_FRAGMENT = Key.create("DISABLE_RETURN_CHECK_IN_CODE_FRAGMENT");
private HighlightUtil() { }
static {
@@ -594,6 +596,9 @@ public class HighlightUtil extends HighlightUtilBase {
}
parent = parent.getParent();
}
if (parent instanceof PsiCodeFragment && parent.getUserData(DISABLE_RETURN_CHECK_IN_CODE_FRAGMENT) != null) {
return null;
}
String description;
HighlightInfo errorResult = null;
if (method == null && lambda != null) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -163,7 +163,8 @@ public abstract class OrderEntryFix implements IntentionAction, LocalQuickFix {
PsiFile fromFile = element.getContainingFile();
List<PsiClass> result = new ArrayList<PsiClass>();
for (PsiClass psiClass : classes) {
if (dependencyValidationManager.getViolatorDependencyRule(fromFile, psiClass.getContainingFile()) == null) {
PsiFile containingFile = psiClass.getContainingFile();
if (containingFile != null && dependencyValidationManager.getViolatorDependencyRule(fromFile, containingFile) == null) {
result.add(psiClass);
}
}
@@ -41,4 +41,5 @@ public interface JavaParameterInfo extends ParameterInfo {
boolean isVarargType();
default void setType(@Nullable PsiType type) {}
}
@@ -124,6 +124,7 @@ public class ParameterInfoImpl implements JavaParameterInfo {
}
}
@Override
public void setType(PsiType type) {
myType = CanonicalTypes.createTypeWrapper(type);
}
@@ -195,7 +195,9 @@ public class PsiDiamondTypeUtil {
final PsiFile fileCopy = (PsiFile)containingFile.copy();
copy = fileCopy.findElementAt(offset);
if (method != null && method.getContainingFile() == containingFile) {
method = PsiTreeUtil.getParentOfType(fileCopy.findElementAt(method.getTextOffset()), PsiMethod.class);
final PsiElement startMethodElementInCopy = fileCopy.findElementAt(method.getTextOffset());
method = PsiTreeUtil.getParentOfType(startMethodElementInCopy, PsiMethod.class);
LOG.assertTrue(method != null, startMethodElementInCopy);
}
}
final PsiCallExpression exprCopy = PsiTreeUtil.getParentOfType(copy, PsiCallExpression.class, false);
@@ -8,6 +8,7 @@ import com.intellij.codeInsight.FileModificationService;
import com.intellij.codeInsight.daemon.impl.quickfix.VariableTypeFix;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.command.undo.UndoUtil;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
@@ -74,7 +75,7 @@ public class TypeMigrationVariableTypeFixProvider implements ChangeVariableTypeQ
final TypeMigrationRules rules = new TypeMigrationRules();
rules.setBoundScope(GlobalSearchScope.projectScope(project));
TypeMigrationProcessor.runHighlightingTypeMigration(project, editor, rules, variable, targetType, optimizeImports);
JavaCodeStyleManager.getInstance(project).shortenClassReferences(variable);
WriteAction.run(() -> JavaCodeStyleManager.getInstance(project).shortenClassReferences(variable));
UndoUtil.markPsiFileForUndo(variable.getContainingFile());
}
catch (IncorrectOperationException e) {
BIN
View File
Binary file not shown.
Binary file not shown.
@@ -67,7 +67,7 @@ public class ProblemDescriptorBase extends CommonProblemDescriptorImpl implement
LOG.assertTrue(endElementRange != null, endElement);
if (startElementRange.getStartOffset() >= endElementRange.getEndOffset()) {
if (!(startElement instanceof PsiFile && endElement instanceof PsiFile)) {
LOG.error("Empty PSI elements should not be passed to createDescriptor. Start: " + startElement + ", end: " + endElement);
LOG.error("Empty PSI elements should not be passed to createDescriptor. Start: " + startElement + ", end: " + endElement + ", startContainingFile: " + startContainingFile);
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

@@ -121,9 +121,9 @@ public abstract class MoveDirectoryWithClassesHelper {
}
private static class MyUsageInfo extends UsageInfo {
private final PsiFileSystemItem myFile;
private final @NotNull PsiFileSystemItem myFile;
public MyUsageInfo(@NotNull PsiReference reference, PsiFileSystemItem file) {
public MyUsageInfo(@NotNull PsiReference reference, @NotNull PsiFileSystemItem file) {
super(reference);
myFile = file;
}
@@ -23,16 +23,18 @@ import com.intellij.notification.EventLog;
import com.intellij.notification.LogModel;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.impl.ui.NotificationsUtil;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.CustomStatusBarWidget;
import com.intellij.openapi.wm.IconLikeCustomStatusBarWidget;
import com.intellij.openapi.wm.StatusBar;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.ui.ClickListener;
import com.intellij.ui.JBColor;
import com.intellij.ui.LayeredIcon;
import com.intellij.ui.SimpleColoredComponent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -125,15 +127,17 @@ public class IdeNotificationArea extends JLabel implements CustomStatusBarWidget
}
private LayeredIcon createIconWithNotificationCount(ArrayList<Notification> notifications) {
return createIconWithNotificationCount(this, getMaximumType(notifications), notifications.size());
}
@NotNull
public static LayeredIcon createIconWithNotificationCount(JComponent component, NotificationType type, int size) {
LayeredIcon icon = new LayeredIcon(2);
NotificationType type = getMaximumType(notifications);
Icon statusIcon = getPendingNotificationsIcon(AllIcons.Ide.Notification.NoEvents, type);
icon.setIcon(statusIcon, 0);
int size = notifications.size();
icon.setIcon(getPendingNotificationsIcon(AllIcons.Ide.Notification.NoEvents, type), 0);
if (size > 0) {
//noinspection UseJBColor
Color textColor = type == NotificationType.ERROR ? Color.white : Color.black;
icon.setIcon(new TextIcon(this, size < 10 ? String.valueOf(size) : "9+", textColor), 1);
Color textColor = type == NotificationType.ERROR ? new JBColor(Color.white, new Color(0xF2F2F2)) : new Color(0x333333);
icon.setIcon(new TextIcon(component, size < 10 ? String.valueOf(size) : "9+", textColor), 1);
}
return icon;
}
@@ -181,12 +185,14 @@ public class IdeNotificationArea extends JLabel implements CustomStatusBarWidget
private final JComponent myComponent;
private final Color myTextColor;
private final int myWidth;
private final Font myFont;
public TextIcon(JComponent component, @NotNull String str, @NotNull Color textColor) {
myStr = str;
myComponent = component;
myTextColor = textColor;
myWidth = myComponent.getFontMetrics(calcFont()).stringWidth(myStr);
myFont = new Font(NotificationsUtil.getFontName(), Font.BOLD, 9);
myWidth = myComponent.getFontMetrics(myFont).stringWidth(myStr) + 1;
}
@Override
@@ -217,13 +223,10 @@ public class IdeNotificationArea extends JLabel implements CustomStatusBarWidget
Font originalFont = g.getFont();
Color originalColor = g.getColor();
g.setFont(calcFont());
g.setFont(myFont);
x += (getIconWidth() - myWidth) / 2;
y += getIconHeight() / 2 + g.getFontMetrics().getDescent();
if (!SystemInfo.isLinux && myStr.length() > 1) {
x++;
}
y += SimpleColoredComponent.getTextBaseLine(g.getFontMetrics(), getIconHeight());
g.setColor(myTextColor);
g.drawString(myStr, x, y);
@@ -232,14 +235,6 @@ public class IdeNotificationArea extends JLabel implements CustomStatusBarWidget
g.setColor(originalColor);
}
private Font calcFont() {
float size = (float)getIconHeight() * 3 / 5;
if (myStr.length() > 1) {
size--;
}
return myComponent.getFont().deriveFont(size);
}
@Override
public int getIconWidth() {
return AllIcons.Ide.Notification.NoEvents.getIconWidth();
@@ -175,6 +175,9 @@ public class NotificationTestAction extends AnAction implements DumbAware {
notification.setActions(StringUtil.split(value, ","));
}
}
else if (line.startsWith("Type:")) {
notification.setType(StringUtil.substringAfter(line, ":"));
}
else if (line.startsWith("Sticky:")) {
notification.setSticky("true".equals(StringUtil.substringAfter(line, ":")));
}
@@ -200,6 +203,7 @@ public class NotificationTestAction extends AnAction implements DumbAware {
private String mySubtitle;
private List<String> myContent;
private List<String> myActions;
private NotificationType myType = NotificationType.INFORMATION;
private boolean mySticky;
private boolean myAddListener;
@@ -218,10 +222,10 @@ public class NotificationTestAction extends AnAction implements DumbAware {
String content = myContent == null ? "" : StringUtil.join(myContent, "\n");
if (icon == null) {
myNotification =
new Notification(displayId, StringUtil.notNullize(myTitle), content, NotificationType.INFORMATION, getListener());
new Notification(displayId, StringUtil.notNullize(myTitle), content, myType, getListener());
}
else {
myNotification = new Notification(displayId, icon, myTitle, mySubtitle, content, NotificationType.INFORMATION, getListener());
myNotification = new Notification(displayId, icon, myTitle, mySubtitle, content, myType, getListener());
if (myActions != null) {
for (String action : myActions) {
myNotification.addAction(new MyAnAction(action));
@@ -268,6 +272,18 @@ public class NotificationTestAction extends AnAction implements DumbAware {
mySticky = sticky;
}
public void setType(@Nullable String type) {
if ("info".equals(type)) {
myType = NotificationType.INFORMATION;
}
else if ("error".equals(type)) {
myType = NotificationType.ERROR;
}
else if ("warn".equals(type)) {
myType = NotificationType.WARNING;
}
}
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (MessageDialogBuilder.yesNo("Notification Listener", event.getDescription() + " Expire?").is()) {
@@ -124,18 +124,18 @@ public class NotificationsUtil {
@Nullable
public static String getFontStyle() {
String fontName = null;
String fontName = getFontName();
return StringUtil.isEmpty(fontName) ? null : "font-family:" + fontName + ";";
}
@Nullable
public static String getFontName() {
UISettings uiSettings = UISettings.getInstance();
if (uiSettings.OVERRIDE_NONIDEA_LAF_FONTS) {
fontName = uiSettings.FONT_FACE;
return uiSettings.FONT_FACE;
}
else {
Pair<String, Integer> systemFontData = UIUtil.getSystemFontData();
if (systemFontData != null) {
fontName = systemFontData.first;
}
}
return StringUtil.isEmpty(fontName) ? null : "font-family:" + fontName + ";";
Pair<String, Integer> systemFontData = UIUtil.getSystemFontData();
return systemFontData == null ? null : systemFontData.first;
}
@Nullable
@@ -1080,7 +1080,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
* @param fontSize new font size
* @param zoomCenter zoom point, relative to viewport
*/
private void setFontSize(final int fontSize, @Nullable Point zoomCenter) {
private void setFontSize(int fontSize, @Nullable Point zoomCenter) {
int oldFontSize = myScheme.getEditorFontSize();
Rectangle visibleArea = myScrollingModel.getVisibleArea();
@@ -1091,6 +1091,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
int intraLineOffset = zoomCenterAbsolute.y % oldLineHeight;
myScheme.setEditorFontSize(fontSize);
fontSize = myScheme.getEditorFontSize(); // resulting font size might be different due to applied min/max limits
myPropertyChangeSupport.firePropertyChange(PROP_FONT_SIZE, oldFontSize, fontSize);
// Update vertical scroll bar bounds if necessary (we had a problem that use increased editor font size and it was not possible
// to scroll to the bottom of the document).
@@ -18,6 +18,7 @@ package com.intellij.openapi.wm.impl;
import com.intellij.ide.UiActivity;
import com.intellij.ide.UiActivityMonitor;
import com.intellij.ide.impl.ContentManagerWatcher;
import com.intellij.notification.EventLog;
import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.application.ApplicationManager;
@@ -393,8 +394,10 @@ public final class ToolWindowImpl implements ToolWindowEx {
public final void setIcon(final Icon icon) {
ApplicationManager.getApplication().assertIsDispatchThread();
final Icon oldIcon = getIcon();
if (oldIcon != icon && icon != null && !(icon instanceof LayeredIcon) && (icon.getIconHeight() != JBUI.scale(13) || icon.getIconWidth() != JBUI.scale(13))) {
LOG.warn("ToolWindow icons should be 13x13. Please fix ToolWindow (ID: " + getId() + ") or icon " + icon);
if (!EventLog.LOG_TOOL_WINDOW_ID.equals(getId())) {
if (oldIcon != icon && icon != null && !(icon instanceof LayeredIcon) && (icon.getIconHeight() != JBUI.scale(13) || icon.getIconWidth() != JBUI.scale(13))) {
LOG.warn("ToolWindow icons should be 13x13. Please fix ToolWindow (ID: " + getId() + ") or icon " + icon);
}
}
//getSelectedContent().setIcon(icon);
myIcon = icon;
@@ -36,29 +36,4 @@ public class PtyCommandLineTest extends GeneralCommandLineTest {
return cmd;
}
@Override
public void unicodePath() {
assumeFalse(SystemInfo.isWindows);
}
@Override
public void unicodeClassPath() {
assumeFalse(SystemInfo.isWindows);
}
@Override
public void passingArgumentsToJavaApp() {
assumeFalse(SystemInfo.isWindows);
}
@Override
public void passingArgumentsToJavaAppThroughWinShell() {
assumeFalse(SystemInfo.isWindows);
}
@Override
public void passingArgumentsToJavaAppThroughCmdScriptAndWinShell() {
assumeFalse(SystemInfo.isWindows);
}
}
@@ -34,7 +34,7 @@ public abstract class VariablesHost<VALUE_MANAGER extends ValueManager> {
@NotNull
@Override
public Promise<List<Variable>> load(@NotNull VariablesHost host) {
public Promise load(@NotNull VariablesHost host) {
return host.valueManager.isObsolete() ? ValueManager.Companion.reject() : host.load();
}
};
@@ -579,6 +579,16 @@ public class StringUtil extends StringUtilRt {
@Nullable String additionalChars,
boolean escapeSlash,
@NotNull @NonNls StringBuilder buffer) {
return escapeStringCharacters(length, str, additionalChars, escapeSlash, true, buffer);
}
@NotNull
public static StringBuilder escapeStringCharacters(int length,
@NotNull String str,
@Nullable String additionalChars,
boolean escapeSlash,
boolean escapeUnicode,
@NotNull @NonNls StringBuilder buffer) {
char prev = 0;
for (int idx = 0; idx < length; idx++) {
char ch = str.charAt(idx);
@@ -610,7 +620,7 @@ public class StringUtil extends StringUtilRt {
else if (additionalChars != null && additionalChars.indexOf(ch) > -1 && (escapeSlash || prev != '\\')) {
buffer.append("\\").append(ch);
}
else if (!isPrintableUnicode(ch)) {
else if (escapeUnicode && !isPrintableUnicode(ch)) {
CharSequence hexCode = StringUtilRt.toUpperCase(Integer.toHexString(ch));
buffer.append("\\u");
int paddingCount = 4 - hexCode.length();
@@ -55,7 +55,7 @@ import com.intellij.vcs.log.ui.VcsLogColorManager;
import com.intellij.vcs.log.ui.VcsLogColorManagerImpl;
import com.intellij.vcs.log.ui.VcsLogUiImpl;
import com.intellij.vcs.log.ui.render.GraphCommitCell;
import com.intellij.vcs.log.ui.render.GraphCommitCellRender;
import com.intellij.vcs.log.ui.render.GraphCommitCellRenderer;
import com.intellij.vcs.log.ui.tables.GraphTableModel;
import com.intellij.vcs.log.util.VcsUserUtil;
import gnu.trove.TIntHashSet;
@@ -92,7 +92,7 @@ public class VcsLogGraphTable extends JBTable implements DataProvider, CopyProvi
@NotNull private final VcsLogDataManager myLogDataManager;
@NotNull private final MyDummyTableCellEditor myDummyEditor = new MyDummyTableCellEditor();
@NotNull private final TableCellRenderer myDummyRenderer = new DefaultTableCellRenderer();
@NotNull private final GraphCommitCellRender myGraphCommitCellRenderer;
@NotNull private final GraphCommitCellRenderer myGraphCommitCellRenderer;
private boolean myColumnsSizeInitialized = false;
@Nullable private Selection mySelection = null;
@@ -109,7 +109,7 @@ public class VcsLogGraphTable extends JBTable implements DataProvider, CopyProvi
super(new GraphTableModel(initialDataPack, logDataManager, ui));
myUi = ui;
myLogDataManager = logDataManager;
myGraphCommitCellRenderer = new GraphCommitCellRender(logDataManager, myGraphCellPainter, this);
myGraphCommitCellRenderer = new GraphCommitCellRenderer(logDataManager, myGraphCellPainter, this);
setDefaultRenderer(VirtualFile.class, new RootCellRenderer(myUi));
setDefaultRenderer(GraphCommitCell.class, myGraphCommitCellRenderer);
@@ -24,9 +24,9 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
public class GraphCommitCellRender extends ColoredTableCellRenderer {
public class GraphCommitCellRenderer extends ColoredTableCellRenderer {
private static final Logger LOG = Logger.getInstance(GraphCommitCellRender.class);
private static final Logger LOG = Logger.getInstance(GraphCommitCellRenderer.class);
@NotNull private final VcsLogDataManager myDataManager;
@NotNull private final GraphCellPainter myPainter;
@@ -39,9 +39,9 @@ public class GraphCommitCellRender extends ColoredTableCellRenderer {
@NotNull private Font myFont;
private int myHeight;
public GraphCommitCellRender(@NotNull VcsLogDataManager dataManager,
@NotNull GraphCellPainter painter,
@NotNull VcsLogGraphTable table) {
public GraphCommitCellRenderer(@NotNull VcsLogDataManager dataManager,
@NotNull GraphCellPainter painter,
@NotNull VcsLogGraphTable table) {
myDataManager = dataManager;
myPainter = painter;
myGraphTable = table;
@@ -133,11 +133,11 @@ public class XBreakpointUtil {
* - if folded, checks if line breakpoints could be toggled inside folded text
*/
@NotNull
public static Promise<XLineBreakpoint> toggleLineBreakpoint(@NotNull Project project,
@NotNull XSourcePosition position,
@Nullable Editor editor,
boolean temporary,
boolean moveCarret) {
public static Promise toggleLineBreakpoint(@NotNull Project project,
@NotNull XSourcePosition position,
@Nullable Editor editor,
boolean temporary,
boolean moveCarret) {
int lineStart = position.getLine();
VirtualFile file = position.getFile();
// for folded text check each line and find out type with the biggest priority
@@ -52,10 +52,12 @@ import com.intellij.util.ui.update.Update;
import com.intellij.xdebugger.XDebuggerManager;
import com.intellij.xdebugger.breakpoints.SuspendPolicy;
import com.intellij.xdebugger.breakpoints.XBreakpoint;
import com.intellij.xdebugger.breakpoints.XLineBreakpoint;
import com.intellij.xdebugger.impl.XSourcePositionImpl;
import com.intellij.xdebugger.impl.ui.DebuggerUIUtil;
import gnu.trove.TIntHashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.concurrency.Promise;
import java.awt.event.MouseEvent;
import java.util.Collection;
@@ -280,8 +282,8 @@ public class XLineBreakpointManager {
if (line >= 0 && line < document.getLineCount() && file != null) {
ActionManagerEx.getInstanceEx().fireBeforeActionPerformed(IdeActions.ACTION_TOGGLE_LINE_BREAKPOINT, e.getMouseEvent());
XBreakpointUtil
.toggleLineBreakpoint(myProject, XSourcePositionImpl.create(file, line), editor, mouseEvent.isAltDown(), false)
final Promise<XLineBreakpoint> lineBreakpoint = XBreakpointUtil.toggleLineBreakpoint(myProject, XSourcePositionImpl.create(file, line), editor, mouseEvent.isAltDown(), false);
lineBreakpoint
.done(breakpoint -> {
if (!mouseEvent.isAltDown() && mouseEvent.isShiftDown() && breakpoint != null) {
breakpoint.setSuspendPolicy(SuspendPolicy.NONE);
@@ -150,7 +150,7 @@ public class MethodCallUtils {
}
public static boolean isCallDuringObjectConstruction(PsiMethodCallExpression expression) {
final PsiMember member = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, PsiClassInitializer.class, PsiField.class);
final PsiMember member = PsiTreeUtil.getParentOfType(expression, PsiMember.class, true, PsiClass.class, PsiLambdaExpression.class);
if (member == null) {
return false;
}
@@ -0,0 +1,13 @@
abstract class A {
public A() {
Runnable r = () -> foo();
Runnable r1 = new Runnable() {
public void run() {
foo();
}
};
}
abstract void foo();
}
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.siyeh.ig.initialization;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
public class AbstractMethodCallInConstructorInspectionTest extends LightInspectionTestCase {
public void testAbstractMethodCallInConstructor() {
doTest();
}
@Override
protected InspectionProfileEntry getInspection() {
return new AbstractMethodCallInConstructorInspection();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ import com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutorCallback;
import com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler;
import com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation;
import com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate;
import com.intellij.cvsSupport2.history.CvsRevisionNumber;
import com.intellij.openapi.cvsIntegration.CvsResult;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
@@ -65,6 +66,7 @@ public class CvsContentRevision implements ByteBackedContentRevision {
myProject = project;
}
@Override
@Nullable
public String getContent() throws VcsException {
byte[] content = getContentAsBytes();
@@ -96,14 +98,20 @@ public class CvsContentRevision implements ByteBackedContentRevision {
return myContent;
}
@Override
@NotNull
public FilePath getFile() {
return myLocalFile;
}
@Override
@NotNull
public VcsRevisionNumber getRevisionNumber() {
return myRevision.getCvsRevisionNumber();
final CvsRevisionNumber cvsRevisionNumber = myRevision.getCvsRevisionNumber();
if (cvsRevisionNumber == null) {
return VcsRevisionNumber.NULL;
}
return cvsRevisionNumber;
}
@Override @NonNls
@@ -155,6 +155,7 @@ public class GrParameterInfo implements JavaParameterInfo {
myName = newName;
}
@Override
public void setType(@Nullable PsiType type) {
myTypeWrapper = type == null ? null : CanonicalTypes.createTypeWrapper(type);
}
@@ -223,6 +223,7 @@ orderEntry.fix.add.library.to.classpath=Add library ''{0}'' to classpath
orderEntry.fix.family.add.library.to.classpath=Add library to classpath
orderEntry.fix.circular.dependency.warning=Adding dependency on module ''{0}'' will introduce circular dependency between modules ''{1}'' and ''{2}''.\nAdd dependency anyway?
orderEntry.fix.title.circular.dependency.warning=Circular Dependency Warning
orderEntry.fix.add.junit.jar.to.classpath=Add JUnit to classpath
static.import.method.text=Static import method
static.import.method.choose.method.to.import=Choose Method to Import