diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form index ca990638b60b..8af7bb90b418 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form @@ -174,27 +174,21 @@ - + + + - + - - - - - - - - - + @@ -213,19 +207,46 @@ + + + + + + + + - + + - + - + + + + + + + + + + + + + + + + + + + - + @@ -239,7 +260,7 @@ - + @@ -284,7 +305,7 @@ - + @@ -329,7 +350,7 @@ - + @@ -375,61 +396,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java index 9216cc0701e1..74ef39612149 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java @@ -42,6 +42,7 @@ import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElement; import com.intellij.ui.FieldPanel; import com.intellij.ui.MultiLineTooltipUI; +import com.intellij.ui.components.JBCheckBox; import com.intellij.xdebugger.impl.ui.DebuggerUIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -71,7 +72,6 @@ public abstract class BreakpointPropertiesPanel { private JCheckBox myLogExpressionCheckBox; private JCheckBox myLogMessageCheckBox; protected JCheckBox myPassCountCheckbox; - private JCheckBox myConditionCheckbox; private JCheckBox myInstanceFiltersCheckBox; private JCheckBox myClassFiltersCheckBox; @@ -84,21 +84,19 @@ public abstract class BreakpointPropertiesPanel { private PsiClass myBreakpointPsiClass; private JRadioButton mySuspendThreadRadio; - private JRadioButton mySuspendNoneRadio; private JRadioButton mySuspendAllRadio; - private JRadioButton myDisableAgainRadio; - private JRadioButton myLeaveEnabledRadioButton; - private JLabel myEnableOrDisableLabel; + private JBCheckBox mySuspendJBCheckBox; private JButton myMakeDefaultButton; + private JRadioButton myDisableAgainRadio; + private JRadioButton myLeaveEnabledRadioButton; + + private JLabel myEnableOrDisableLabel; private JPanel myDependsOnPanel; private JPanel myInstanceFiltersPanel; private JPanel myClassFiltersPanel; private JPanel myPassCountPanel; private JPanel myConditionsPanel; - private JPanel myConditionPanel; - private JPanel myCompactConditionsPanel; - private JPanel myConditionPlaceholder; private JPanel myActionsPanel; ButtonGroup mySuspendPolicyGroup; @@ -146,14 +144,8 @@ public abstract class BreakpointPropertiesPanel { myMoreOptionsVisible = b; myDependsOnPanel.setVisible(b); myConditionsPanel.setVisible(b); - if (!b) { - myConditionPlaceholder.remove(myConditionPanel); - myCompactConditionsPanel.add(myConditionPanel, BorderLayout.CENTER); - } - else { + if (b) { myActionsPanel.setVisible(true); - myCompactConditionsPanel.remove(myConditionPanel); - myConditionPlaceholder.add(myConditionPanel, BorderLayout.CENTER); } } @@ -195,8 +187,7 @@ public abstract class BreakpointPropertiesPanel { mySuspendPolicyGroup = new ButtonGroup(); mySuspendPolicyGroup.add(mySuspendAllRadio); mySuspendPolicyGroup.add(mySuspendThreadRadio); - mySuspendPolicyGroup.add(mySuspendNoneRadio); - + updateSuspendPolicyRbFont(); final ItemListener suspendPolicyChangeListener = new ItemListener() { public void itemStateChanged(final ItemEvent e) { @@ -207,8 +198,16 @@ public abstract class BreakpointPropertiesPanel { } } }; + + mySuspendJBCheckBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent event) { + mySuspendAllRadio.setEnabled(mySuspendJBCheckBox.isSelected()); + mySuspendThreadRadio.setEnabled(mySuspendJBCheckBox.isSelected()); + } + }); + mySuspendAllRadio.addItemListener(suspendPolicyChangeListener); - mySuspendNoneRadio.addItemListener(suspendPolicyChangeListener); mySuspendThreadRadio.addItemListener(suspendPolicyChangeListener); myMakeDefaultButton.addActionListener(new ActionListener() { @@ -220,9 +219,6 @@ public abstract class BreakpointPropertiesPanel { if (DebuggerSettings.SUSPEND_THREAD.equals(suspendPolicy)) { mySuspendThreadRadio.requestFocus(); } - else if (DebuggerSettings.SUSPEND_NONE.equals(suspendPolicy)) { - mySuspendNoneRadio.requestFocus(); - } else { mySuspendAllRadio.requestFocus(); } @@ -312,23 +308,21 @@ public abstract class BreakpointPropertiesPanel { } }; myPassCountCheckbox.addActionListener(listener); - myConditionCheckbox.addActionListener(listener); myInstanceFiltersCheckBox.addActionListener(listener); myClassFiltersCheckBox.addActionListener(listener); DebuggerUIUtil.focusEditorOnCheck(myPassCountCheckbox, myPassCountField); - DebuggerUIUtil.focusEditorOnCheck(myConditionCheckbox, myConditionCombo); DebuggerUIUtil.focusEditorOnCheck(myLogExpressionCheckBox, myLogExpressionCombo); DebuggerUIUtil.focusEditorOnCheck(myInstanceFiltersCheckBox, myInstanceFiltersField.getTextField()); DebuggerUIUtil.focusEditorOnCheck(myClassFiltersCheckBox, myClassFiltersField.getTextField()); } private String getSelectedSuspendPolicy() { + if (!mySuspendJBCheckBox.isSelected()) { + return DebuggerSettings.SUSPEND_NONE; + } if (mySuspendThreadRadio.isSelected()) { return DebuggerSettings.SUSPEND_THREAD; } - if (mySuspendNoneRadio.isSelected()) { - return DebuggerSettings.SUSPEND_NONE; - } return DebuggerSettings.SUSPEND_ALL; } @@ -340,7 +334,6 @@ public abstract class BreakpointPropertiesPanel { mySuspendAllRadio.setFont(DebuggerSettings.SUSPEND_ALL.equals(defPolicy)? boldFont : font); mySuspendThreadRadio.setFont(DebuggerSettings.SUSPEND_THREAD.equals(defPolicy)? boldFont : font); - mySuspendNoneRadio.setFont(DebuggerSettings.SUSPEND_NONE.equals(defPolicy)? boldFont : font); } protected ClassFilter createClassConditionFilter() { @@ -379,10 +372,19 @@ public abstract class BreakpointPropertiesPanel { PsiElement context = breakpoint.getEvaluationElement(); myPassCountCheckbox.setSelected(breakpoint.COUNT_FILTER_ENABLED); - myConditionCheckbox.setSelected(breakpoint.CONDITION_ENABLED); + if (!breakpoint.CONDITION_ENABLED) { + myConditionCombo.setText(emptyText()); + } + else { + myConditionCombo.setContext(context); + myConditionCombo.setText(breakpoint.getCondition() != null ? breakpoint.getCondition() : emptyText()); + } + + mySuspendJBCheckBox.setSelected(!breakpoint.SUSPEND_POLICY.equals(DebuggerSettings.SUSPEND_NONE)); + mySuspendThreadRadio.setEnabled(mySuspendJBCheckBox.isSelected()); + mySuspendAllRadio.setEnabled(mySuspendJBCheckBox.isSelected()); if(DebuggerSettings.SUSPEND_NONE.equals(breakpoint.SUSPEND_POLICY)) { - mySuspendPolicyGroup.setSelected(mySuspendNoneRadio.getModel(), true); actionsPanelVisible = true; } else if(DebuggerSettings.SUSPEND_THREAD.equals(breakpoint.SUSPEND_POLICY)){ @@ -391,16 +393,19 @@ public abstract class BreakpointPropertiesPanel { else { mySuspendPolicyGroup.setSelected(mySuspendAllRadio.getModel(), true); } - mySuspendNoneRadio.addActionListener(new ActionListener() { + + mySuspendJBCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { if (!myActionsPanel.isVisible()) { - if (mySuspendNoneRadio.isSelected()) { + if (!mySuspendJBCheckBox.isSelected()) { if (myDelegate != null) { myDelegate.showActionsPanel(); } } } + mySuspendThreadRadio.setEnabled(mySuspendJBCheckBox.isSelected()); + mySuspendAllRadio.setEnabled(mySuspendJBCheckBox.isSelected()); } }); myLogMessageCheckBox.setSelected(breakpoint.LOG_ENABLED); @@ -409,16 +414,13 @@ public abstract class BreakpointPropertiesPanel { actionsPanelVisible = true; } - myConditionCombo.setContext(context); - myConditionCombo.setText(breakpoint.getCondition() != null ? breakpoint.getCondition() : new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, "")); - myLogExpressionCombo.setContext(context); if (breakpoint.getLogMessage() != null) { myLogExpressionCombo.setText(breakpoint.getLogMessage()); } else { - myLogExpressionCombo.setText(new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, "")); + myLogExpressionCombo.setText(emptyText()); } myLogExpressionCombo.setEnabled(breakpoint.LOG_EXPRESSION_ENABLED); @@ -453,6 +455,10 @@ public abstract class BreakpointPropertiesPanel { setMoreOptionsVisible(moreOptionsVisible); } + private TextWithImportsImpl emptyText() { + return new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, ""); + } + /** * Save values in the UI components to the breakpoint object */ @@ -470,7 +476,7 @@ public abstract class BreakpointPropertiesPanel { } breakpoint.COUNT_FILTER_ENABLED = breakpoint.COUNT_FILTER > 0 && myPassCountCheckbox.isSelected(); breakpoint.setCondition(myConditionCombo.getText()); - breakpoint.CONDITION_ENABLED = !breakpoint.getCondition().isEmpty() && myConditionCheckbox.isSelected(); + breakpoint.CONDITION_ENABLED = !breakpoint.getCondition().isEmpty(); breakpoint.setLogMessage(myLogExpressionCombo.getText()); breakpoint.LOG_EXPRESSION_ENABLED = !breakpoint.getLogMessage().isEmpty() && myLogExpressionCheckBox.isSelected(); breakpoint.LOG_ENABLED = myLogMessageCheckBox.isSelected(); @@ -616,7 +622,7 @@ public abstract class BreakpointPropertiesPanel { } protected void updateCheckboxes() { - JCheckBox [] checkBoxes = { myConditionCheckbox, myInstanceFiltersCheckBox, myClassFiltersCheckBox }; + JCheckBox [] checkBoxes = {myInstanceFiltersCheckBox, myClassFiltersCheckBox }; JCheckBox selected = null; for (JCheckBox checkBoxe : checkBoxes) { if (checkBoxe.isSelected()) { @@ -624,8 +630,7 @@ public abstract class BreakpointPropertiesPanel { break; } } - - if(selected != null){ + if(selected != null || !myConditionCombo.getText().isEmpty()){ myPassCountCheckbox.setEnabled(false); } else { myPassCountCheckbox.setEnabled(true); @@ -637,8 +642,8 @@ public abstract class BreakpointPropertiesPanel { myPassCountField.setEditable(myPassCountCheckbox.isSelected()); myPassCountField.setEnabled (myPassCountCheckbox.isSelected()); - myConditionCombo.setEnabled(myConditionCheckbox.isSelected()); - myConditionMagnifierButton.setEnabled(myConditionCheckbox.isSelected()); + myConditionCombo.setEnabled(true); + myConditionMagnifierButton.setEnabled(true); myInstanceFiltersField.setEnabled(myInstanceFiltersCheckBox.isSelected()); myInstanceFiltersField.getTextField().setEditable(myInstanceFiltersCheckBox.isSelected()); myClassFiltersField.setEnabled(myClassFiltersCheckBox.isSelected()); diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java index 25402c9020f7..9186a5ba227c 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java @@ -507,7 +507,8 @@ public class GenericsHighlightUtil { } else if (superMethod.isConstructor()) return null; - if (checkMethod.hasModifierProperty(PsiModifier.STATIC) && !checkEqualsSuper) { + final boolean atLeast17 = JavaVersionService.getInstance().isAtLeast(checkMethod, JavaSdkVersion.JDK_1_7); + if (checkMethod.hasModifierProperty(PsiModifier.STATIC) && !checkEqualsSuper && !atLeast17) { return null; } @@ -515,7 +516,6 @@ public class GenericsHighlightUtil { final PsiType retErasure2 = TypeConversionUtil.erasure(superMethod.getReturnType()); boolean differentReturnTypeErasure = !Comparing.equal(retErasure1, retErasure2); - final boolean atLeast17 = JavaVersionService.getInstance().isAtLeast(checkMethod, JavaSdkVersion.JDK_1_7); if (checkEqualsSuper && atLeast17) { if (retErasure1 != null && retErasure2 != null) { differentReturnTypeErasure = !TypeConversionUtil.isAssignable(retErasure1, retErasure2); @@ -555,7 +555,10 @@ public class GenericsHighlightUtil { private static HighlightInfo getSameErasureMessage(final boolean sameClass, final PsiMethod method, final PsiMethod superMethod, TextRange textRange) { - @NonNls final String key = sameClass ? "generics.methods.have.same.erasure" : "generics.methods.have.same.erasure.override"; + @NonNls final String key = sameClass ? "generics.methods.have.same.erasure" : + method.hasModifierProperty(PsiModifier.STATIC) ? + "generics.methods.have.same.erasure.hide" : + "generics.methods.have.same.erasure.override"; String description = JavaErrorMessages.message(key, HighlightMethodUtil.createClashMethodMessage(method, superMethod, !sameClass)); return HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, textRange, description); } diff --git a/java/java-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java b/java/java-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java index b4e31fbe7318..a3aaf703c3d0 100644 --- a/java/java-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java +++ b/java/java-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java @@ -133,8 +133,7 @@ public class RefJavaManagerImpl extends RefJavaManager { refPackage.accept(visitor); } } - final THashMap refTable = myRefManager.getRefTable(); - for (RefElement refElement : refTable.values()) { + for (RefElement refElement : myRefManager.getSortedElements()) { if (refElement instanceof RefClass) { RefClass refClass = (RefClass)refElement; RefMethod refDefaultConstructor = refClass.getDefaultConstructor(); diff --git a/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java b/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java index d5e3705b9b3d..9a49434b2ce2 100644 --- a/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java +++ b/java/java-impl/src/com/intellij/openapi/vcs/contentAnnotation/VcsContentAnnotationExceptionFilter.java @@ -137,25 +137,27 @@ public class VcsContentAnnotationExceptionFilter implements Filter, FilterMixin int endIdx = idx == -1 ? worker.getInfo().getThird().getEndOffset() : idx; consumer.consume(new MyAdditionalHighlight(startOffset + lineStartOffset + startFileOffset + 1, startOffset + lineStartOffset + endIdx)); - // also check method - final List ranges = findMethodRange(worker, document, previousLineResult); - if (ranges != null) { - boolean methodChanged = false; - for (TextRange range : ranges) { - if (localChangesCorrector.isRangeChangedLocally(vf, document, range)) { - methodChanged = true; - break; + if (worker.getPsiClass() != null) { + // also check method + final List ranges = findMethodRange(worker, document, previousLineResult); + if (ranges != null) { + boolean methodChanged = false; + for (TextRange range : ranges) { + if (localChangesCorrector.isRangeChangedLocally(vf, document, range)) { + methodChanged = true; + break; + } + final TextRange correctedRange = localChangesCorrector.getCorrectedRange(vf, document, range); + if (vcsContentAnnotation.intervalRecentlyChanged(vf, correctedRange, recentChangeRevision)) { + methodChanged = true; + break; + } } - final TextRange correctedRange = localChangesCorrector.getCorrectedRange(vf, document, range); - if (vcsContentAnnotation.intervalRecentlyChanged(vf, correctedRange, recentChangeRevision)) { - methodChanged = true; - break; + if (methodChanged) { + consumer.consume(new MyAdditionalHighlight(startOffset + lineStartOffset + worker.getInfo().getSecond().getStartOffset(), + startOffset + lineStartOffset + worker.getInfo().getSecond().getEndOffset())); } } - if (methodChanged) { - consumer.consume(new MyAdditionalHighlight(startOffset + lineStartOffset + worker.getInfo().getSecond().getStartOffset(), - startOffset + lineStartOffset + worker.getInfo().getSecond().getEndOffset())); - } } } } diff --git a/java/java-impl/src/com/intellij/unscramble/UnscrambleDialog.java b/java/java-impl/src/com/intellij/unscramble/UnscrambleDialog.java index 9a97bdade7c0..bcae03df6b5a 100644 --- a/java/java-impl/src/com/intellij/unscramble/UnscrambleDialog.java +++ b/java/java-impl/src/com/intellij/unscramble/UnscrambleDialog.java @@ -16,6 +16,7 @@ package com.intellij.unscramble; import com.intellij.execution.ui.ConsoleView; +import com.intellij.execution.ui.RunContentDescriptor; import com.intellij.ide.IdeBundle; import com.intellij.ide.ui.ListCellRendererWrapper; import com.intellij.ide.util.PropertiesComponent; @@ -29,8 +30,11 @@ import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.Condition; +import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.registry.Registry; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.ProjectLevelVcsManager; import com.intellij.openapi.vcs.configurable.VcsContentAnnotationConfigurable; import com.intellij.openapi.vfs.VirtualFile; @@ -38,6 +42,7 @@ import com.intellij.ui.GuiUtils; import com.intellij.ui.TextFieldWithHistory; import com.intellij.util.ArrayUtil; import com.intellij.util.Consumer; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.text.CharArrayUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable; @@ -46,6 +51,9 @@ import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -57,6 +65,15 @@ public class UnscrambleDialog extends DialogWrapper { @NonNls private static final String PROPERTY_LOG_FILE_HISTORY_URLS = "UNSCRAMBLE_LOG_FILE_URL"; @NonNls private static final String PROPERTY_LOG_FILE_LAST_URL = "UNSCRAMBLE_LOG_FILE_LAST_URL"; @NonNls private static final String PROPERTY_UNSCRAMBLER_NAME_USED = "UNSCRAMBLER_NAME_USED"; + private static final Condition DEADLOCK_CONDITION = new Condition() { + @Override + public boolean value(ThreadState state) { + return state.isDeadlocked(); + } + }; + private static final Icon THREAD_DUMP_ICON = IconLoader.getIcon("/debugger/threadStates/threaddump.png"); + private static final Icon DEADLOCK_ICON = IconLoader.getIcon("/debugger/killProcess.png"); + private static final Icon EXCEPTION_ICON = IconLoader.getIcon("/debugger/threadStates/exception.png"); private final Project myProject; private JPanel myEditorPanel; @@ -358,25 +375,43 @@ public class UnscrambleDialog extends DialogWrapper { private boolean performUnscramble() { UnscrambleSupport selectedUnscrambler = getSelectedUnscrambler(); - return showUnscrambledText(selectedUnscrambler, myLogFile.getText(), myProject, myStacktraceEditorPanel.getText()); + return showUnscrambledText(selectedUnscrambler, myLogFile.getText(), myProject, myStacktraceEditorPanel.getText()) != null; } - static boolean showUnscrambledText(UnscrambleSupport unscrambleSupport, String logName, Project project, String textToUnscramble) { + @Nullable + static RunContentDescriptor showUnscrambledText(@Nullable UnscrambleSupport unscrambleSupport, + String logName, + Project project, + String textToUnscramble) { String unscrambledTrace = unscrambleSupport == null ? textToUnscramble : unscrambleSupport.unscramble(project,textToUnscramble, logName); - if (unscrambledTrace == null) return false; + if (unscrambledTrace == null) return null; List threadStates = ThreadDumpParser.parse(unscrambledTrace); - final ConsoleView consoleView = addConsole(project, threadStates); - consoleView.allowHeavyFilters(); - AnalyzeStacktraceUtil.printStacktrace(consoleView, unscrambledTrace); - return true; + return addConsole(project, threadStates, unscrambledTrace); } - public static ConsoleView addConsole(final Project project, final List threadDump) { + private static RunContentDescriptor addConsole(final Project project, final List threadDump, String unscrambledTrace) { + Icon icon = null; + String message = IdeBundle.message("unscramble.unscrambled.stacktrace.tab"); + if (!threadDump.isEmpty()) { + message = IdeBundle.message("unscramble.unscrambled.threaddump.tab"); + icon = THREAD_DUMP_ICON; + } + else { + String name = getExceptionName(unscrambledTrace); + if (name != null) { + message = name; + icon = EXCEPTION_ICON; + } + } + if (ContainerUtil.find(threadDump, DEADLOCK_CONDITION) != null) { + message = IdeBundle.message("unscramble.unscrambled.deadlock.tab"); + icon = DEADLOCK_ICON; + } return AnalyzeStacktraceUtil.addConsole(project, threadDump.size() > 1 ? new AnalyzeStacktraceUtil.ConsoleFactory() { public JComponent createConsoleComponent(ConsoleView consoleView, DefaultActionGroup toolbarActions) { return new ThreadDumpPanel(project, consoleView, toolbarActions, threadDump); } - } : null, IdeBundle.message("unscramble.unscrambled.stacktrace.tab")); + } : null, message, unscrambledTrace, icon); } protected String getDimensionServiceKey(){ @@ -386,4 +421,53 @@ public class UnscrambleDialog extends DialogWrapper { public JComponent getPreferredFocusedComponent() { return myStacktraceEditorPanel.getEditorComponent(); } + + @Nullable + private static String getExceptionName(String unscrambledTrace) { + @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") + BufferedReader reader = new BufferedReader(new StringReader(unscrambledTrace)); + for (int i = 0; i < 3; i++) { + try { + String line = reader.readLine(); + if (line == null) return null; + line = line.trim(); + String name = getExceptionAbbreviation(line); + if (name != null) return name; + } + catch (IOException e) { + return null; + } + } + return null; + } + + @Nullable + private static String getExceptionAbbreviation(String line) { + int lastDelimiter = 0; + for (int j = 0; j < line.length(); j++) { + char c = line.charAt(j); + if (c == '.' || c == '$') { + lastDelimiter = j; + continue; + } + if (!StringUtil.isJavaIdentifierPart(c)) { + return null; + } + } + String clazz = line.substring(lastDelimiter); + String abbreviate = abbreviate(clazz); + return abbreviate.length() > 1 ? abbreviate : clazz; + } + + private static String abbreviate(String s) { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (Character.isUpperCase(c)) { + builder.append(c); + } + } + return builder.toString(); + } + } \ No newline at end of file diff --git a/java/java-impl/src/com/intellij/unscramble/UnscrambleFromClipboardAction.java b/java/java-impl/src/com/intellij/unscramble/UnscrambleFromClipboardAction.java deleted file mode 100644 index 589c68a0bd15..000000000000 --- a/java/java-impl/src/com/intellij/unscramble/UnscrambleFromClipboardAction.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2000-2009 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.intellij.unscramble; - -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.actionSystem.Presentation; -import com.intellij.openapi.project.Project; - -public final class UnscrambleFromClipboardAction extends AnAction { - public void actionPerformed(AnActionEvent e) { - Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext()); - - // If there's a text in clipboard and log is specified or not needed, unscramble w/o extra questions - - String text = AnalyzeStacktraceUtil.getTextInClipboard(); - if (text != null) { - String file = UnscrambleDialog.getLastUsedLogUrl(); - if (file != null && file.trim().length() == 0) { - file = null; - } - UnscrambleSupport savedUnscrambler = UnscrambleDialog.getSavedUnscrambler(); - if (savedUnscrambler == null || file != null) { - boolean success = UnscrambleDialog.showUnscrambledText(savedUnscrambler, file, project, text); - if (success) { - return; - } - } - } - - // Use regular unscramble dialog - UnscrambleDialog dialog = new UnscrambleDialog(project); - dialog.show(); - } - - public void update(AnActionEvent event){ - Presentation presentation = event.getPresentation(); - Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext()); - presentation.setEnabled(project != null); - } -} diff --git a/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java b/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java index be554463ffec..fb730076134b 100644 --- a/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java @@ -216,10 +216,11 @@ public class GenericsUtil { PsiClassType[] extendsTypes = typeParameter.getExtendsListTypes(); for (PsiClassType type : extendsTypes) { PsiType extendsType = substitutor.substitute(type); - if (!extendsType.isAssignableFrom(substituted)) { - return false; + if (extendsType.isAssignableFrom(substituted)) { + return true; } } + if (extendsTypes.length > 0) return false; } return true; diff --git a/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java b/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java index 037c6f1b8a60..d75f9b95e591 100644 --- a/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java +++ b/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java @@ -31,10 +31,7 @@ import gnu.trove.THashSet; import gnu.trove.TIntArrayList; import org.jetbrains.annotations.Nullable; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; /** * Created by IntelliJ IDEA. @@ -281,7 +278,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ @MethodCandidateInfo.ApplicabilityLevelConstant int maxApplicabilityLevel = 0; boolean toFilter = false; for (CandidateInfo conflict : conflicts) { - @MethodCandidateInfo.ApplicabilityLevelConstant final int level = ((MethodCandidateInfo)conflict).getApplicabilityLevel(); + final @MethodCandidateInfo.ApplicabilityLevelConstant int level = preferVarargs((MethodCandidateInfo)conflict); if (maxApplicabilityLevel > 0 && maxApplicabilityLevel != level) { toFilter = true; } @@ -293,7 +290,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ if (toFilter) { for (Iterator iterator = conflicts.iterator(); iterator.hasNext();) { CandidateInfo info = iterator.next(); - final int level = ((MethodCandidateInfo)info).getApplicabilityLevel(); //cached + final int level = preferVarargs(info); if (level < maxApplicabilityLevel) { iterator.remove(); } @@ -303,6 +300,17 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ return maxApplicabilityLevel; } + private static int preferVarargs(CandidateInfo info) { + final int level = ((MethodCandidateInfo)info).getApplicabilityLevel(); + if (level == MethodCandidateInfo.ApplicabilityLevel.FIXED_ARITY) { + final PsiMethod psiMethod = (PsiMethod)info.getElement(); + if (psiMethod != null && psiMethod.isVarArgs() && JavaVersionService.getInstance().isAtLeast(psiMethod, JavaSdkVersion.JDK_1_7)) { + return level + 1; + } + } + return level; + } + private static int getCheckLevel(MethodCandidateInfo method){ boolean visible = method.isAccessible();// && !method.myStaticProblem; boolean available = method.isStaticsScopeCorrect(); @@ -318,10 +326,19 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ } private static Specifics checkSubtyping(PsiType type1, PsiType type2, PsiMethod method1, PsiMethod method2) { - boolean noBoxing = type1 instanceof PsiPrimitiveType == type2 instanceof PsiPrimitiveType; + return checkSubtyping(type1, type2, method1, method2, true); + } + + @Nullable + private static Specifics checkSubtyping(PsiType type1, + PsiType type2, + PsiMethod method1, + PsiMethod method2, + boolean boxingHappening) { + boolean noBoxing = boxingHappening || type1 instanceof PsiPrimitiveType == type2 instanceof PsiPrimitiveType; final boolean allowUncheckedConversion = !method1.hasModifierProperty(PsiModifier.STATIC) && !method2.hasModifierProperty(PsiModifier.STATIC) || - method1.getContainingClass() == method2.getContainingClass(); + method1.getContainingClass() == method2.getContainingClass(); final boolean assignable2From1 = noBoxing && TypeConversionUtil.isAssignable(type2, type1, allowUncheckedConversion); final boolean assignable1From2 = noBoxing && TypeConversionUtil.isAssignable(type1, type2, allowUncheckedConversion); if (assignable1From2 || assignable2From1) { @@ -332,7 +349,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ return assignable1From2 ? Specifics.SECOND : Specifics.FIRST; } - return Specifics.NEITHER; + return allowUncheckedConversion ? Specifics.NEITHER : null; } private boolean isBoxingHappened(PsiType argType, PsiType parameterType) { @@ -358,8 +375,6 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ final PsiTypeParameter[] typeParameters2 = method2.getTypeParameters(); final PsiSubstitutor classSubstitutor1 = info1.getSubstitutor(); //substitutions for method type parameters will be ignored final PsiSubstitutor classSubstitutor2 = info2.getSubstitutor(); - PsiSubstitutor methodSubstitutor1 = PsiSubstitutor.EMPTY; - PsiSubstitutor methodSubstitutor2 = PsiSubstitutor.EMPTY; final int max = Math.max(params1.length, params2.length); PsiType[] types1 = new PsiType[max]; @@ -382,26 +397,10 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ types2[i] = type2; } - if (typeParameters1.length == 0 || typeParameters2.length == 0) { - if (typeParameters1.length > 0) { - final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(myArgumentsList.getProject()).getResolveHelper(); - methodSubstitutor1 = calculateMethodSubstitutor(typeParameters1, types1, types2, resolveHelper); - } - else if (typeParameters2.length > 0) { - final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(myArgumentsList.getProject()).getResolveHelper(); - methodSubstitutor2 = calculateMethodSubstitutor(typeParameters2, types2, types1, resolveHelper); - } - } - else { - PsiElementFactory factory = JavaPsiFacade.getInstance(myArgumentsList.getProject()).getElementFactory(); - methodSubstitutor1 = factory.createRawSubstitutor(PsiSubstitutor.EMPTY, typeParameters1); - methodSubstitutor2 = factory.createRawSubstitutor(PsiSubstitutor.EMPTY, typeParameters2); - } - int[] boxingHappened = new int[2]; for (int i = 0; i < types1.length; i++) { - PsiType type1 = classSubstitutor1.substitute(methodSubstitutor1.substitute(types1[i])); - PsiType type2 = classSubstitutor2.substitute(methodSubstitutor2.substitute(types2[i])); + PsiType type1 = classSubstitutor1.substitute(types1[i]); + PsiType type2 = classSubstitutor2.substitute(types2[i]); PsiType argType = i < myActualParameterTypes.length ? myActualParameterTypes[i] : null; boxingHappened[0] += isBoxingHappened(argType, type1) ? 1 : 0; @@ -412,15 +411,31 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ Specifics isMoreSpecific = null; for (int i = 0; i < types1.length; i++) { - PsiType type1 = classSubstitutor1.substitute(methodSubstitutor1.substitute(types1[i])); - PsiType type2 = classSubstitutor2.substitute(methodSubstitutor2.substitute(types2[i])); - - Specifics specifics = type1 == null || type2 == null ? null : checkSubtyping(type1, type2, method1, method2); + Specifics specifics = checkSubstitutorSpecific(method1, method2, classSubstitutor1, classSubstitutor2, types1[i], types2[i], isMoreSpecific); if (specifics == null) { - if (Comparing.equal(type1, type2)) { - specifics = checkSubstitutorSpecific(method1, method2, classSubstitutor1, classSubstitutor2, types1[i], types2[i]); + PsiSubstitutor methodSubstitutor1 = PsiSubstitutor.EMPTY; + PsiSubstitutor methodSubstitutor2 = PsiSubstitutor.EMPTY; + if (typeParameters1.length == 0 || typeParameters2.length == 0) { + if (typeParameters1.length > 0) { + final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(myArgumentsList.getProject()).getResolveHelper(); + methodSubstitutor1 = calculateMethodSubstitutor(typeParameters1, types1, types2, resolveHelper); + } + else if (typeParameters2.length > 0) { + final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(myArgumentsList.getProject()).getResolveHelper(); + methodSubstitutor2 = calculateMethodSubstitutor(typeParameters2, types2, types1, resolveHelper); + } + } + else { + PsiElementFactory factory = JavaPsiFacade.getInstance(myArgumentsList.getProject()).getElementFactory(); + methodSubstitutor1 = factory.createRawSubstitutor(PsiSubstitutor.EMPTY, typeParameters1); + methodSubstitutor2 = factory.createRawSubstitutor(PsiSubstitutor.EMPTY, typeParameters2); + } + PsiType type1 = classSubstitutor1.substitute(methodSubstitutor1.substitute(types1[i])); + PsiType type2 = classSubstitutor2.substitute(methodSubstitutor2.substitute(types2[i])); + specifics = type1 == null || type2 == null ? null : checkSubtyping(type1, type2, method1, method2, boxingHappened[0] == 0 || boxingHappened[1] == 0); + if (specifics == null) { + continue; } - if (specifics == null) continue; } switch (specifics) { @@ -473,7 +488,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ PsiSubstitutor classSubstitutor1, PsiSubstitutor classSubstitutor2, PsiType type1, - PsiType type2) { + PsiType type2, Specifics moreSpecific) { final Map map1 = classSubstitutor1.getSubstitutionMap(); final Map map2 = classSubstitutor2.getSubstitutionMap(); @@ -491,20 +506,60 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{ else { final PsiTypeParameter p1 = map1.keySet().iterator().next(); final PsiTypeParameter p2 = map2.keySet().iterator().next(); - Specifics specifics = checkSubtyping(TypeConversionUtil.erasure(PsiSubstitutor.EMPTY.substitute(p1)), - TypeConversionUtil.erasure(PsiSubstitutor.EMPTY.substitute(p2)), method1, method2); - if (specifics != null) { - return specifics; - } else { - final PsiType ctype1 = classSubstitutor1.substitute(type1); - final PsiType ctype2 = classSubstitutor2.substitute(type2); - return checkSubtyping(ctype1, ctype2, method1, method2); - } + return checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, p1, p2, moreSpecific); + } + } else { + final PsiClass aClass1 = PsiUtil.resolveClassInClassTypeOnly(type1); + final PsiClass aClass2 = PsiUtil.resolveClassInClassTypeOnly(type2); + if (aClass1 instanceof PsiTypeParameter && aClass2 instanceof PsiTypeParameter) { + return checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, (PsiTypeParameter)aClass1, (PsiTypeParameter)aClass2, + moreSpecific); } } return null; } + @Nullable + private static Specifics checkTypeParams(PsiMethod method1, + PsiMethod method2, + PsiSubstitutor classSubstitutor1, + PsiSubstitutor classSubstitutor2, + PsiType type1, + PsiType type2, + PsiTypeParameter p1, + PsiTypeParameter p2, Specifics moreSpecific) { + Specifics specifics = checkSubtyping(TypeConversionUtil.erasure(PsiSubstitutor.EMPTY.substitute(p1)), + TypeConversionUtil.erasure(PsiSubstitutor.EMPTY.substitute(p2)), method1, method2); + if (specifics == Specifics.NEITHER) { + final Set resolved1 = new HashSet(); + for (PsiJavaCodeReferenceElement referenceElement : p1.getExtendsList().getReferenceElements()) { + final PsiElement resolve = referenceElement.resolve(); + if (resolve != null) { + resolved1.add(resolve); + } + } + + final Set resolved2 = new HashSet(); + for (PsiJavaCodeReferenceElement referenceElement : p2.getExtendsList().getReferenceElements()) { + final PsiElement resolve = referenceElement.resolve(); + if (resolve != null) { + resolved2.add(resolve); + } + } + + if (resolved1.size() > resolved2.size() && resolved1.containsAll(resolved2)) return Specifics.FIRST; + if (resolved2.size() > resolved1.size() && resolved2.containsAll(resolved1)) return Specifics.SECOND; + } + if (specifics != null) { + return specifics; + } else { + final PsiType ctype1 = classSubstitutor1.substitute(type1); + final PsiType ctype2 = classSubstitutor2.substitute(type2); + specifics = checkSubtyping(ctype1, ctype2, method1, method2); + return specifics == null && moreSpecific == null ? Specifics.NEITHER : specifics; + } + } + private PsiSubstitutor calculateMethodSubstitutor(final PsiTypeParameter[] typeParameters, final PsiType[] types1, final PsiType[] types2, diff --git a/java/java-psi-impl/src/messages/JavaErrorMessages.properties b/java/java-psi-impl/src/messages/JavaErrorMessages.properties index 1dc16d9d3331..3260287f759b 100644 --- a/java/java-psi-impl/src/messages/JavaErrorMessages.properties +++ b/java/java-psi-impl/src/messages/JavaErrorMessages.properties @@ -54,6 +54,7 @@ generics.cannot.be.inherited.with.different.type.arguments=''{0}'' cannot be inh generics.select.static.class.from.parameterized.type=Cannot select static class ''{0}'' from parameterized type generics.methods.have.same.erasure={0}; both methods have same erasure generics.methods.have.same.erasure.override={0}; both methods have same erasure, yet neither overrides the other +generics.methods.have.same.erasure.hide={0}; both methods have same erasure, yet neither hides the other generics.type.parameter.cannot.be.instantiated=Type parameter ''{0}'' cannot be instantiated directly wildcard.type.cannot.be.instantiated=Wildcard type ''{0}'' cannot be instantiated directly generics.wildcard.not.expected=No wildcard expected diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA21660/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA21660/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..fd7315d2f4bb --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA21660/pck/AmbiguousMethodCall.java @@ -0,0 +1,15 @@ +package pck; + +class TestCase { + void assertEquals(Object o1, Object o2) {} + + void assertEquals(int i1, int i2) {} +} + +class Test extends TestCase { + void test() { + int expected = 1; + Integer actual = 2; + assertEquals(expected, actual); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA22547/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA22547/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..e91fac521f97 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA22547/pck/AmbiguousMethodCall.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2012 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 pck; + +import static pck.Assert.assertEquals; + +class Assert { + static void assertEquals(Object o1, Object o2) {} + + static void assertEquals(long l1, long l2) {} +} + +class Test { + void test() { + assertEquals(100L, Long.valueOf(100L)); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA24768/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA24768/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..c8e98329b90d --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA24768/pck/AmbiguousMethodCall.java @@ -0,0 +1,43 @@ +/* + * Copyright 2000-2012 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 pck; + +import java.util.ArrayList; +import java.util.List; + +class IdeaBug { + + public static void main(String[] args) { + ClassA.copyOf(new ArrayList()); + } + + private static class ClassA extends ClassB { + + public static > ClassA copyOf( + Iterable elements) { + System.out.println("Hello from ClassA"); + return null; + } + } + + private static class ClassB { + + public static ClassA copyOf(Iterable elements) { + System.out.println("Hello from ClassB"); + return null; + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA25097/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA25097/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..685ba7e1597e --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA25097/pck/AmbiguousMethodCall.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2012 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 pck; +class Generics { + public void render(T t) { + System.out.println("generic"); + } + + public void render(Integer t) { + System.out.println("int"); + } + + static { + new Generics().render(5); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57269/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57269/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..78af0698ebf9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57269/pck/AmbiguousMethodCall.java @@ -0,0 +1,19 @@ +package pck; + +class A { + void foo(T x) { + foo(1); + + long x1 = 1L; + foo(x1); + + Long x2 = 1L; + foo(x2); + + Integer x3 = 1; + foo(x3); + } + + void foo(long x) { + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57278/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57278/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..6ab825a06f29 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57278/pck/AmbiguousMethodCall.java @@ -0,0 +1,12 @@ +package pck; + +interface I{ + & Cloneable> void foo(); +} + +abstract class A { + abstract > void foo(); + void bar(T x){ + x.foo(); + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57306/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57306/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..0e7807d7bb20 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57306/pck/AmbiguousMethodCall.java @@ -0,0 +1,15 @@ +package pck; + +class A {} + +interface IA{ + void foo(A x); +} +interface IB{ + void foo(A x); +} +class C { + <T extends IA & IB> void bar(T x, A y){ + x.foo(y); + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57317/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57317/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..128fbe1956e7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57317/pck/AmbiguousMethodCall.java @@ -0,0 +1,11 @@ +package pck; + +class B {} +class A extends B { + void foo(A> b){ + bar(b); + } + + void bar(B> a){} + void bar(A> a){} +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57535/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57535/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..3949a2dca05a --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57535/pck/AmbiguousMethodCall.java @@ -0,0 +1,9 @@ +package pck; + +abstract class C{ + abstract > void foo(T x); + abstract > void foo(T x); + void bar(Integer x){ + foo(x); + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67573/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67573/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..b63b6aa93132 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67573/pck/AmbiguousMethodCall.java @@ -0,0 +1,17 @@ +interface A +{ + abstract void foo(String[] ... s); +} + +interface B +{ + abstract void foo(String[] s); +} + +class C +{ + void bar(T x) + { + x.foo(null); + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67832/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67832/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..45910d1c36bb --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67832/pck/AmbiguousMethodCall.java @@ -0,0 +1,17 @@ +package pck; +import static pck.D.foo; +import static pck.C.foo; + +public class C { + public static , S> void foo(T x){} +} + +class D { + public static > void foo(T x){} +} + +class B{ + { + foo(1); + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67837/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67837/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..0fbc5bc0db3d --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA67837/pck/AmbiguousMethodCall.java @@ -0,0 +1,18 @@ +package pck; + +import static pck.D.foo; +import static pck.C.foo; + +public class C { + public static void foo(Comparable> x){} +} + +class D { + public static void foo(Comparable x){} +} + +class B{ + public static void bar(){ + foo(1); + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA78027/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA78027/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..00016a20e6f4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA78027/pck/AmbiguousMethodCall.java @@ -0,0 +1,17 @@ +package pck; +class Test { + void test() { + B.method(new ArgumentB()); + } +} + +class A { + static void method(ArgumentA a) { } +} + +class B extends A { + static void method(ArgumentB b) { } +} + +class ArgumentA {} +class ArgumentB extends ArgumentA {} \ No newline at end of file diff --git a/java/java-tests/testData/inspection/redundantCast/generics/IDEA22899/expected.xml b/java/java-tests/testData/inspection/redundantCast/generics/IDEA22899/expected.xml new file mode 100644 index 000000000000..4704d91e891d --- /dev/null +++ b/java/java-tests/testData/inspection/redundantCast/generics/IDEA22899/expected.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/java/java-tests/testData/inspection/redundantCast/generics/IDEA22899/src/WrapperToPrimitiveCast.java b/java/java-tests/testData/inspection/redundantCast/generics/IDEA22899/src/WrapperToPrimitiveCast.java new file mode 100644 index 000000000000..ba9b21c80b70 --- /dev/null +++ b/java/java-tests/testData/inspection/redundantCast/generics/IDEA22899/src/WrapperToPrimitiveCast.java @@ -0,0 +1,15 @@ +public class RedundantIntCast +{ + public static void main(String[] args) { + Integer i = 8; + method((int)i, 1); // int cast is marked as redundant + } + + static void method(Object o, Object o1) { + System.out.println("this method works on objects"); + } + + static void method(int i, int i1) { + System.out.println("this method works on ints"); + } +} diff --git a/java/java-tests/testData/unscramble/deadlock.txt b/java/java-tests/testData/unscramble/deadlock.txt new file mode 100644 index 000000000000..80e27e17ab26 --- /dev/null +++ b/java/java-tests/testData/unscramble/deadlock.txt @@ -0,0 +1,773 @@ +2011-11-25 20:12:30 +Full thread dump Java HotSpot(TM) 64-Bit Server VM (17.1-b03-307 mixed mode): + +"Attach Listener" daemon prio=9 tid=103588000 nid=0x113fb6000 waiting on condition [00000000] + java.lang.Thread.State: RUNNABLE + + Locked ownable synchronizers: + - None + +"process reaper" daemon prio=4 tid=11d190800 nid=0x116755000 runnable [116754000] + java.lang.Thread.State: RUNNABLE + at java.lang.UNIXProcess.waitForProcessExit(Native Method) + at java.lang.UNIXProcess.access$900(UNIXProcess.java:17) + at java.lang.UNIXProcess$2$1.run(UNIXProcess.java:86) + + Locked ownable synchronizers: + - None + +"Alarm pool(own)" daemon prio=3 tid=114486000 nid=0x11b102000 waiting on condition [11b101000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7caf15c60> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"JobScheduler pool 0/1" prio=5 tid=115659000 nid=0x11ac6c000 waiting for monitor entry [11ac6a000] + java.lang.Thread.State: BLOCKED (on object monitor) + at com.intellij.util.io.PersistentHashMap.get(PersistentHashMap.java:339) + - waiting to lock <7c9734008> (a com.intellij.util.io.PersistentBTreeEnumerator) + at com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:77) + at com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:67) + at com.intellij.util.indexing.ChangeTrackingValueContainer.getMergedData(ChangeTrackingValueContainer.java:134) + - locked <7c9733fa0> (a com.intellij.util.indexing.ValueContainerMap) + at com.intellij.util.indexing.ChangeTrackingValueContainer.getValueIterator(ChangeTrackingValueContainer.java:98) + at com.intellij.util.indexing.FileBasedIndex.processValuesImpl(FileBasedIndex.java:900) + at com.intellij.util.indexing.FileBasedIndex.getValues(FileBasedIndex.java:822) + at com.intellij.javascript.flex.css.FlexCssElementDescriptorProvider.getPropertyDescriptor(FlexCssElementDescriptorProvider.java:180) + at com.intellij.psi.css.impl.util.table.CssDescriptorsUtil.getPropertyDescriptor(CssDescriptorsUtil.java:50) + at com.intellij.psi.css.impl.util.table.CssDescriptorsUtil.getCannonicalPropertyName(CssDescriptorsUtil.java:98) + at com.intellij.psi.css.impl.util.table.CssDescriptorsUtil.getCannonicalPropertyName(CssDescriptorsUtil.java:104) + at com.intellij.psi.css.browse.CssColorAnnotator.annotate(CssColorAnnotator.java:105) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:157) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:100) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$8.run(GeneralHighlightingPass.java:593) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:771) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3600(GeneralHighlightingPass.java:80) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$10.run(GeneralHighlightingPass.java:777) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:84) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:774) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3600(GeneralHighlightingPass.java:80) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$10.run(GeneralHighlightingPass.java:777) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:84) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:774) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:639) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:204) + at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:58) + at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:61) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:350) + at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1034) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:342) + at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:206) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:340) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:316) + at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:134) + at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:131) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31) + at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70) + at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:113) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - <7ca6bf518> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"RefCountingStorage write content helper" prio=4 tid=11570f000 nid=0x11a434000 waiting on condition [11a433000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c8fdddc0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"ApplicationImpl pooled thread 8" prio=4 tid=10367e800 nid=0x118b45000 waiting on condition [118b44000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at com.intellij.util.io.OutputReader.doRun(OutputReader.java:65) + at com.intellij.util.io.OutputReader.access$000(OutputReader.java:27) + at com.intellij.util.io.OutputReader$1.run(OutputReader.java:44) + at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:421) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + + Locked ownable synchronizers: + - <7c9b5c150> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"ApplicationImpl pooled thread 7" prio=4 tid=1145bb800 nid=0x118a42000 waiting on condition [118a41000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c94dc7d0> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + + Locked ownable synchronizers: + - None + +"ApplicationImpl pooled thread 6" prio=4 tid=114112800 nid=0x11893f000 waiting on condition [11893e000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at com.intellij.util.io.OutputReader.doRun(OutputReader.java:65) + at com.intellij.util.io.OutputReader.access$000(OutputReader.java:27) + at com.intellij.util.io.OutputReader$1.run(OutputReader.java:44) + at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:421) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + + Locked ownable synchronizers: + - <7c9b5bbf8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"ApplicationImpl pooled thread 5" prio=4 tid=103346000 nid=0x117689000 waiting on condition [117688000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c94dc7d0> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + + Locked ownable synchronizers: + - None + +"ApplicationImpl pooled thread 4" prio=4 tid=114698800 nid=0x117586000 in Object.wait() [117585000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7ce02f4b0> (a java.lang.UNIXProcess) + at java.lang.Object.wait(Object.java:485) + at java.lang.UNIXProcess.waitFor(UNIXProcess.java:115) + - locked <7ce02f4b0> (a java.lang.UNIXProcess) + at com.intellij.execution.process.BaseOSProcessHandler$ProcessWaitFor$1.run(BaseOSProcessHandler.java:221) + at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:421) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + + Locked ownable synchronizers: + - <7c9b5b7d8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"ApplicationImpl pooled thread 3" prio=4 tid=1032bb000 nid=0x117483000 in Object.wait() [117482000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c94992c0> (a com.intellij.util.concurrency.WriterPreferenceReadWriteLock$ReaderLock) + at java.lang.Object.wait(Object.java:485) + at com.intellij.util.concurrency.WriterPreferenceReadWriteLock$ReaderLock.acquire(WriterPreferenceReadWriteLock.java:162) + - locked <7c94992c0> (a com.intellij.util.concurrency.WriterPreferenceReadWriteLock$ReaderLock) + at com.intellij.openapi.application.impl.ApplicationImpl$ReadAccessToken.(ApplicationImpl.java:1161) + at com.intellij.openapi.application.impl.ApplicationImpl.acquireReadActionLockImpl(ApplicationImpl.java:1087) + at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:870) + at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:139) + at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:242) + at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:229) + at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211) + at com.intellij.flex.uiDesigner.DesignerApplicationManager.getService(DesignerApplicationManager.java:56) + at com.intellij.flex.uiDesigner.Client.getInstance(Client.java:40) + at com.intellij.flex.uiDesigner.io.MessageSocketManager.setOut(MessageSocketManager.java:23) + at com.intellij.flex.uiDesigner.io.SocketManager.run(SocketManager.java:32) + at com.intellij.flex.uiDesigner.io.MessageSocketManager.run(MessageSocketManager.java:12) + at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:421) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + + Locked ownable synchronizers: + - <7c9b5b5c8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"FS Synchronizer" daemon prio=5 tid=1032b4000 nid=0x117380000 waiting on condition [11737f000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c8ff7788> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"Animations" daemon prio=5 tid=114626000 nid=0x116aa0000 runnable [116a9f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c9796698> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"TimerQueue" daemon prio=5 tid=1145b3000 nid=0x11699d000 in Object.wait() [11699c000] + java.lang.Thread.State: TIMED_WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c98b8fd0> (a javax.swing.TimerQueue) + at javax.swing.TimerQueue.run(TimerQueue.java:232) + - locked <7c98b8fd0> (a javax.swing.TimerQueue) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"Alarm pool(shared)" daemon prio=3 tid=11426d800 nid=0x11689a000 in Object.wait() [116899000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7b85d56d8> (a java.awt.EventQueue$1AWTInvocationLock) + at java.lang.Object.wait(Object.java:485) + at java.awt.EventQueue.invokeAndWait(EventQueue.java:1029) + - locked <7b85d56d8> (a java.awt.EventQueue$1AWTInvocationLock) + at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1320) + at com.intellij.util.Alarm$Request$1.run(Alarm.java:222) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - <7c97aaec0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"LowMemoryWatcher" daemon prio=4 tid=1037c8800 nid=0x11628b000 in Object.wait() [11628a000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c96c9d28> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) + - locked <7c96c9d28> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) + at com.intellij.openapi.util.LowMemoryWatcher$1.run(LowMemoryWatcher.java:60) + + Locked ownable synchronizers: + - None + +"FocusManager timer" daemon prio=2 tid=114152800 nid=0x115fe6000 in Object.wait() [115fe5000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c96b4228> (a java.util.TaskQueue) + at java.lang.Object.wait(Object.java:485) + at java.util.TimerThread.mainLoop(Timer.java:483) + - locked <7c96b4228> (a java.util.TaskQueue) + at java.util.TimerThread.run(Timer.java:462) + + Locked ownable synchronizers: + - None + +"Shared SimpleTimer" daemon prio=2 tid=103694800 nid=0x115ee3000 in Object.wait() [115ee2000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c96b3d48> (a java.util.TaskQueue) + at java.lang.Object.wait(Object.java:485) + at java.util.TimerThread.mainLoop(Timer.java:483) + - locked <7c96b3d48> (a java.util.TaskQueue) + at java.util.TimerThread.run(Timer.java:462) + + Locked ownable synchronizers: + - None + +"XML-RPC Weblistener" prio=3 tid=103784800 nid=0x115de0000 runnable [115ddf000] + java.lang.Thread.State: RUNNABLE + at java.net.PlainSocketImpl.socketAccept(Native Method) + at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390) + - locked <7c96a0fa8> (a java.net.SocksSocketImpl) + at java.net.ServerSocket.implAccept(ServerSocket.java:453) + at java.net.ServerSocket.accept(ServerSocket.java:421) + at org.apache.xmlrpc.WebServer.run(WebServer.java:453) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"Performance watcher" prio=1 tid=10370b000 nid=0x115cdd000 waiting on condition [115cdc000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c969e910> (a java.util.concurrent.Semaphore$NonfairSync) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1011) + at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1303) + at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:383) + at com.intellij.diagnostic.PerformanceWatcher.checkEDTResponsiveness(PerformanceWatcher.java:156) + at com.intellij.diagnostic.PerformanceWatcher.access$100(PerformanceWatcher.java:40) + at com.intellij.diagnostic.PerformanceWatcher$2.run(PerformanceWatcher.java:111) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"Document commit thread" prio=6 tid=1140a8800 nid=0x115901000 in Object.wait() [115900000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c90bc598> (a com.intellij.util.containers.Queue) + at java.lang.Object.wait(Object.java:485) + at com.intellij.psi.impl.DocumentCommitThread.run(DocumentCommitThread.java:275) + - locked <7c90bc598> (a com.intellij.util.containers.Queue) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"ApplicationImpl pooled thread 0 [ReadAccessToken]" prio=4 tid=103693800 nid=0x114901000 waiting for monitor entry [1148ff000] + java.lang.Thread.State: BLOCKED (on object monitor) + at com.intellij.util.indexing.ChangeTrackingValueContainer.getMergedData(ChangeTrackingValueContainer.java:127) + - waiting to lock <7c9733fa0> (a com.intellij.util.indexing.ValueContainerMap) + at com.intellij.util.indexing.ChangeTrackingValueContainer.getValueIterator(ChangeTrackingValueContainer.java:98) + at com.intellij.util.indexing.FileBasedIndex.processValuesImpl(FileBasedIndex.java:887) + at com.intellij.util.indexing.FileBasedIndex.processValues(FileBasedIndex.java:860) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector$1.process(LibraryStyleInfoCollector.java:42) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector$1.process(LibraryStyleInfoCollector.java:39) + at com.intellij.util.indexing.MemoryIndexStorage$1.process(MemoryIndexStorage.java:118) + at com.intellij.util.io.PersistentEnumeratorBase.iterateData(PersistentEnumeratorBase.java:373) + - locked <7c8fd4558> (a com.intellij.util.io.PagedFileStorage$StorageLock) + at com.intellij.util.io.PersistentHashMap.processKeys(PersistentHashMap.java:318) + - locked <7c9734008> (a com.intellij.util.io.PersistentBTreeEnumerator) + at com.intellij.util.indexing.MapIndexStorage.processKeys(MapIndexStorage.java:173) + at com.intellij.util.indexing.MemoryIndexStorage.processKeys(MemoryIndexStorage.java:126) + at com.intellij.util.indexing.MapReduceIndex.processAllKeys(MapReduceIndex.java:164) + at com.intellij.util.indexing.FileBasedIndex.processAllKeys(FileBasedIndex.java:688) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector.collectInherited(LibraryStyleInfoCollector.java:39) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector.consume(LibraryStyleInfoCollector.java:73) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector.consume(LibraryStyleInfoCollector.java:19) + at com.intellij.flex.uiDesigner.libraries.LibraryManager.createOriginalLibrary(LibraryManager.java:268) + at com.intellij.flex.uiDesigner.libraries.LibraryCollector.addLibrary(LibraryCollector.java:243) + at com.intellij.flex.uiDesigner.libraries.LibraryCollector.collectFromSdkOrderEntry(LibraryCollector.java:223) + at com.intellij.flex.uiDesigner.libraries.LibraryCollector.collect(LibraryCollector.java:138) + at com.intellij.flex.uiDesigner.libraries.LibraryManager.initLibrarySets(LibraryManager.java:95) + at com.intellij.flex.uiDesigner.DesignerApplicationLauncher$7.call(DesignerApplicationLauncher.java:376) + at com.intellij.flex.uiDesigner.DesignerApplicationLauncher$7.call(DesignerApplicationLauncher.java:364) + at com.intellij.openapi.application.impl.ApplicationImpl$7.call(ApplicationImpl.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + + Locked ownable synchronizers: + - <7c9054a10> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + - <7c9733f80> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"Progress Cancel Checker" prio=9 tid=1035c0800 nid=0x114f46000 waiting on condition [114f45000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:60) + + Locked ownable synchronizers: + - None + +"StoreRefreshStatusThread" daemon prio=1 tid=1035b8000 nid=0x114e43000 waiting on condition [114e42000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl$StoreRefreshStatusThread.run(LocalFileSystemImpl.java:325) + + Locked ownable synchronizers: + - None + +"WatchForChangesThread" prio=6 tid=1030a5000 nid=0x114d40000 runnable [114d3f000] + java.lang.Thread.State: RUNNABLE + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(FileInputStream.java:199) + at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227) + at java.io.BufferedInputStream.read1(BufferedInputStream.java:256) + at java.io.BufferedInputStream.read(BufferedInputStream.java:317) + - locked <7c8fe2010> (a java.io.BufferedInputStream) + at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264) + at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) + at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) + - locked <7c8fe4248> (a java.io.InputStreamReader) + at java.io.InputStreamReader.read(InputStreamReader.java:167) + at java.io.BufferedReader.fill(BufferedReader.java:136) + at java.io.BufferedReader.readLine(BufferedReader.java:299) + - locked <7c8fe4248> (a java.io.InputStreamReader) + at java.io.BufferedReader.readLine(BufferedReader.java:362) + at com.intellij.openapi.vfs.impl.local.FileWatcher.readLine(FileWatcher.java:481) + at com.intellij.openapi.vfs.impl.local.FileWatcher.access$300(FileWatcher.java:48) + at com.intellij.openapi.vfs.impl.local.FileWatcher$WatchForChangesThread.run(FileWatcher.java:354) + + Locked ownable synchronizers: + - None + +"process reaper" daemon prio=6 tid=1030a4000 nid=0x114c3d000 runnable [114c3c000] + java.lang.Thread.State: RUNNABLE + at java.lang.UNIXProcess.waitForProcessExit(Native Method) + at java.lang.UNIXProcess.access$900(UNIXProcess.java:17) + at java.lang.UNIXProcess$2$1.run(UNIXProcess.java:86) + + Locked ownable synchronizers: + - None + +"Flushing thread" daemon prio=5 tid=1030a3800 nid=0x114add000 waiting on condition [114adc000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c9733f80> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811) + at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842) + at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178) + at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186) + at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262) + at com.intellij.util.indexing.MapIndexStorage.flush(MapIndexStorage.java:108) + at com.intellij.util.indexing.MemoryIndexStorage.flush(MemoryIndexStorage.java:97) + at com.intellij.util.indexing.MapReduceIndex.flush(MapReduceIndex.java:96) + at com.intellij.util.indexing.FileBasedIndex.flushAllIndices(FileBasedIndex.java:652) + at com.intellij.util.indexing.FileBasedIndex.access$1200(FileBasedIndex.java:95) + at com.intellij.util.indexing.FileBasedIndex$7.run(FileBasedIndex.java:332) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) + at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) + at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - <7c8fdead0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) + +"Poller SunPKCS11-Darwin" daemon prio=1 tid=1147c0000 nid=0x113cab000 waiting on condition [113caa000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at sun.security.pkcs11.SunPKCS11$TokenPoller.run(SunPKCS11.java:692) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"timed reference disposer" daemon prio=2 tid=115421000 nid=0x113eb3000 waiting on condition [113eb2000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c90cff28> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"AWT-EventQueue-1 1.0#112.11, eap:true" prio=6 tid=103291000 nid=0x11224c000 in Object.wait() [11224a000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c94992d0> (a com.intellij.util.concurrency.WriterPreferenceReadWriteLock$WriterLock) + at java.lang.Object.wait(Object.java:485) + at com.intellij.util.concurrency.WriterPreferenceReadWriteLock$WriterLock.acquire(WriterPreferenceReadWriteLock.java:241) + - locked <7c94992d0> (a com.intellij.util.concurrency.WriterPreferenceReadWriteLock$WriterLock) + at com.intellij.openapi.application.impl.ApplicationImpl$WriteAccessToken.(ApplicationImpl.java:1127) + at com.intellij.openapi.application.impl.ApplicationImpl.acquireWriteActionLock(ApplicationImpl.java:1092) + at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:881) + at com.intellij.openapi.components.impl.stores.StorageUtil.save(StorageUtil.java:107) + at com.intellij.openapi.components.impl.stores.FileBasedStorage$FileSaveSession.doSave(FileBasedStorage.java:169) + at com.intellij.openapi.components.impl.stores.XmlElementStorage$MySaveSession.saveLocally(XmlElementStorage.java:426) + at com.intellij.openapi.components.impl.stores.XmlElementStorage$MySaveSession.save(XmlElementStorage.java:418) + at com.intellij.openapi.components.impl.stores.CompoundSaveSession.save(CompoundSaveSession.java:52) + at com.intellij.openapi.components.impl.stores.StateStorageManagerImpl$MySaveSession.save(StateStorageManagerImpl.java:511) + at com.intellij.openapi.components.impl.stores.ComponentStoreImpl$SaveSessionImpl.save(ComponentStoreImpl.java:436) + at com.intellij.openapi.components.impl.stores.ProjectStoreImpl$ProjectSaveSession.save(ProjectStoreImpl.java:508) + at com.intellij.openapi.components.impl.stores.StoreUtil.doSave(StoreUtil.java:31) + at com.intellij.openapi.project.impl.ProjectImpl.save(ProjectImpl.java:323) + at com.intellij.ide.SaveAndSyncHandler.saveProjectsAndDocuments(SaveAndSyncHandler.java:134) + at com.intellij.ide.SaveAndSyncHandler$3.onFrameDeactivated(SaveAndSyncHandler.java:91) + at com.intellij.ide.FrameStateManagerImpl.fireDeactivationEvent(FrameStateManagerImpl.java:100) + at com.intellij.ide.FrameStateManagerImpl.access$500(FrameStateManagerImpl.java:31) + at com.intellij.ide.FrameStateManagerImpl$2$1.run(FrameStateManagerImpl.java:72) + at com.intellij.util.Alarm$Request$1.run(Alarm.java:230) + at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:333) + - locked <7c9051c70> (a java.lang.Object) + at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) + at java.awt.EventQueue.dispatchEvent(EventQueue.java:633) + at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:686) + at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:534) + at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:416) + at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:374) + at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) + at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) + at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) + at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) + at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) + at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) + + Locked ownable synchronizers: + - None + +"Periodic tasks thread" daemon prio=5 tid=10319c800 nid=0x108bb0000 runnable [108baf000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c8d17468> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"AWT-Shutdown" prio=5 tid=103378000 nid=0x110f48000 in Object.wait() [110f47000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c8d175a0> (a java.lang.Object) + at java.lang.Object.wait(Object.java:485) + at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:265) + - locked <7c8d175a0> (a java.lang.Object) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"Lock thread" prio=1 tid=10324b800 nid=0x1118ee000 runnable [1118ed000] + java.lang.Thread.State: RUNNABLE + at java.net.PlainSocketImpl.socketAccept(Native Method) + at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390) + - locked <7c8d17658> (a java.net.SocksSocketImpl) + at java.net.ServerSocket.implAccept(ServerSocket.java:453) + at java.net.ServerSocket.accept(ServerSocket.java:421) + at com.intellij.idea.SocketLock$MyRunnable.run(SocketLock.java:216) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"Java2D Disposer" daemon prio=10 tid=103245800 nid=0x1116e8000 in Object.wait() [1116e7000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c8d17840> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) + - locked <7c8d17840> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) + at sun.java2d.Disposer.run(Disposer.java:127) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"AWT-AppKit" daemon prio=5 tid=103377000 nid=0x7fff70d5fca0 runnable [00000000] + java.lang.Thread.State: RUNNABLE + + Locked ownable synchronizers: + - None + +"DestroyJavaVM" prio=5 tid=103001800 nid=0x10255b000 waiting on condition [00000000] + java.lang.Thread.State: RUNNABLE + + Locked ownable synchronizers: + - None + +"timed reference disposer" daemon prio=2 tid=103157800 nid=0x10850d000 waiting on condition [10850c000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <7c8d17a18> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:680) + + Locked ownable synchronizers: + - None + +"Low Memory Detector" daemon prio=5 tid=103060000 nid=0x1081b4000 runnable [00000000] + java.lang.Thread.State: RUNNABLE + + Locked ownable synchronizers: + - None + +"CompilerThread1" daemon prio=9 tid=10305f800 nid=0x1080b1000 waiting on condition [00000000] + java.lang.Thread.State: RUNNABLE + + Locked ownable synchronizers: + - None + +"CompilerThread0" daemon prio=9 tid=10305e800 nid=0x107fae000 waiting on condition [00000000] + java.lang.Thread.State: RUNNABLE + + Locked ownable synchronizers: + - None + +"Signal Dispatcher" daemon prio=9 tid=10305e000 nid=0x107eab000 runnable [00000000] + java.lang.Thread.State: RUNNABLE + + Locked ownable synchronizers: + - None + +"Finalizer" daemon prio=8 tid=103044000 nid=0x107da8000 in Object.wait() [107da7000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c8d17d40> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) + - locked <7c8d17d40> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) + at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) + + Locked ownable synchronizers: + - None + +"Reference Handler" daemon prio=10 tid=103043800 nid=0x107ca5000 in Object.wait() [107ca4000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <7c8d17170> (a java.lang.ref.Reference$Lock) + at java.lang.Object.wait(Object.java:485) + at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116) + - locked <7c8d17170> (a java.lang.ref.Reference$Lock) + + Locked ownable synchronizers: + - None + +"VM Thread" prio=9 tid=103041000 nid=0x107ba2000 runnable + +"VM Periodic Task Thread" prio=10 tid=10306a000 nid=0x1082b7000 waiting on condition + +"Exception Catcher Thread" prio=10 tid=103002000 nid=0x102c98000 runnable +JNI global references: 6703 + + +Found one Java-level deadlock: +============================= +"JobScheduler pool 0/1": + waiting to lock monitor 100d58420 (object 7c9734008, a com.intellij.util.io.PersistentBTreeEnumerator), + which is held by "ApplicationImpl pooled thread 0 [ReadAccessToken]" +"ApplicationImpl pooled thread 0 [ReadAccessToken]": + waiting to lock monitor 1008a8768 (object 7c9733fa0, a com.intellij.util.indexing.ValueContainerMap), + which is held by "JobScheduler pool 0/1" + +Java stack information for the threads listed above: +=================================================== +"JobScheduler pool 0/1": + at com.intellij.util.io.PersistentHashMap.get(PersistentHashMap.java:339) + - waiting to lock <7c9734008> (a com.intellij.util.io.PersistentBTreeEnumerator) + at com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:77) + at com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:67) + at com.intellij.util.indexing.ChangeTrackingValueContainer.getMergedData(ChangeTrackingValueContainer.java:134) + - locked <7c9733fa0> (a com.intellij.util.indexing.ValueContainerMap) + at com.intellij.util.indexing.ChangeTrackingValueContainer.getValueIterator(ChangeTrackingValueContainer.java:98) + at com.intellij.util.indexing.FileBasedIndex.processValuesImpl(FileBasedIndex.java:900) + at com.intellij.util.indexing.FileBasedIndex.getValues(FileBasedIndex.java:822) + at com.intellij.javascript.flex.css.FlexCssElementDescriptorProvider.getPropertyDescriptor(FlexCssElementDescriptorProvider.java:180) + at com.intellij.psi.css.impl.util.table.CssDescriptorsUtil.getPropertyDescriptor(CssDescriptorsUtil.java:50) + at com.intellij.psi.css.impl.util.table.CssDescriptorsUtil.getCannonicalPropertyName(CssDescriptorsUtil.java:98) + at com.intellij.psi.css.impl.util.table.CssDescriptorsUtil.getCannonicalPropertyName(CssDescriptorsUtil.java:104) + at com.intellij.psi.css.browse.CssColorAnnotator.annotate(CssColorAnnotator.java:105) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:157) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:100) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$8.run(GeneralHighlightingPass.java:593) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:771) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3600(GeneralHighlightingPass.java:80) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$10.run(GeneralHighlightingPass.java:777) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:84) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:774) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3600(GeneralHighlightingPass.java:80) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$10.run(GeneralHighlightingPass.java:777) + at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:84) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:774) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:639) + at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:204) + at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:58) + at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:61) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:350) + at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1034) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:342) + at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:206) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:340) + at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:316) + at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:134) + at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:131) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31) + at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70) + at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:113) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) +"ApplicationImpl pooled thread 0 [ReadAccessToken]": + at com.intellij.util.indexing.ChangeTrackingValueContainer.getMergedData(ChangeTrackingValueContainer.java:127) + - waiting to lock <7c9733fa0> (a com.intellij.util.indexing.ValueContainerMap) + at com.intellij.util.indexing.ChangeTrackingValueContainer.getValueIterator(ChangeTrackingValueContainer.java:98) + at com.intellij.util.indexing.FileBasedIndex.processValuesImpl(FileBasedIndex.java:887) + at com.intellij.util.indexing.FileBasedIndex.processValues(FileBasedIndex.java:860) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector$1.process(LibraryStyleInfoCollector.java:42) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector$1.process(LibraryStyleInfoCollector.java:39) + at com.intellij.util.indexing.MemoryIndexStorage$1.process(MemoryIndexStorage.java:118) + at com.intellij.util.io.PersistentEnumeratorBase.iterateData(PersistentEnumeratorBase.java:373) + - locked <7c8fd4558> (a com.intellij.util.io.PagedFileStorage$StorageLock) + at com.intellij.util.io.PersistentHashMap.processKeys(PersistentHashMap.java:318) + - locked <7c9734008> (a com.intellij.util.io.PersistentBTreeEnumerator) + at com.intellij.util.indexing.MapIndexStorage.processKeys(MapIndexStorage.java:173) + at com.intellij.util.indexing.MemoryIndexStorage.processKeys(MemoryIndexStorage.java:126) + at com.intellij.util.indexing.MapReduceIndex.processAllKeys(MapReduceIndex.java:164) + at com.intellij.util.indexing.FileBasedIndex.processAllKeys(FileBasedIndex.java:688) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector.collectInherited(LibraryStyleInfoCollector.java:39) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector.consume(LibraryStyleInfoCollector.java:73) + at com.intellij.flex.uiDesigner.libraries.LibraryStyleInfoCollector.consume(LibraryStyleInfoCollector.java:19) + at com.intellij.flex.uiDesigner.libraries.LibraryManager.createOriginalLibrary(LibraryManager.java:268) + at com.intellij.flex.uiDesigner.libraries.LibraryCollector.addLibrary(LibraryCollector.java:243) + at com.intellij.flex.uiDesigner.libraries.LibraryCollector.collectFromSdkOrderEntry(LibraryCollector.java:223) + at com.intellij.flex.uiDesigner.libraries.LibraryCollector.collect(LibraryCollector.java:138) + at com.intellij.flex.uiDesigner.libraries.LibraryManager.initLibrarySets(LibraryManager.java:95) + at com.intellij.flex.uiDesigner.DesignerApplicationLauncher$7.call(DesignerApplicationLauncher.java:376) + at com.intellij.flex.uiDesigner.DesignerApplicationLauncher$7.call(DesignerApplicationLauncher.java:364) + at com.intellij.openapi.application.impl.ApplicationImpl$7.call(ApplicationImpl.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:680) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:137) + +Found 1 deadlock. + diff --git a/java/java-tests/testData/unscramble/threaddump.txt b/java/java-tests/testData/unscramble/threaddump.txt new file mode 100644 index 000000000000..38b2f6cd98d1 --- /dev/null +++ b/java/java-tests/testData/unscramble/threaddump.txt @@ -0,0 +1,485 @@ +2010-08-06 14:12:30 +Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode): + +"Alarm pool(own)" prio=4 tid=0x366df000 nid=0x118 waiting on condition [0x357ef000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x0f307a88> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"Alarm pool(own)" prio=4 tid=0x36659800 nid=0xd90 waiting on condition [0x3597f000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x0eacca98> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"Alarm pool(own)" prio=4 tid=0x36493400 nid=0x968 waiting on condition [0x36eff000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05a52698> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"Alarm pool(own)" prio=4 tid=0x361b2400 nid=0x5cc waiting on condition [0x35cbf000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05a52ab0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"SimpleTimer" daemon prio=2 tid=0x34bf6400 nid=0x928 in Object.wait() [0x3579f000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + at java.lang.Object.wait(Object.java:485) + at java.util.TimerThread.mainLoop(Timer.java:483) + - locked <0x07c96db0> (a java.util.TaskQueue) + at java.util.TimerThread.run(Timer.java:462) + +"Swing-Shell" daemon prio=6 tid=0x36377400 nid=0xbe8 waiting on condition [0x384cf000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x06fda8c0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:458) + at java.lang.Thread.run(Thread.java:619) + +"JobScheduler pool 0/1" prio=6 tid=0x34abe000 nid=0xb2c waiting on condition [0x3847f000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x06f32b38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:220) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"ApplicationImpl pooled thread" prio=4 tid=0x34b3ac00 nid=0x8a8 waiting on condition [0x3842f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05337e08> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125) + +"ApplicationImpl pooled thread" prio=4 tid=0x36481000 nid=0x8a0 waiting on condition [0x383df000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05337e08> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125) + +"Change List Updater" prio=2 tid=0x34447c00 nid=0x900 waiting on condition [0x36fff000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x06381570> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:160) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"Timer-0" daemon prio=6 tid=0x34be7400 nid=0x8fc in Object.wait() [0x36faf000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <0x06eb0558> (a java.util.TaskQueue) + at java.lang.Object.wait(Object.java:485) + at java.util.TimerThread.mainLoop(Timer.java:483) + - locked <0x06eb0558> (a java.util.TaskQueue) + at java.util.TimerThread.run(Timer.java:462) + +"ApplicationImpl pooled thread" prio=4 tid=0x361b5c00 nid=0x878 waiting on condition [0x35c6f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05337e08> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125) + +"Alarm pool(own)" prio=4 tid=0x3600cc00 nid=0x89c waiting on condition [0x36eaf000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05a52dd8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"ApplicationImpl pooled thread" prio=4 tid=0x34e45000 nid=0x8ac waiting on condition [0x36e5f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05337e08> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125) + +"Progress Cancel Checker" prio=10 tid=0x34e55400 nid=0xa1c waiting on condition [0x35e2f000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:62) + +"ApplicationImpl pooled thread" prio=4 tid=0x34ce1400 nid=0x9dc waiting on condition [0x35ddf000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05337e08> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125) + +"Alarm pool(shared)" prio=4 tid=0x34e52800 nid=0x8e8 waiting on condition [0x35d0f000] + java.lang.Thread.State: WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05332d60> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925) + at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"TimerQueue" daemon prio=6 tid=0x34e3f800 nid=0x948 in Object.wait() [0x3574f000] + java.lang.Thread.State: TIMED_WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + at javax.swing.TimerQueue.run(TimerQueue.java:232) + - locked <0x05e08120> (a javax.swing.TimerQueue) + at java.lang.Thread.run(Thread.java:619) + +"Exe4JStartupThread" daemon prio=6 tid=0x34ab9800 nid=0x4f0 waiting on condition [0x356ef000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at com.exe4j.Controller$StartupThread.run(Unknown Source) + +"FS Synchronizer" prio=6 tid=0x34e48400 nid=0xf64 waiting for monitor entry [0x3569f000] + java.lang.Thread.State: BLOCKED (on object monitor) + at com.intellij.openapi.vfs.impl.local.FileWatcher.getDirtyPaths(FileWatcher.java:114) + - waiting to lock <0x0595ae40> (a java.lang.Object) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl.b(LocalFileSystemImpl.java:189) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl.markSuspicousFilesDirty(LocalFileSystemImpl.java:230) + at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.scan(RefreshSessionImpl.java:86) + at com.intellij.openapi.vfs.newvfs.RefreshQueueImpl$1.run(RefreshQueueImpl.java:74) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) + at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) + at java.util.concurrent.FutureTask.run(FutureTask.java:138) + at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) + at java.lang.Thread.run(Thread.java:619) + +"XML-RPC Weblistener" prio=4 tid=0x34c0e400 nid=0x8dc runnable [0x35fdf000] + java.lang.Thread.State: RUNNABLE + at java.net.PlainSocketImpl.socketAccept(Native Method) + at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390) + - locked <0x05a73d90> (a java.net.SocksSocketImpl) + at java.net.ServerSocket.implAccept(ServerSocket.java:453) + at java.net.ServerSocket.accept(ServerSocket.java:421) + at org.apache.xmlrpc.WebServer.run(WebServer.java:453) + at java.lang.Thread.run(Thread.java:619) + +"Performance watcher" prio=2 tid=0x34d0c400 nid=0x8cc waiting on condition [0x35f8f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05a73eb8> (a java.util.concurrent.Semaphore$NonfairSync) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:947) + at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1239) + at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:383) + at com.intellij.diagnostic.PerformanceWatcher.c(PerformanceWatcher.java:158) + at com.intellij.diagnostic.PerformanceWatcher.access$100(PerformanceWatcher.java:42) + at com.intellij.diagnostic.PerformanceWatcher$2.run(PerformanceWatcher.java:116) + at java.lang.Thread.run(Thread.java:619) + +"ApplicationImpl pooled thread" prio=4 tid=0x34434400 nid=0x898 waiting on condition [0x35f3f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05337e08> (a java.util.concurrent.SynchronousQueue$TransferStack) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424) + at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323) + at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125) + +"StoreRefreshStatusThread" daemon prio=2 tid=0x34c1e400 nid=0x1dc waiting for monitor entry [0x353df000] + java.lang.Thread.State: BLOCKED (on object monitor) + at com.intellij.openapi.vfs.impl.local.FileWatcher.getDirtyPaths(FileWatcher.java:114) + - waiting to lock <0x0595ae40> (a java.lang.Object) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl.b(LocalFileSystemImpl.java:189) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl.access$200(LocalFileSystemImpl.java:43) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl$StoreRefreshStatusThread.run(LocalFileSystemImpl.java:297) + +"WatchForChangesThread" prio=6 tid=0x34a84800 nid=0x1c8 waiting for monitor entry [0x352bf000] + java.lang.Thread.State: BLOCKED (on object monitor) + at com.intellij.openapi.vfs.impl.local.FileWatcher.a(FileWatcher.java:185) + - waiting to lock <0x0595ae40> (a java.lang.Object) + at com.intellij.openapi.vfs.impl.local.FileWatcher.access$700(FileWatcher.java:49) + at com.intellij.openapi.vfs.impl.local.FileWatcher$WatchForChangesThread.run(FileWatcher.java:271) + +"AWT-EventQueue-1 9.0.3#IU-95.474, eap:false" prio=6 tid=0x34d52000 nid=0xc1c runnable [0x3547e000] + java.lang.Thread.State: RUNNABLE + at java.io.FileOutputStream.writeBytes(Native Method) + at java.io.FileOutputStream.write(FileOutputStream.java:260) + at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) + at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) + - locked <0x059661a8> (a java.io.BufferedOutputStream) + at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:278) + at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122) + - locked <0x059661d0> (a java.io.OutputStreamWriter) + at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212) + at java.io.BufferedWriter.flush(BufferedWriter.java:236) + - locked <0x059661d0> (a java.io.OutputStreamWriter) + at com.intellij.openapi.vfs.impl.local.FileWatcher.b(FileWatcher.java:344) + at com.intellij.openapi.vfs.impl.local.FileWatcher.setWatchRoots(FileWatcher.java:159) + - locked <0x0595ae40> (a java.lang.Object) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl$2.run(LocalFileSystemImpl.java:272) + at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:697) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl.c(LocalFileSystemImpl.java:255) + at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl.removeWatchedRoots(LocalFileSystemImpl.java:402) + at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.d(ProjectRootManagerImpl.java:669) + at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.c(ProjectRootManagerImpl.java:542) + at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.access$100(ProjectRootManagerImpl.java:70) + at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.fireChange(ProjectRootManagerImpl.java:135) + at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.rootsChanged(ProjectRootManagerImpl.java:148) + at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.makeRootsChange(ProjectRootManagerImpl.java:469) + at com.intellij.openapi.module.impl.ModuleManagerImpl.a(ModuleManagerImpl.java:894) + at com.intellij.openapi.module.impl.ModuleManagerImpl.access$2000(ModuleManagerImpl.java:73) + at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.commitWithRunnable(ModuleManagerImpl.java:800) + at com.intellij.openapi.module.impl.ModuleManagerImpl.commitModelWithRunnable(ModuleManagerImpl.java:567) + at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.multiCommit(ModuleRootManagerImpl.java:304) + at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.multiCommit(ProjectRootManagerImpl.java:242) + at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.commit(ModuleManagerImpl.java:796) + at com.intellij.ide.util.projectWizard.ModuleBuilder.createAndCommitIfNeeded(ModuleBuilder.java:152) + at com.intellij.ide.util.projectWizard.ModuleBuilder$2.compute(ModuleBuilder.java:202) + at com.intellij.ide.util.projectWizard.ModuleBuilder$2.compute(ModuleBuilder.java:199) + at com.intellij.openapi.application.impl.ApplicationImpl$11.run(ApplicationImpl.java:774) + at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:754) + at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:772) + at com.intellij.ide.util.projectWizard.ModuleBuilder.commitModule(ModuleBuilder.java:199) + at com.intellij.ide.util.projectWizard.ModuleBuilder.commit(ModuleBuilder.java:186) + at com.intellij.ide.impl.NewProjectUtil.createNewProject(NewProjectUtil.java:135) + at com.intellij.ide.actions.NewProjectAction.actionPerformed(NewProjectAction.java:29) + at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreen$ActionGroupDescriptor$3.onPress(WelcomeScreen.java:215) + at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreen$ButtonWithExtension.onPress(WelcomeScreen.java:829) + at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreen$ActionGroupDescriptor$2.mouseClicked(WelcomeScreen.java:151) + at java.awt.Component.processMouseEvent(Component.java:6266) + at javax.swing.JComponent.processMouseEvent(JComponent.java:3255) + at java.awt.Component.processEvent(Component.java:6028) + at java.awt.Container.processEvent(Container.java:2041) + at java.awt.Component.dispatchEventImpl(Component.java:4630) + at java.awt.Container.dispatchEventImpl(Container.java:2099) + at java.awt.Component.dispatchEvent(Component.java:4460) + at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) + at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247) + at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) + at java.awt.Container.dispatchEventImpl(Container.java:2085) + at java.awt.Window.dispatchEventImpl(Window.java:2475) + at java.awt.Component.dispatchEvent(Component.java:4460) + at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) + at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:627) + at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:504) + at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:405) + at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369) + at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) + at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) + at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) + at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) + at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) + at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) + +"timed reference disposer" prio=2 tid=0x34447400 nid=0xe18 waiting on condition [0x3538f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05605ef0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"Periodic tasks thread" prio=6 tid=0x34438400 nid=0x95c waiting on condition [0x349cf000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x05327fc0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"AWT-Shutdown" prio=6 tid=0x343e0c00 nid=0xce8 in Object.wait() [0x3526f000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + at java.lang.Object.wait(Object.java:485) + at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259) + - locked <0x052c79c0> (a java.lang.Object) + at java.lang.Thread.run(Thread.java:619) + +"SocketListenerThread" prio=2 tid=0x348df400 nid=0xcdc runnable [0x3521f000] + java.lang.Thread.State: RUNNABLE + at java.net.PlainDatagramSocketImpl.receive0(Native Method) + - locked <0x052ca190> (a java.net.PlainDatagramSocketImpl) + at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136) + - locked <0x052ca190> (a java.net.PlainDatagramSocketImpl) + at java.net.DatagramSocket.receive(DatagramSocket.java:712) + - locked <0x052ca1d0> (a java.net.DatagramPacket) + - locked <0x052ca1f0> (a java.net.MulticastSocket) + at com.intellij.a.e.a.e.a(e.java:57) + at com.intellij.a.e.a.f.run(f.java:25) + +"SocketListenerThread" prio=2 tid=0x34783800 nid=0xcd8 runnable [0x351cf000] + java.lang.Thread.State: RUNNABLE + at java.net.PlainDatagramSocketImpl.receive0(Native Method) + - locked <0x052cc9e0> (a java.net.PlainDatagramSocketImpl) + at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136) + - locked <0x052cc9e0> (a java.net.PlainDatagramSocketImpl) + at java.net.DatagramSocket.receive(DatagramSocket.java:712) + - locked <0x052cca20> (a java.net.DatagramPacket) + - locked <0x052cca40> (a java.net.DatagramSocket) + at com.intellij.a.e.a.e.a(e.java:57) + at com.intellij.a.e.a.f.run(f.java:25) + +"MessageDeliveryThread" prio=6 tid=0x34793400 nid=0xcd4 in Object.wait() [0x3517f000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + - waiting on <0x052ccaf0> (a java.lang.Object) + at java.lang.Object.wait(Object.java:485) + at com.intellij.a.e.i.run(i.java:26) + - locked <0x052ccaf0> (a java.lang.Object) + +"AWT-Windows" daemon prio=6 tid=0x34424800 nid=0xb88 runnable [0x34f9f000] + java.lang.Thread.State: RUNNABLE + at sun.awt.windows.WToolkit.eventLoop(Native Method) + at sun.awt.windows.WToolkit.run(WToolkit.java:291) + at java.lang.Thread.run(Thread.java:619) + +"Java2D Disposer" daemon prio=10 tid=0x348e4400 nid=0xb68 in Object.wait() [0x34eff000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) + - locked <0x052ccbc8> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) + at sun.java2d.Disposer.run(Disposer.java:125) + at java.lang.Thread.run(Thread.java:619) + +"Lock thread" prio=2 tid=0x34875400 nid=0x780 runnable [0x34a1f000] + java.lang.Thread.State: RUNNABLE + at java.net.PlainSocketImpl.socketAccept(Native Method) + at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390) + - locked <0x0523cc30> (a java.net.SocksSocketImpl) + at java.net.ServerSocket.implAccept(ServerSocket.java:453) + at java.net.ServerSocket.accept(ServerSocket.java:421) + at com.intellij.idea.SocketLock$MyRunnable.run(SocketLock.java:191) + at java.lang.Thread.run(Thread.java:619) + +"timed reference disposer" prio=2 tid=0x3476e400 nid=0xac4 waiting on condition [0x3497f000] + java.lang.Thread.State: TIMED_WAITING (parking) + at sun.misc.Unsafe.park(Native Method) + - parking to wait for <0x051e5ee8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) + at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) + at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963) + at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583) + at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576) + at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) + at java.lang.Thread.run(Thread.java:619) + +"Exe4JStartupThread" daemon prio=6 tid=0x34420800 nid=0xac0 waiting on condition [0x3472f000] + java.lang.Thread.State: TIMED_WAITING (sleeping) + at java.lang.Thread.sleep(Native Method) + at com.exe4j.Controller$StartupThread.run(Unknown Source) + +"Low Memory Detector" daemon prio=6 tid=0x343f2400 nid=0xa9c runnable [0x00000000] + java.lang.Thread.State: RUNNABLE + +"CompilerThread0" daemon prio=10 tid=0x343ec000 nid=0xa98 waiting on condition [0x00000000] + java.lang.Thread.State: RUNNABLE + +"Attach Listener" daemon prio=10 tid=0x343ea800 nid=0xa94 waiting on condition [0x00000000] + java.lang.Thread.State: RUNNABLE + +"Signal Dispatcher" daemon prio=10 tid=0x343e9400 nid=0xa90 runnable [0x00000000] + java.lang.Thread.State: RUNNABLE + +"Finalizer" daemon prio=8 tid=0x343da000 nid=0xa78 in Object.wait() [0x3454f000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) + - locked <0x051c0478> (a java.lang.ref.ReferenceQueue$Lock) + at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) + at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) + +"Reference Handler" daemon prio=10 tid=0x343d5400 nid=0xa74 in Object.wait() [0x344ff000] + java.lang.Thread.State: WAITING (on object monitor) + at java.lang.Object.wait(Native Method) + at java.lang.Object.wait(Object.java:485) + at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116) + - locked <0x051c00a8> (a java.lang.ref.Reference$Lock) + +"main" prio=6 tid=0x003c7c00 nid=0x944 waiting on condition [0x00000000] + java.lang.Thread.State: RUNNABLE + +"VM Thread" prio=10 tid=0x343d1400 nid=0xa70 runnable + +"VM Periodic Task Thread" prio=10 tid=0x3440dc00 nid=0xabc waiting on condition + +JNI global references: 2764 \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AdvHighlightingJdk7Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AdvHighlightingJdk7Test.java index ae55eef24b47..192349c6d68c 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AdvHighlightingJdk7Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AdvHighlightingJdk7Test.java @@ -132,4 +132,57 @@ public class AdvHighlightingJdk7Test extends DaemonAnalyzerTestCase { public void testAmbiguousMultipleTypeParamExtends3() throws Exception { doTestAmbiguous(); } + + public void testAmbiguousIDEA57317() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA57278() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA57269() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA67573() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA57306() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA57535() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA67832() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA67837() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA78027() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA25097() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA24768() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA21660() throws Exception { + doTestAmbiguous(); + } + + public void testAmbiguousIDEA22547() throws Exception { + doTestAmbiguous(); + } + } diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java index eaf27dcceccf..71f07757ffec 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java @@ -39,6 +39,8 @@ public class RedundantCast15Test extends InspectionTestCase { public void testRawCast() throws Exception { doTest();} public void testRawCastsToAvoidIncompatibility() throws Exception { doTest();} + + public void testIDEA22899() throws Exception { doTest();} public void testTypeParameterAccessChecksJava7() throws Exception { final JavaVersionServiceImpl versionService = (JavaVersionServiceImpl)JavaVersionService.getInstance(); diff --git a/java/java-tests/testSrc/com/intellij/unscramble/UnscrambleDialogTest.java b/java/java-tests/testSrc/com/intellij/unscramble/UnscrambleDialogTest.java new file mode 100644 index 000000000000..e49823ecdd76 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/unscramble/UnscrambleDialogTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2000-2012 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.intellij.unscramble; + +import com.intellij.JavaTestUtil; +import com.intellij.execution.ui.RunContentDescriptor; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase; + +import javax.swing.*; +import java.io.File; + +/** + * @author Dmitry Avdeev + * Date: 4/9/12 + */ +public class UnscrambleDialogTest extends JavaCodeInsightFixtureTestCase { + + public void testStacktrace() throws Exception { + RunContentDescriptor content = showText(""); + Icon icon = content.getIcon(); + String name = content.getDisplayName(); + assertEquals(null, icon); + assertEquals("", name); + } + + public void testException() throws Exception { + RunContentDescriptor content = showText("java.lang.NullPointerException\n" + + "\tat com.intellij.psi.css.resolve.impl.XhtmlFileInfo.findOneStyleSheet(XhtmlFileInfo.java:291)\n" + + "\tat com.intellij.psi.css.resolve.impl.XhtmlFileInfo.getStylesheets(XhtmlFileInfo.java:174)\n" + + "\tat com.intellij.psi.css.resolve.impl.XhtmlFileInfo.initStylesheets(XhtmlFileInfo.java:119)"); + assertIcon("exception.png", content.getIcon()); + assertEquals("NPE", content.getDisplayName()); + } + + public void testThreadDump() throws Exception { + File file = new File(getTestDataPath() + "threaddump.txt"); + String s = FileUtil.loadFile(file); + RunContentDescriptor content = showText(s); + assertIcon("threaddump.png", content.getIcon()); + assertEquals("", content.getDisplayName()); + } + + public void testDeadlock() throws Exception { + File file = new File(getTestDataPath() + "deadlock.txt"); + String s = FileUtil.loadFile(file); + RunContentDescriptor content = showText(s); + assertIcon("killProcess.png", content.getIcon()); + assertEquals("", content.getDisplayName()); + } + + private RunContentDescriptor showText(String unscramble) { + RunContentDescriptor descriptor = UnscrambleDialog.showUnscrambledText(null, "foo", getProject(), unscramble); + assertNotNull(descriptor); + return descriptor; + } + + private static void assertIcon(String s, Icon icon) { + assertTrue(icon.toString().contains(s)); + } + + @Override + protected String getBasePath() { + return JavaTestUtil.getRelativeJavaTestDataPath() + "/unscramble/"; + } +} diff --git a/platform/icons/src/debugger/threadStates/exception.png b/platform/icons/src/debugger/threadStates/exception.png new file mode 100644 index 000000000000..86fb98603273 Binary files /dev/null and b/platform/icons/src/debugger/threadStates/exception.png differ diff --git a/platform/icons/src/debugger/threadStates/threaddump.png b/platform/icons/src/debugger/threadStates/threaddump.png new file mode 100644 index 000000000000..f26812b6d6d0 Binary files /dev/null and b/platform/icons/src/debugger/threadStates/threaddump.png differ diff --git a/platform/lang-api/src/com/intellij/lang/folding/CustomFoldingBuilder.java b/platform/lang-api/src/com/intellij/lang/folding/CustomFoldingBuilder.java index 689ad61035da..7f7567838869 100644 --- a/platform/lang-api/src/com/intellij/lang/folding/CustomFoldingBuilder.java +++ b/platform/lang-api/src/com/intellij/lang/folding/CustomFoldingBuilder.java @@ -70,7 +70,7 @@ public abstract class CustomFoldingBuilder extends FoldingBuilderEx implements D ASTNode startNode = localFoldingStack.pop(); int startOffset = startNode.getTextRange().getStartOffset(); TextRange range = new TextRange(startOffset, child.getTextRange().getEndOffset()); - descriptors.add(new FoldingDescriptor(localFoldingStack.getOwner(), range)); + descriptors.add(new FoldingDescriptor(startNode, range)); } } else { @@ -83,15 +83,11 @@ public abstract class CustomFoldingBuilder extends FoldingBuilderEx implements D @Override public final String getPlaceholderText(@NotNull ASTNode node, @NotNull TextRange range) { - if (isCustomFoldingRoot(node)) { - PsiFile file = node.getPsi().getContainingFile(); - PsiElement contextElement = file.findElementAt(range.getStartOffset()); - if (contextElement != null && isCustomFoldingCandidate(contextElement.getNode())) { - String elementText = contextElement.getText(); - CustomFoldingProvider defaultProvider = getDefaultProvider(elementText); - if (defaultProvider != null && defaultProvider.isCustomRegionStart(elementText)) { - return defaultProvider.getPlaceholderText(elementText); - } + if (isCustomFoldingCandidate(node)) { + String elementText = node.getText(); + CustomFoldingProvider defaultProvider = getDefaultProvider(elementText); + if (defaultProvider != null && defaultProvider.isCustomRegionStart(elementText)) { + return defaultProvider.getPlaceholderText(elementText); } } return getLanguagePlaceholderText(node, range); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPass.java index a6851fcd940d..07d4c0672e26 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LineMarkersPass.java @@ -204,13 +204,14 @@ public class LineMarkersPass extends ProgressableTextEditorHighlightingPass impl final List injectedMarkers = new ArrayList(); final Set injectedFiles = new THashSet(); - for (PsiElement element : elements) { - InjectedLanguageUtil.enumerate(element, file, false, new PsiLanguageInjectionHost.InjectedPsiVisitor() { - @Override - public void visit(@NotNull final PsiFile injectedPsi, @NotNull List places) { - injectedFiles.add(injectedPsi); - } - }); + final PsiLanguageInjectionHost.InjectedPsiVisitor collectingVisitor = new PsiLanguageInjectionHost.InjectedPsiVisitor() { + @Override + public void visit(@NotNull final PsiFile injectedPsi, @NotNull List places) { + injectedFiles.add(injectedPsi); + } + }; + for (int i = 0, size = elements.size(); i < size; ++i) { + InjectedLanguageUtil.enumerate(elements.get(i), file, false, collectingVisitor); } for (PsiFile injectedPsi : injectedFiles) { final Project project = injectedPsi.getProject(); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java index cf27e5dd59ee..8097af612960 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java @@ -120,6 +120,10 @@ public abstract class RefElementImpl extends RefEntityImpl implements RefElement return myID.getContainingFile(); } + public VirtualFile getVirtualFile() { + return myID.getVirtualFile(); + } + public SmartPsiElementPointer getPointer() { return myID; } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java index 626490265606..237013f22e76 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java @@ -36,8 +36,8 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.PathMacroManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.extensions.ExtensionPoint; +import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectUtil; @@ -49,6 +49,7 @@ import com.intellij.psi.*; import com.intellij.psi.impl.light.LightElement; import com.intellij.util.concurrency.JBReentrantReadWriteLock; import com.intellij.util.concurrency.LockFactory; +import com.intellij.util.containers.ContainerUtil; import gnu.trove.THashMap; import org.jdom.Element; import org.jetbrains.annotations.Nullable; @@ -101,8 +102,7 @@ public class RefManagerImpl extends RefManager { public void iterate(RefVisitor visitor) { myLock.readLock().lock(); try { - final THashMap refTable = getRefTable(); - for (RefElement refElement : refTable.values()) { + for (RefElement refElement : getSortedElements()) { refElement.accept(visitor); } if (myModules != null) { @@ -303,6 +303,21 @@ public class RefManagerImpl extends RefManager { return myRefTable; } + public ArrayList getSortedElements() { + ArrayList answer = new ArrayList(myRefTable.values()); + ContainerUtil.quickSort(answer, new Comparator() { + @Override + public int compare(RefElement o1, RefElement o2) { + VirtualFile v1 = ((RefElementImpl)o1).getVirtualFile(); + VirtualFile v2 = ((RefElementImpl)o2).getVirtualFile(); + + return (v1 != null ? v1.hashCode() : 0) - (v2 != null ? v2.hashCode() : 0); + } + }); + + return answer; + } + @Override public PsiManager getPsiManager() { return myPsiManager; diff --git a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceDialog.java b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceDialog.java index b901d97e4fb2..ce890e94a710 100644 --- a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceDialog.java +++ b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceDialog.java @@ -16,7 +16,6 @@ package com.intellij.unscramble; -import com.intellij.execution.ui.ConsoleView; import com.intellij.ide.IdeBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; @@ -49,9 +48,7 @@ public class AnalyzeStacktraceDialog extends DialogWrapper { @Override protected void doOKAction() { - final ConsoleView consoleView = AnalyzeStacktraceUtil.addConsole(myProject, null, ""); - consoleView.allowHeavyFilters(); - AnalyzeStacktraceUtil.printStacktrace(consoleView, myEditorPanel.getText()); + AnalyzeStacktraceUtil.addConsole(myProject, null, "", myEditorPanel.getText()); super.doOKAction(); } diff --git a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java index c78d56646833..64531553b5c0 100644 --- a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java +++ b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java @@ -17,7 +17,6 @@ package com.intellij.unscramble; import com.intellij.diagnostic.IdeErrorsDialog; -import com.intellij.execution.ui.ConsoleView; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.DataContext; @@ -37,9 +36,7 @@ public class AnalyzeStacktraceOnErrorAction extends AnAction { final String message = IdeErrorsDialog.CURRENT_TRACE_KEY.getData(dataContext); if (message != null) { - final ConsoleView consoleView = AnalyzeStacktraceUtil.addConsole(project, null, ""); - consoleView.allowHeavyFilters(); - AnalyzeStacktraceUtil.printStacktrace(consoleView, message); + AnalyzeStacktraceUtil.addConsole(project, null, "", message); } } } \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java index 553f9fc524ad..a094599f2c14 100644 --- a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java +++ b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java @@ -82,7 +82,15 @@ public class AnalyzeStacktraceUtil { JComponent createConsoleComponent(ConsoleView consoleView, DefaultActionGroup toolbarActions); } - public static ConsoleView addConsole(Project project, @Nullable ConsoleFactory consoleFactory, final String tabTitle) { + public static void addConsole(Project project, @Nullable ConsoleFactory consoleFactory, final String tabTitle, String text) { + addConsole(project, consoleFactory, tabTitle, text, null); + } + + public static RunContentDescriptor addConsole(Project project, + @Nullable ConsoleFactory consoleFactory, + final String tabTitle, + String text, + @Nullable Icon icon) { final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project); for(Filter filter: Extensions.getExtensions(EP_NAME, project)) { builder.addFilter(filter); @@ -94,7 +102,7 @@ public class AnalyzeStacktraceUtil { ? consoleFactory.createConsoleComponent(consoleView, toolbarActions) : new MyConsolePanel(consoleView, toolbarActions); final RunContentDescriptor descriptor = - new RunContentDescriptor(consoleView, null, consoleComponent, tabTitle) { + new RunContentDescriptor(consoleView, null, consoleComponent, tabTitle, icon) { public boolean isContentReuseProhibited() { return true; } @@ -106,7 +114,9 @@ public class AnalyzeStacktraceUtil { toolbarActions.add(action); } ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor); - return consoleView; + consoleView.allowHeavyFilters(); + printStacktrace(consoleView, text); + return descriptor; } private static final class MyConsolePanel extends JPanel { diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java index b297fd94ce71..f292d06c58cf 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java @@ -439,14 +439,14 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener, if (column < 0) { if (debugBuffer != null) { - debugBuffer.append("Resetting target logical column to zero as it is negative (" + column + ")\n"); + debugBuffer.append("Resetting target logical column to zero as it is negative (").append(column).append(")\n"); } column = 0; softWrapColumns = 0; } if (line < 0) { if (debugBuffer != null) { - debugBuffer.append("Resetting target logical line to zero as it is negative (" + line + ")\n"); + debugBuffer.append("Resetting target logical line to zero as it is negative (").append(line).append(")\n"); } line = 0; softWrapLinesBefore = 0; diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java index dba1b9312b1e..f1261dc06d11 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -15,9 +15,11 @@ */ package com.intellij.openapi.editor.impl.softwrap.mapping; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.editor.ex.FoldingModelEx; +import com.intellij.openapi.editor.impl.EditorImpl; import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper; import com.intellij.openapi.editor.impl.softwrap.SoftWrapDataMapper; import com.intellij.openapi.editor.impl.softwrap.SoftWrapImpl; @@ -54,7 +56,8 @@ import java.util.List; * @since Aug 31, 2010 10:24:47 AM */ public class CachingSoftWrapDataMapper implements SoftWrapDataMapper, SoftWrapAwareDocumentParsingListener { - + + private static final Logger LOG = Logger.getInstance("#" + CachingSoftWrapDataMapper.class.getName()); private static final boolean DEBUG_SOFT_WRAP_PROCESSING = false; /** Caches information for the document visual line starts sorted in ascending order. */ @@ -445,6 +448,30 @@ public class CachingSoftWrapDataMapper implements SoftWrapDataMapper, SoftWrapAw myCache.addAll(myNotAffectedByUpdateTailCacheEntries); } applyStateChange(exactOffsetsDiff); + + // TODO den remove before v.12 release + if (myCache.size() > 1) { + CacheEntry beforeLast = myCache.get(myCache.size() - 2); + CacheEntry last = myCache.get(myCache.size() - 1); + if (beforeLast.visualLine == last.visualLine + || (beforeLast.visualLine + 1 == last.visualLine && last.startOffset - beforeLast.endOffset > 1) + || last.startOffset > myEditor.getDocument().getTextLength()) + { + CharSequence editorState = ""; + if (myEditor instanceof EditorImpl) { + editorState = ((EditorImpl)myEditor).dumpState(); + } + LOG.error( + "Detected invalid soft wraps cache update", + String.format( + "Event: %s, normal: %b.%n%nTail cache entries: %s%n%nAffected by change cache entries: %s%n%nBefore change state: %s%n%n" + + "After change state: %s%n%nEditor state: %s", + event, normal, myNotAffectedByUpdateTailCacheEntries, myAffectedByUpdateCacheEntries, + myBeforeChangeState, myAfterChangeState, editorState + ) + ); + } + } myAffectedByUpdateCacheEntries.clear(); myNotAffectedByUpdateTailCacheEntries.clear(); @@ -610,14 +637,24 @@ public class CachingSoftWrapDataMapper implements SoftWrapDataMapper, SoftWrapAw public void rawAdd(int visualLine, int startOffset, int endOffset, + int startLogicalLine, + int startLogicalColumn, + int endLogicalLine, + int endLogicalColumn, + int endVisualColumn, @NotNull List> foldRegions, @NotNull List> tabData) { final CacheEntry entry = new CacheEntry(visualLine, myEditor, myRepresentationHelper); entry.startOffset = startOffset; entry.endOffset = endOffset; - entry.startLogicalLine = myEditor.getDocument().getLineNumber(startOffset); - entry.endLogicalLine = myEditor.getDocument().getLineNumber(endOffset); + entry.startLogicalLine = startLogicalLine; + assert startLogicalLine == myEditor.getDocument().getLineNumber(startOffset); + entry.startLogicalColumn = startLogicalColumn; + entry.endLogicalLine = endLogicalLine; + assert endLogicalLine == myEditor.getDocument().getLineNumber(endOffset); + entry.endLogicalColumn = endLogicalColumn; + entry.endVisualColumn = endVisualColumn; for (Trinity region : foldRegions) { final FoldingData foldData = new FoldingData(region.third, region.second, myRepresentationHelper, myEditor); foldData.widthInColumns = region.first; diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java index 7dda0f628068..a697360556e0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java @@ -107,24 +107,27 @@ public class FileChooserDialogImpl extends DialogWrapper implements FileChooserD @Override @NotNull public VirtualFile[] choose(@Nullable VirtualFile toSelect, Project project) { - prepareAndShow(toSelect != null ? toSelect : null, project); + if (myProject == null && project != null) { + myProject = project; + } + + prepareAndShow(toSelect); return myChosenFiles; } @Override public void choose(@Nullable VirtualFile toSelect, @NotNull Consumer> callback) { - prepareAndShow(toSelect, myProject); + prepareAndShow(toSelect); if (myChosenFiles.length > 0) { callback.consume(Arrays.asList(myChosenFiles)); } } - private void prepareAndShow(@Nullable VirtualFile toSelect, @Nullable Project project) { - if (myProject == null && project != null) myProject = project; + private void prepareAndShow(@Nullable VirtualFile toSelect) { init(); final VirtualFile lastOpenedFile = FileChooserUtil.getLastOpenedFile(myProject); - final VirtualFile file = FileChooserUtil.getFileToSelect(myChooserDescriptor, project, toSelect, lastOpenedFile); + final VirtualFile file = FileChooserUtil.getFileToSelect(myChooserDescriptor, myProject, toSelect, lastOpenedFile); if (file != null && file.isValid()) { myFileSystemTree.select(file, new Runnable() { diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java index d53700671fe3..463ef5e83d8f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java @@ -349,10 +349,10 @@ public final class ToolWindowImpl implements ToolWindowEx { public final void setIcon(final Icon icon) { ApplicationManager.getApplication().assertIsDispatchThread(); - if (!(icon instanceof LayeredIcon) && (icon.getIconHeight() != 13 || icon.getIconWidth() != 13)) { + final Icon oldIcon = getIcon(); + if (oldIcon != icon && !(icon instanceof LayeredIcon) && (icon.getIconHeight() != 13 || icon.getIconWidth() != 13)) { LOG.warn("ToolWindow icons should be 13x13. Please fix " + icon); } - final Icon oldIcon = getIcon(); getSelectedContent().setIcon(icon); myIcon = icon; myChangeSupport.firePropertyChange(PROP_ICON, oldIcon, icon); diff --git a/platform/platform-impl/src/com/intellij/platform/DirectoryProjectGeneratorProductAware.java b/platform/platform-impl/src/com/intellij/platform/DirectoryProjectGeneratorProductAware.java new file mode 100644 index 000000000000..fbd7de87468c --- /dev/null +++ b/platform/platform-impl/src/com/intellij/platform/DirectoryProjectGeneratorProductAware.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2012 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.intellij.platform; + +import org.jetbrains.annotations.NotNull; + +/** + * Inheritors of {@link DirectoryProjectGenerator} should implement this interface to be filtered out in some IDE. + * + * @author Sergey Simonchik + */ +public interface DirectoryProjectGeneratorProductAware { + + boolean isSuitableForProduct(@NotNull String productName); + +} diff --git a/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java b/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java index 5cec29164100..3c03777fe5c6 100644 --- a/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java +++ b/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java @@ -58,6 +58,10 @@ import java.awt.image.BufferedImage; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; +import static java.awt.event.KeyEvent.KEY_PRESSED; +import static java.awt.event.MouseEvent.MOUSE_CLICKED; +import static java.awt.event.MouseEvent.MOUSE_PRESSED; + public class BalloonImpl implements Balloon, IdeTooltip.Ui { private MyComponent myComp; @@ -78,45 +82,49 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui { private CloseButton myCloseRec; private final AWTEventListener myAwtActivityListener = new AWTEventListener() { - public void eventDispatched(final AWTEvent event) { - if (myHideOnMouse && - (event.getID() == MouseEvent.MOUSE_PRESSED)) { - final MouseEvent me = (MouseEvent)event; - if (isInsideBalloon(me)) return; + public void eventDispatched(final AWTEvent e) { + final int id = e.getID(); + if (e instanceof MouseEvent) { + final MouseEvent me = (MouseEvent)e; + final boolean insideBalloon = isInsideBalloon(me); - hide(); - return; - } - - if (myClickHandler != null && event.getID() == MouseEvent.MOUSE_CLICKED) { - final MouseEvent me = (MouseEvent)event; - if (!(me.getComponent() instanceof CloseButton) && isInsideBalloon(me)) { - myClickHandler.actionPerformed(new ActionEvent(BalloonImpl.this, ActionEvent.ACTION_PERFORMED, "click", me.getModifiersEx())); - if (myCloseOnClick) { + if (myHideOnMouse && id == MOUSE_PRESSED) { + if (!insideBalloon) { hide(); - return; + } + return; + } + + if (myClickHandler != null && id == MOUSE_CLICKED) { + if (!(me.getComponent() instanceof CloseButton) && insideBalloon) { + myClickHandler.actionPerformed(new ActionEvent(BalloonImpl.this, ActionEvent.ACTION_PERFORMED, "click", me.getModifiersEx())); + if (myCloseOnClick) { + hide(); + return; + } } } - } - if (myEnableCloseButton && event.getID() == MouseEvent.MOUSE_MOVED) { - final MouseEvent me = (MouseEvent)event; - final boolean inside = isInsideBalloon(me); - final boolean moveChanged = inside != myLastMoveWasInsideBalloon; - myLastMoveWasInsideBalloon = inside; - if (moveChanged) { - myComp.repaintButton(); + if (myEnableCloseButton && id == MouseEvent.MOUSE_MOVED) { + final boolean moveChanged = insideBalloon != myLastMoveWasInsideBalloon; + myLastMoveWasInsideBalloon = insideBalloon; + if (moveChanged) { + myComp.repaintButton(); + } + } + + if (UIUtil.isCloseClick((MouseEvent)e)) { + hide(); + return; } } - if (event instanceof MouseEvent && UIUtil.isCloseClick((MouseEvent)event)) { - hide(); - return; - } - - if (myHideOnKey && (event.getID() == KeyEvent.KEY_PRESSED)) { - final KeyEvent ke = (KeyEvent)event; - if (ke.getKeyCode() != KeyEvent.VK_SHIFT && ke.getKeyCode() != KeyEvent.VK_CONTROL && ke.getKeyCode() != KeyEvent.VK_ALT && ke.getKeyCode() != KeyEvent.VK_META) { + if (myHideOnKey && e instanceof KeyEvent && id == KEY_PRESSED) { + final KeyEvent ke = (KeyEvent)e; + if (ke.getKeyCode() != KeyEvent.VK_SHIFT && + ke.getKeyCode() != KeyEvent.VK_CONTROL && + ke.getKeyCode() != KeyEvent.VK_ALT && + ke.getKeyCode() != KeyEvent.VK_META) { if (SwingUtilities.isDescendingFrom(ke.getComponent(), myComp) || ke.getComponent() == myComp) return; hide(); } @@ -524,6 +532,22 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui { myLayeredPane.add(myComp); myLayeredPane.setLayer(myComp, getLayer()); myPosition.updateBounds(this); + myComp.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + e.consume(); + } + + @Override + public void mousePressed(MouseEvent e) { + e.consume(); + } + + @Override + public void mouseReleased(MouseEvent e) { + e.consume(); + } + }); } diff --git a/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java b/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java index 9b1bb94b3dbc..b29031c6ed37 100644 --- a/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java +++ b/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java @@ -36,8 +36,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.io.File; -import java.util.ArrayList; -import java.util.Collections; +import java.util.*; import java.util.List; /** @@ -47,12 +46,11 @@ import java.util.List; public class MacFileChooserDialogImpl implements PathChooserDialog { private static final int OK = 1; - private static VirtualFile ourLastPath = null; - private static FileChooserDescriptor myChooserDescriptor; - private static List myResultPaths = null; - private static Consumer> myCallback = null; - private static Consumer> myCallbackCandidate = null; - private Project myProject; + private static final Map ourImplMap = new HashMap(2); + + private final FileChooserDescriptor myChooserDescriptor; + private final Project myProject; + private Consumer> myCallback; private static final Callback SHOULD_ENABLE_URL = new Callback() { @SuppressWarnings("UnusedDeclaration") @@ -61,6 +59,7 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { } }; + /* private static final Callback SHOULD_SHOW_FILENAME_CALLBACK = new Callback() { @SuppressWarnings("UnusedDeclaration") public boolean callback(ID self, String selector, ID panel, ID filename) { @@ -82,11 +81,12 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { return virtualFile == null || (!virtualFile.isDirectory() || myChooserDescriptor.isFileSelectable(virtualFile)); } }; + */ private static final Callback OPEN_PANEL_DID_END = new Callback() { @SuppressWarnings("UnusedDeclaration") public void callback(ID self, String selector, ID openPanelDidEnd, ID returnCode, ID contextInfo) { - processResult(returnCode, openPanelDidEnd); + final MacFileChooserDialogImpl impl = ourImplMap.remove(self); try { //noinspection SSBasedInspection @@ -98,50 +98,50 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { } } }); - if (myResultPaths != null && myResultPaths.size() > 0) { - final List paths = myResultPaths; - final Consumer> callback = myCallback; + + final List resultPaths = processResult(returnCode, openPanelDidEnd); + if (resultPaths.size() > 0) { //noinspection SSBasedInspection SwingUtilities.invokeLater(new Runnable() { public void run() { - final List files = getChosenFiles(paths); + final List files = getChosenFiles(resultPaths); if (files.size() > 0) { - setLastSelectedPath(files.get(0)); - callback.consume(files); + FileChooserUtil.setLastOpenedFile(impl.myProject, files.get(files.size() - 1)); + impl.myCallback.consume(files); } } }); } } finally { - myResultPaths = null; - myCallback = null; + Foundation.cfRelease(self); } - - Foundation.cfRelease(self); } }; - private static void processResult(final ID result, final ID panel) { - final List resultFiles = new ArrayList(); + @NotNull + private static List processResult(final ID result, final ID panel) { + final List resultPaths = new ArrayList(); + if (result != null && OK == result.intValue()) { - ID fileNamesArray = invoke(panel, "filenames"); - ID enumerator = invoke(fileNamesArray, "objectEnumerator"); + final ID fileNamesArray = invoke(panel, "filenames"); + final ID enumerator = invoke(fileNamesArray, "objectEnumerator"); while (true) { final ID filename = invoke(enumerator, "nextObject"); if (filename == null || 0 == filename.intValue()) break; - String s = Foundation.toStringViaUTF8(filename); - if (s != null) { - resultFiles.add(s); + final String path = Foundation.toStringViaUTF8(filename); + if (path != null) { + resultPaths.add(path); } } - - myResultPaths = resultFiles; } + + return resultPaths; } + @NotNull private static List getChosenFiles(final List paths) { if (paths == null || paths.size() == 0) return Collections.emptyList(); @@ -158,21 +158,19 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { return files; } - private static void setLastSelectedPath(final VirtualFile selectedPath) { - ourLastPath = selectedPath; - } - private static final Callback MAIN_THREAD_RUNNABLE = new Callback() { @SuppressWarnings("UnusedDeclaration") public void callback(ID self, String selector, ID toSelect) { final ID nsOpenPanel = Foundation.getObjcClass("NSOpenPanel"); final ID chooser = invoke(nsOpenPanel, "openPanel"); + final FileChooserDescriptor chooserDescriptor = ourImplMap.get(self).myChooserDescriptor; + invoke(chooser, "setPrompt:", Foundation.nsString("Choose")); - invoke(chooser, "setCanChooseFiles:", myChooserDescriptor.isChooseFiles() || myChooserDescriptor.isChooseJars()); - invoke(chooser, "setCanChooseDirectories:", myChooserDescriptor.isChooseFolders()); - invoke(chooser, "setAllowsMultipleSelection:", myChooserDescriptor.isChooseMultiple()); - invoke(chooser, "setTreatsFilePackagesAsDirectories:", myChooserDescriptor.isChooseFolders()); + invoke(chooser, "setCanChooseFiles:", chooserDescriptor.isChooseFiles() || chooserDescriptor.isChooseJars()); + invoke(chooser, "setCanChooseDirectories:", chooserDescriptor.isChooseFolders()); + invoke(chooser, "setAllowsMultipleSelection:", chooserDescriptor.isChooseMultiple()); + invoke(chooser, "setTreatsFilePackagesAsDirectories:", chooserDescriptor.isChooseFolders()); if (Foundation.isClassRespondsToSelector(nsOpenPanel, Foundation.createSelector("setCanCreateDirectories:"))) { invoke(chooser, "setCanCreateDirectories:", true); @@ -181,7 +179,7 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { invoke(chooser, "_setIncludeNewFolderButton:", true); } - final Boolean showHidden = myChooserDescriptor.getUserData(PathChooserDialog.NATIVE_MAC_CHOOSER_SHOW_HIDDEN_FILES); + final Boolean showHidden = chooserDescriptor.getUserData(PathChooserDialog.NATIVE_MAC_CHOOSER_SHOW_HIDDEN_FILES); if (Boolean.TRUE.equals(showHidden) || Registry.is("ide.mac.filechooser.showhidden.files")) { if (Foundation.isClassRespondsToSelector(nsOpenPanel, Foundation.createSelector("setShowsHiddenFiles:"))) { invoke(chooser, "setShowsHiddenFiles:", true); @@ -205,7 +203,7 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { } ID types = null; - if (!myChooserDescriptor.isChooseFiles() && myChooserDescriptor.isChooseJars()) { + if (!chooserDescriptor.isChooseFiles() && chooserDescriptor.isChooseJars()) { types = invoke("NSArray", "arrayWithObject:", Foundation.nsString("jar")); } @@ -221,7 +219,6 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { final ID focusedWindow = MacUtil.findWindowForTitle(activeWindowTitle); if (focusedWindow != null) { - myCallback = myCallbackCandidate; invoke(chooser, "beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:", directory, file, types, focusedWindow, self, Foundation.createSelector("openPanelDidEnd:returnCode:contextInfo:"), null); } @@ -233,12 +230,12 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { static { final ID delegate = Foundation.allocateObjcClassPair(Foundation.getObjcClass("NSObject"), "NSOpenPanelDelegate_"); - if (!Foundation.addMethod(delegate, Foundation.createSelector("panel:shouldShowFilename:"), SHOULD_SHOW_FILENAME_CALLBACK, "B*")) { - throw new RuntimeException("Unable to add method to objective-c delegate class!"); - } - if (!Foundation.addMethod(delegate, Foundation.createSelector("panel:isValidFilename:"), IS_VALID_FILENAME_CALLBACK, "B*")) { - throw new RuntimeException("Unable to add method to objective-c delegate class!"); - } + //if (!Foundation.addMethod(delegate, Foundation.createSelector("panel:shouldShowFilename:"), SHOULD_SHOW_FILENAME_CALLBACK, "B*")) { + // throw new RuntimeException("Unable to add method to objective-c delegate class!"); + //} + //if (!Foundation.addMethod(delegate, Foundation.createSelector("panel:isValidFilename:"), IS_VALID_FILENAME_CALLBACK, "B*")) { + // throw new RuntimeException("Unable to add method to objective-c delegate class!"); + //} if (!Foundation.addMethod(delegate, Foundation.createSelector("showOpenPanel:"), MAIN_THREAD_RUNNABLE, "v*")) { throw new RuntimeException("Unable to add method to objective-c delegate class!"); } @@ -251,23 +248,23 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { Foundation.registerObjcClassPair(delegate); } - public MacFileChooserDialogImpl(@NotNull FileChooserDescriptor chooserDescriptor, Project project) { + public MacFileChooserDialogImpl(@NotNull final FileChooserDescriptor chooserDescriptor, final Project project) { myChooserDescriptor = chooserDescriptor; myProject = project; } @Override public void choose(@Nullable final VirtualFile toSelect, @NotNull final Consumer> callback) { - assert myCallback == null : "Current native file chooser should finish before next usage!"; - myCallbackCandidate = callback; + myCallback = callback; - final VirtualFile selectFile = FileChooserUtil.getFileToSelect(myChooserDescriptor, myProject, toSelect, ourLastPath); + final VirtualFile lastOpenedFile = FileChooserUtil.getLastOpenedFile(myProject); + final VirtualFile selectFile = FileChooserUtil.getFileToSelect(myChooserDescriptor, myProject, toSelect, lastOpenedFile); final String selectPath = selectFile != null ? FileUtil.toSystemDependentName(selectFile.getPath()) : null; //noinspection SSBasedInspection SwingUtilities.invokeLater(new Runnable() { public void run() { - showNativeChooserAsSheet(selectPath); + showNativeChooserAsSheet(MacFileChooserDialogImpl.this, selectPath); } }); } @@ -288,7 +285,7 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { return null; } - private static void showNativeChooserAsSheet(@Nullable final String toSelect) { + private static void showNativeChooserAsSheet(@NotNull final MacFileChooserDialogImpl impl, @Nullable final String toSelect) { final IdeMenuBar bar = getMenuBar(); if (bar != null) { bar.disableUpdates(); @@ -298,6 +295,7 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { try { final ID delegate = invoke(Foundation.getObjcClass("NSOpenPanelDelegate_"), "new"); Foundation.cfRetain(delegate); + ourImplMap.put(delegate, impl); final ID select = toSelect == null ? null : Foundation.nsString(toSelect); diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index 385e6447be7d..f021f1c46b61 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -857,7 +857,9 @@ unscramble.stacktrace.caption=Put a stack trace or a complete thread dump here: unscramble.dialog.title=Analyze Stacktrace unscramble.no.unscrambler.item= unscramble.normalize.button=&Normalize -unscramble.unscrambled.stacktrace.tab= +unscramble.unscrambled.stacktrace.tab= +unscramble.unscrambled.threaddump.tab= +unscramble.unscrambled.deadlock.tab= updates.info.dialog.title=Update Info updates.no.updates.message=

You are using the latest version of $FULLNAME$.

diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java index daeed2381f55..59b39a0f53c1 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -151,7 +151,8 @@ public abstract class AbstractEditorProcessingOnDocumentModificationTest extends protected static void setupSoftWraps(@NotNull String data) { Scanner scanner = new Scanner(data); Pattern generalPattern = - Pattern.compile("visual line: (\\d+), offsets: (\\d+)-(\\d+), fold regions: \\[([^\\]]*)\\], tab data: \\[([^\\]]*)\\]"); + Pattern.compile("visual line: (\\d+), offsets: (\\d+)-(\\d+), logical lines: (\\d+)-(\\d+), logical columns: (\\d+)-(\\d+), " + + "end visual column: (\\d+), fold regions: \\[([^\\]]*)\\], tab data: \\[([^\\]]*)\\]"); Pattern foldPattern = Pattern.compile("width in columns: (-?\\d+), start X: (-?\\d+), fold region: FoldRegion [-+]\\((\\d+):(\\d+)"); Pattern tabPattern = Pattern.compile("\\[(\\d+), width: (\\d+)"); final SoftWrapModelImpl softWrapModel = (SoftWrapModelImpl)myEditor.getSoftWrapModel(); @@ -163,9 +164,14 @@ public abstract class AbstractEditorProcessingOnDocumentModificationTest extends int visualLine = Integer.parseInt(generalMatch.group(1)); int startOffset = Integer.parseInt(generalMatch.group(2)); int endOffset = Integer.parseInt(generalMatch.group(3)); + int startLogicalLine = Integer.parseInt(generalMatch.group(4)); + int endLogicalLine = Integer.parseInt(generalMatch.group(5)); + int startLogicalColumn = Integer.parseInt(generalMatch.group(6)); + int endLogicalColumn = Integer.parseInt(generalMatch.group(7)); + int endVisualColumn = Integer.parseInt(generalMatch.group(8)); List> foldRegions = new ArrayList>(); - Scanner foldScanner = new Scanner(generalMatch.group(4)); + Scanner foldScanner = new Scanner(generalMatch.group(9)); while (foldScanner.findInLine(foldPattern) != null) { final MatchResult foldMatch = foldScanner.match(); int widthInColumns = Integer.parseInt(foldMatch.group(1)); @@ -183,7 +189,7 @@ public abstract class AbstractEditorProcessingOnDocumentModificationTest extends } List> tabData = new ArrayList>(); - Scanner tabScanner = new Scanner(generalMatch.group(5)); + Scanner tabScanner = new Scanner(generalMatch.group(10)); while (tabScanner.findInLine(tabPattern) != null) { final MatchResult tabMatch = tabScanner.match(); int offset = Integer.parseInt(tabMatch.group(1)); @@ -191,7 +197,7 @@ public abstract class AbstractEditorProcessingOnDocumentModificationTest extends tabData.add(new Pair(offset, widthInColumns)); } - mapper.rawAdd(visualLine, startOffset, endOffset, foldRegions, tabData); + mapper.rawAdd(visualLine, startOffset, endOffset, startLogicalLine, startLogicalColumn, endLogicalLine, endLogicalColumn, endVisualColumn, foldRegions, tabData); } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeVfsListener.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeVfsListener.java index 44db698385fb..91969e3058fe 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeVfsListener.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeVfsListener.java @@ -95,7 +95,7 @@ public class VcsDirtyScopeVfsListener implements ApplicationComponent, BulkFileL } } // and notify VCSDirtyScopeManager - dirtyFilesAndDirs.markDirty(); + markDirtyOnPooled(dirtyFilesAndDirs); } @Override @@ -126,12 +126,18 @@ public class VcsDirtyScopeVfsListener implements ApplicationComponent, BulkFileL } } // and notify VCSDirtyScopeManager - ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { - @Override - public void run() { - dirtyFilesAndDirs.markDirty(); - } - }); + markDirtyOnPooled(dirtyFilesAndDirs); + } + + private void markDirtyOnPooled(final FileAndDirsCollector dirtyFilesAndDirs) { + if (! dirtyFilesAndDirs.isEmpty()) { + ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { + @Override + public void run() { + dirtyFilesAndDirs.markDirty(); + } + }); + } } @Nullable @@ -202,6 +208,10 @@ public class VcsDirtyScopeVfsListener implements ApplicationComponent, BulkFileL manager.filePathsDirty(files, dirs); } } + + public boolean isEmpty() { + return map.isEmpty(); + } } /** @@ -213,13 +223,18 @@ public class VcsDirtyScopeVfsListener implements ApplicationComponent, BulkFileL private Collection getManagers(final VirtualFile file) { final Collection result = new HashSet(); if (file == null) { return result; } - final Collection projects = myProjectLocator.getProjectsForFile(file); - for (Project project : projects) { - final VcsDirtyScopeManager manager = VcsDirtyScopeManager.getInstance(project); - if (manager != null) { - result.add(manager); + ApplicationManager.getApplication().runReadAction(new Runnable() { + @Override + public void run() { + final Collection projects = myProjectLocator.getProjectsForFile(file); + for (Project project : projects) { + final VcsDirtyScopeManager manager = VcsDirtyScopeManager.getInstance(project); + if (manager != null) { + result.add(manager); + } + } } - } + }); return result; } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java index 775210e2f584..eec77ea709e5 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java @@ -75,10 +75,11 @@ public class VcsGuess { private Boolean isFileInIndex(@Nullable final FilePath filePath, final VirtualFile validParent) { return ApplicationManager.getApplication().runReadAction(new Computable() { public Boolean compute() { + if (myProject.isDisposed()) return false; final boolean inContent = myVcsManager.isFileInContent(validParent); if (inContent) return true; if (filePath != null) { - return isFileInBaseDir(filePath, myProject.getBaseDir()) && ! ! myExcludedFileIndex.isExcludedFile(validParent); + return isFileInBaseDir(filePath, myProject.getBaseDir()) && ! myExcludedFileIndex.isExcludedFile(validParent); } return false; } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/BreakpointEditor.form b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/BreakpointEditor.form index 9a239f002e6f..fb35252295f7 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/BreakpointEditor.form +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/BreakpointEditor.form @@ -1,7 +1,7 @@
- - + + @@ -10,7 +10,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java index b645f2f72254..f326c5893831 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java @@ -243,11 +243,12 @@ public class DebuggerUIUtil { editor.setPropertiesPanel(mainPanel); editor.setShowMoreOptionsLink(showMoreOptions != null); - final Balloon balloon = JBPopupFactory.getInstance(). - createDialogBalloonBuilder(editor.getMainPanel(), displayName). - setHideOnClickOutside(false). - setCloseButtonEnabled(false). - createBalloon(); + final Balloon balloon = JBPopupFactory.getInstance() + .createDialogBalloonBuilder(editor.getMainPanel(), null) + .setHideOnClickOutside(true) + .setCloseButtonEnabled(false) + .setAnimationCycle(0) + .createBalloon(); editor.setDelegate(new BreakpointEditor.Delegate() { @Override diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenConfigurationProducer.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenConfigurationProducer.java index 3b441b4f892b..96ee06d6aa66 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenConfigurationProducer.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenConfigurationProducer.java @@ -29,6 +29,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; +import org.jetbrains.idea.maven.project.MavenGeneralSettings; import org.jetbrains.idea.maven.project.MavenProjectsManager; import java.util.Collection; @@ -51,6 +52,7 @@ public class MavenConfigurationProducer extends RuntimeConfigurationProducer { myPsiElement = location.getPsiElement(); final MavenRunnerParameters params = createBuildParameters(location); if (params == null) return null; + return MavenRunConfigurationType.createRunnerAndConfigurationSettings(null, null, params, location.getProject()); } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java index ada6643b2e0d..5b5d05d1dea9 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java @@ -21,6 +21,7 @@ package org.jetbrains.idea.maven.execution; import com.intellij.execution.ExecutionException; import com.intellij.execution.configurations.JavaParameters; import com.intellij.execution.configurations.ParametersList; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.JavaSdk; import com.intellij.openapi.projectRoots.ProjectJdkTable; @@ -33,6 +34,7 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.maven.project.MavenGeneralSettings; +import org.jetbrains.idea.maven.project.MavenProjectsManager; import org.jetbrains.idea.maven.utils.MavenUtil; import java.io.File; @@ -48,11 +50,20 @@ public class MavenExternalParameters { @NonNls private static final String MAVEN_OPTS = "MAVEN_OPTS"; public static JavaParameters createJavaParameters(@Nullable final Project project, - final MavenRunnerParameters parameters, - final MavenGeneralSettings coreSettings, - final MavenRunnerSettings runnerSettings) throws ExecutionException { + @NotNull final MavenRunnerParameters parameters, + @Nullable MavenGeneralSettings coreSettings, + @Nullable MavenRunnerSettings runnerSettings) throws ExecutionException { final JavaParameters params = new JavaParameters(); + ApplicationManager.getApplication().assertReadAccessAllowed(); + + if (coreSettings == null) { + coreSettings = project == null ? new MavenGeneralSettings() : MavenProjectsManager.getInstance(project).getGeneralSettings(); + } + if (runnerSettings == null) { + runnerSettings = project == null ? new MavenRunnerSettings() : MavenRunner.getInstance(project).getState(); + } + params.setWorkingDirectory(parameters.getWorkingDirFile()); params.setJdk(getJdk(runnerSettings, project != null && MavenRunner.getInstance(project).getState() == runnerSettings)); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfiguration.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfiguration.java index e1d4762e25c3..19e4b7921352 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfiguration.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfiguration.java @@ -123,19 +123,21 @@ public class MavenRunConfiguration extends RunConfigurationBase implements Locat return Module.EMPTY_ARRAY; } + @Nullable public MavenGeneralSettings getGeneralSettings() { return mySettings.myGeneralSettings; } - public void setGeneralSettings(MavenGeneralSettings settings) { + public void setGeneralSettings(@Nullable MavenGeneralSettings settings) { mySettings.myGeneralSettings = settings; } + @Nullable public MavenRunnerSettings getRunnerSettings() { return mySettings.myRunnerSettings; } - public void setRunnerSettings(MavenRunnerSettings settings) { + public void setRunnerSettings(@Nullable MavenRunnerSettings settings) { mySettings.myRunnerSettings = settings; } @@ -155,8 +157,6 @@ public class MavenRunConfiguration extends RunConfigurationBase implements Locat mySettings = XmlSerializer.deserialize(mavenSettingsElement, MavenSettings.class); if (mySettings == null) mySettings = new MavenSettings(); - if (mySettings.myGeneralSettings == null) mySettings.myGeneralSettings = new MavenGeneralSettings(); - if (mySettings.myRunnerSettings == null) mySettings.myRunnerSettings = new MavenRunnerSettings(); if (mySettings.myRunnerParameters == null) mySettings.myRunnerParameters = new MavenRunnerParameters(); // fix old settings format @@ -193,13 +193,12 @@ public class MavenRunConfiguration extends RunConfigurationBase implements Locat } public MavenSettings(Project project) { - this(MavenProjectsManager.getInstance(project).getGeneralSettings(), MavenRunner.getInstance(project).getState(), - new MavenRunnerParameters()); + this(null, null, new MavenRunnerParameters()); } - private MavenSettings(MavenGeneralSettings cs, MavenRunnerSettings rs, MavenRunnerParameters rp) { - myGeneralSettings = cs.clone(); - myRunnerSettings = rs.clone(); + private MavenSettings(@Nullable MavenGeneralSettings cs, @Nullable MavenRunnerSettings rs, MavenRunnerParameters rp) { + myGeneralSettings = cs == null ? null : cs.clone(); + myRunnerSettings = rs == null ? null : rs.clone(); myRunnerParameters = rp.clone(); } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationSettings.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationSettings.java index 0cb4f8caab68..d33b771babd6 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationSettings.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationSettings.java @@ -20,7 +20,8 @@ import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SettingsEditor; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; -import org.jetbrains.idea.maven.project.MavenGeneralConfigurable; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.idea.maven.project.MavenGeneralConfigurableWithUseProjectSettings; import org.jetbrains.idea.maven.project.MavenGeneralSettings; import javax.swing.*; @@ -38,15 +39,25 @@ public class MavenRunConfigurationSettings extends SettingsEditor pair = MavenDisablePanelCheckbox.createPanel(super.createComponent(), "Use project settings"); + + myUseProjectSettings = pair.second; + return pair.first; + } + + +} diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenDisablePanelCheckbox.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenDisablePanelCheckbox.java new file mode 100644 index 000000000000..5c833dce7366 --- /dev/null +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenDisablePanelCheckbox.java @@ -0,0 +1,107 @@ +/* + * Copyright 2000-2012 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 org.jetbrains.idea.maven.project; + +import com.intellij.openapi.util.Pair; +import org.jetbrains.annotations.NotNull; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.util.HashSet; +import java.util.Set; + +/** + * @author Sergey Evdokimov + */ +public class MavenDisablePanelCheckbox extends JCheckBox { + + private final JComponent myPanel; + private Set myDisabledComponents; + + public MavenDisablePanelCheckbox(String text, @NotNull JComponent panel) { + super(text); + myPanel = panel; + + addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (MavenDisablePanelCheckbox.this.isSelected()) { + if (myDisabledComponents == null) { + myDisabledComponents = new HashSet(); + disable(myPanel); + } + } + else { + if (myDisabledComponents != null) { + enable(myPanel); + myDisabledComponents = null; + } + } + + } + }); + } + + private void disable(JComponent c) { + if (c.isEnabled()) { + myDisabledComponents.add(c); + c.setEnabled(false); + } + + for (Component component : c.getComponents()) { + if (component instanceof JComponent) { + disable((JComponent)component); + } + } + } + + private void enable(JComponent c) { + if (myDisabledComponents.contains(c)) { + c.setEnabled(true); + } + + for (Component component : c.getComponents()) { + if (component instanceof JComponent) { + enable((JComponent)component); + } + } + } + + public static Pair createPanel(JComponent component, String title) { + JPanel panel = new JPanel(new BorderLayout()) { + @Override + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + Color c = enabled ? Color.GRAY : Color.LIGHT_GRAY; + setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, c), BorderFactory.createEmptyBorder(10, 0, 0, 0))); + } + }; + panel.setEnabled(true); + panel.add(component); + + JCheckBox checkbox = new MavenDisablePanelCheckbox(title, panel); + + JPanel res = new JPanel(new BorderLayout(0, 10)); + res.add(checkbox, BorderLayout.NORTH); + res.add(panel, BorderLayout.CENTER); + + return Pair.create(res, checkbox); + + } + +} diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java index 097549097a96..2755eb81d341 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java @@ -192,7 +192,7 @@ public class MavenEnvironmentForm implements PanelWithAnchor { isOverridden = override; component.setEditable(override); - component.setEnabled(override); + component.setEnabled(override && checkBox.isEnabled()); if (override) { if (overrideText != null) component.setText(overrideText); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralConfigurable.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralConfigurable.java index e0ed2292bfa3..ec2a56b126ac 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralConfigurable.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralConfigurable.java @@ -139,7 +139,7 @@ public abstract class MavenGeneralConfigurable implements SearchableConfigurable getData(getState()); } - private void setData(MavenGeneralSettings data) { + protected void setData(MavenGeneralSettings data) { data.beginUpdate(); data.setWorkOffline(checkboxWorkOffline.isSelected()); @@ -158,7 +158,7 @@ public abstract class MavenGeneralConfigurable implements SearchableConfigurable data.endUpdate(); } - private void getData(MavenGeneralSettings data) { + protected void getData(MavenGeneralSettings data) { checkboxWorkOffline.setSelected(data.isWorkOffline()); mavenPathsForm.getData(data); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralConfigurableWithUseProjectSettings.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralConfigurableWithUseProjectSettings.java new file mode 100644 index 000000000000..8daaf1eb864a --- /dev/null +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralConfigurableWithUseProjectSettings.java @@ -0,0 +1,90 @@ +/* + * Copyright 2000-2012 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 org.jetbrains.idea.maven.project; + +import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Pair; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.swing.*; +import java.awt.*; + +/** + * @author Sergey Evdokimov + */ +public abstract class MavenGeneralConfigurableWithUseProjectSettings extends MavenGeneralConfigurable { + + private JCheckBox myUseProjectSettings; + + private final Project myProject; + + protected MavenGeneralConfigurableWithUseProjectSettings(@NotNull Project project) { + myProject = project; + } + + public abstract void setState(@Nullable MavenGeneralSettings state); + + @Override + public boolean isModified() { + if (myUseProjectSettings.isSelected()) { + return getState() != null; + } + else { + return getState() == null || super.isModified(); + } + } + + @Override + public void apply() { + if (myUseProjectSettings.isSelected()) { + setState(null); + } + else { + MavenGeneralSettings state = getState(); + if (state != null) { + setData(state); + } + else { + MavenGeneralSettings settings = MavenProjectsManager.getInstance(myProject).getGeneralSettings().clone(); + setData(settings); + setState(settings); + } + } + } + + @Override + public void reset() { + MavenGeneralSettings state = getState(); + myUseProjectSettings.setSelected(state == null); + + if (state == null) { + MavenGeneralSettings settings = MavenProjectsManager.getInstance(myProject).getGeneralSettings(); + getData(settings); + } + else { + getData(state); + } + } + + @Override + public JComponent createComponent() { + Pair pair = MavenDisablePanelCheckbox.createPanel(super.createComponent(), "Use project settings"); + + myUseProjectSettings = pair.second; + return pair.first; + } +} diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralSettings.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralSettings.java index 2ccb6a625ca9..bf4c5721423b 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralSettings.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralSettings.java @@ -19,6 +19,8 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.containers.ContainerUtil; +import com.intellij.util.xmlb.annotations.Property; +import com.intellij.util.xmlb.annotations.Transient; import gnu.trove.THashSet; import org.jdom.Element; import org.jetbrains.annotations.NotNull; @@ -71,6 +73,7 @@ public class MavenGeneralSettings implements Cloneable { fireChanged(); } + @Property @NotNull public MavenExecutionOptions.PluginUpdatePolicy getPluginUpdatePolicy() { return pluginUpdatePolicy; @@ -82,6 +85,7 @@ public class MavenGeneralSettings implements Cloneable { changed(); } + @Property @NotNull public MavenExecutionOptions.ChecksumPolicy getChecksumPolicy() { return checksumPolicy; @@ -93,6 +97,7 @@ public class MavenGeneralSettings implements Cloneable { changed(); } + @Property @NotNull public MavenExecutionOptions.FailureMode getFailureBehavior() { return failureBehavior; @@ -104,9 +109,16 @@ public class MavenGeneralSettings implements Cloneable { changed(); } - public + @Transient @NotNull - MavenExecutionOptions.LoggingLevel getLoggingLevel() { + @Deprecated // Use getOutputLevel() + public MavenExecutionOptions.LoggingLevel getLoggingLevel() { + return getOutputLevel(); + } + + @Property + @NotNull + public MavenExecutionOptions.LoggingLevel getOutputLevel() { return outputLevel; } @@ -116,9 +128,9 @@ public class MavenGeneralSettings implements Cloneable { changed(); } - public + @Property @NotNull - MavenExecutionOptions.SnapshotUpdatePolicy getSnapshotUpdatePolicy() { + public MavenExecutionOptions.SnapshotUpdatePolicy getSnapshotUpdatePolicy() { return snapshotUpdatePolicy; } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java index 3376b3073147..7bc6cb286da5 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableMap; import com.intellij.testFramework.IdeaTestCase; import com.intellij.util.xmlb.XmlSerializer; import org.jdom.Element; +import org.jetbrains.idea.maven.project.MavenGeneralSettings; import java.util.Arrays; @@ -29,6 +30,14 @@ public class MavenRunConfigurationTest extends IdeaTestCase { s.myRunnerParameters.setGoals(Arrays.asList("clean", "validate")); s.myRunnerParameters.setProfilesMap(ImmutableMap.of("prof1", true, "prof2", true, "prof3", false)); + s.myGeneralSettings = new MavenGeneralSettings(); + s.myGeneralSettings.setChecksumPolicy(MavenExecutionOptions.ChecksumPolicy.WARN); + s.myGeneralSettings.setFailureBehavior(MavenExecutionOptions.FailureMode.AT_END); + s.myGeneralSettings.setOutputLevel(MavenExecutionOptions.LoggingLevel.FATAL); + + s.myRunnerSettings = new MavenRunnerSettings(); + s.myRunnerSettings.setMavenProperties(ImmutableMap.of("a", "1", "b", "2", "c", "3")); + Element xml = XmlSerializer.serialize(s); MavenRunConfiguration.MavenSettings loaded = XmlSerializer.deserialize(xml, MavenRunConfiguration.MavenSettings.class); @@ -36,5 +45,8 @@ public class MavenRunConfigurationTest extends IdeaTestCase { assertEquals(s.myRunnerParameters.getWorkingDirPath(), loaded.myRunnerParameters.getWorkingDirPath()); assertEquals(s.myRunnerParameters.getGoals(), loaded.myRunnerParameters.getGoals()); assertEquals(s.myRunnerParameters.getProfilesMap(), loaded.myRunnerParameters.getProfilesMap()); + + assertEquals(s.myGeneralSettings, loaded.myGeneralSettings); + assertEquals(s.myRunnerSettings, loaded.myRunnerSettings); } } diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/AnalyzeTaskStacktraceAction.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/AnalyzeTaskStacktraceAction.java index 0d7953954ee0..b6313593220b 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/AnalyzeTaskStacktraceAction.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/AnalyzeTaskStacktraceAction.java @@ -16,7 +16,6 @@ package com.intellij.tasks.actions; -import com.intellij.execution.ui.ConsoleView; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.project.Project; import com.intellij.tasks.Comment; @@ -49,9 +48,7 @@ public class AnalyzeTaskStacktraceAction extends BaseTaskAction { if (stacktraceDialog.isOK() && stacktraceDialog.getTraces().length > 0) { Comment[] comments = stacktraceDialog.getTraces(); for (Comment comment : comments) { - ConsoleView consoleView = AnalyzeStacktraceUtil.addConsole(project, null, task.getId()); - consoleView.allowHeavyFilters(); - AnalyzeStacktraceUtil.printStacktrace(consoleView, comment.getText()); + AnalyzeStacktraceUtil.addConsole(project, null, task.getId(), comment.getText()); } } } diff --git a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGInClassConfigurationProducer.java b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGInClassConfigurationProducer.java index 75ba26c7727f..567de86fe594 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGInClassConfigurationProducer.java +++ b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGInClassConfigurationProducer.java @@ -47,7 +47,7 @@ public class TestNGInClassConfigurationProducer extends TestNGConfigurationProdu @Nullable protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) { - final PsiElement[] elements = LangDataKeys.PSI_ELEMENT_ARRAY.getData(context.getDataContext()); + final PsiElement[] elements = context != null ? LangDataKeys.PSI_ELEMENT_ARRAY.getData(context.getDataContext()) : null; if (elements != null && TestNGPatternConfigurationProducer.collectTestMembers(elements).size() > 1) { return null; } diff --git a/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGEntryPoint.java b/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGEntryPoint.java index 21f1f1525143..36395bcb510c 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGEntryPoint.java +++ b/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGEntryPoint.java @@ -56,7 +56,7 @@ public class TestNGEntryPoint extends EntryPoint { public boolean isEntryPoint(PsiElement psiElement) { if (ADD_TESTNG_TO_ENTRIES) { if (psiElement instanceof PsiModifierListOwner) { - if (TestNGUtil.hasTest((PsiModifierListOwner)psiElement, false)) return true; + if (TestNGUtil.hasTest((PsiModifierListOwner)psiElement, false, false, TestNGUtil.hasDocTagsSupport)) return true; return TestNGUtil.hasConfig((PsiModifierListOwner)psiElement); } } diff --git a/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java b/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java index 7ac90b8be3a2..13d17f44dfcf 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java +++ b/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java @@ -171,13 +171,13 @@ public class TestNGUtil } public static boolean hasTest(PsiModifierListOwner element, boolean checkDisabled) { - return hasTest(element, checkDisabled, hasDocTagsSupport); + return hasTest(element, true, checkDisabled, hasDocTagsSupport); } - public static boolean hasTest(PsiModifierListOwner element, boolean checkDisabled, boolean checkJavadoc) { + public static boolean hasTest(PsiModifierListOwner element, boolean checkHierarchy, boolean checkDisabled, boolean checkJavadoc) { //LanguageLevel effectiveLanguageLevel = element.getManager().getEffectiveLanguageLevel(); //boolean is15 = effectiveLanguageLevel != LanguageLevel.JDK_1_4 && effectiveLanguageLevel != LanguageLevel.JDK_1_3; - boolean hasAnnotation = AnnotationUtil.isAnnotated(element, TEST_ANNOTATION_FQN, true, true); + boolean hasAnnotation = AnnotationUtil.isAnnotated(element, TEST_ANNOTATION_FQN, checkHierarchy, true); if (hasAnnotation) { if (checkDisabled) { PsiAnnotation annotation = AnnotationUtil.findAnnotation(element, true, TEST_ANNOTATION_FQN); @@ -207,7 +207,7 @@ public class TestNGUtil //if it's a method, we check if the class it's in has a global @Test annotation PsiClass psiClass = ((PsiMethod)element).getContainingClass(); if (psiClass != null) { - if (AnnotationUtil.isAnnotated(psiClass, TEST_ANNOTATION_FQN, true, true)) { + if (AnnotationUtil.isAnnotated(psiClass, TEST_ANNOTATION_FQN, checkHierarchy, true)) { //even if it has a global test, we ignore private methods boolean isPrivate = element.hasModifierProperty(PsiModifier.PRIVATE); return !isPrivate; @@ -463,7 +463,7 @@ public class TestNGUtil } public static boolean isTestNGClass(PsiClass psiClass) { - return hasTest(psiClass, true, false); + return hasTest(psiClass, true, true, false); } public static boolean checkTestNGInClasspath(PsiElement psiElement) {