diff --git a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java index ec028e11c50e..06583b409c77 100644 --- a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java @@ -26,6 +26,7 @@ import com.intellij.codeInspection.*; import com.intellij.codeInspection.ex.BaseLocalInspectionTool; import com.intellij.ide.DataManager; import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.util.text.StringUtil; @@ -60,6 +61,8 @@ public class NullableStuffInspection extends BaseLocalInspectionTool { @Deprecated @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NOT_ANNOTATED_SETTER_PARAMETER = true; @Deprecated @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS = true; // remains for test @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD = true; + + private static final Logger LOG = Logger.getInstance("#" + NullableStuffInspection.class.getName()); @NotNull public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) { @@ -144,10 +147,10 @@ public class NullableStuffInspection extends BaseLocalInspectionTool { final PsiParameter[] parameters = setter.getParameterList().getParameters(); assert parameters.length == 1 : setter.getText(); final PsiParameter parameter = parameters[0]; - assert parameter != null : setter.getText(); + LOG.assertTrue(parameter != null, setter.getText()); if (REPORT_NOT_ANNOTATED_GETTER && !AnnotationUtil.isAnnotated(parameter, manager.getAllAnnotations()) && !TypeConversionUtil.isPrimitiveAndNotNull(parameter.getType())) { final PsiIdentifier nameIdentifier1 = parameter.getNameIdentifier(); - assert nameIdentifier1 != null : parameter; + assertValidElement(setter, parameter, nameIdentifier1); holder.registerProblem(nameIdentifier1, InspectionsBundle.message("inspection.nullable.problems.annotated.field.setter.parameter.not.annotated", StringUtil.getShortName(anno)), @@ -157,7 +160,7 @@ public class NullableStuffInspection extends BaseLocalInspectionTool { if (PropertyUtils.isSimpleSetter(setter)) { if (annotated.isDeclaredNotNull && manager.isNullable(parameter, false)) { final PsiIdentifier nameIdentifier1 = parameter.getNameIdentifier(); - assert nameIdentifier1 != null : parameter; + assertValidElement(setter, parameter, nameIdentifier1); holder.registerProblem(nameIdentifier1, InspectionsBundle.message( "inspection.nullable.problems.annotated.field.setter.parameter.conflict", StringUtil.getShortName(anno), nullableSimpleName), @@ -166,7 +169,7 @@ public class NullableStuffInspection extends BaseLocalInspectionTool { } else if (annotated.isDeclaredNullable && manager.isNotNull(parameter, false)) { final PsiIdentifier nameIdentifier1 = parameter.getNameIdentifier(); - assert nameIdentifier1 != null : parameter; + assertValidElement(setter, parameter, nameIdentifier1); holder.registerProblem(nameIdentifier1, InspectionsBundle.message( "inspection.nullable.problems.annotated.field.setter.parameter.conflict", StringUtil.getShortName(anno), notNullSimpleName), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, @@ -241,6 +244,11 @@ public class NullableStuffInspection extends BaseLocalInspectionTool { } } + private void assertValidElement(PsiMethod setter, PsiParameter parameter, PsiIdentifier nameIdentifier1) { + LOG.assertTrue(nameIdentifier1 != null, setter.getText()); + LOG.assertTrue(parameter.isPhysical(), setter.getText()); + } + public PsiAssignmentExpression getAssignmentExpressionIfOnAssignmentLefthand(PsiExpression expression) { PsiElement parent = PsiTreeUtil.skipParentsOfType(expression, PsiParenthesizedExpression.class); if (!(parent instanceof PsiAssignmentExpression)) { diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveDirectoryWithClassesHelper.java b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveDirectoryWithClassesHelper.java index 9d8b77c145fa..ca4a899167a0 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveDirectoryWithClassesHelper.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveDirectoryWithClassesHelper.java @@ -74,6 +74,10 @@ public class JavaMoveDirectoryWithClassesHelper extends MoveDirectoryWithClasses if (!(file instanceof PsiClassOwner)) { return false; } + + if (!JspPsiUtil.isInJspFile(file)) { + return false; + } for (PsiClass psiClass : ((PsiClassOwner)file).getClasses()) { final PsiClass newClass = MoveClassesOrPackagesUtil.doMoveClass(psiClass, moveDestination); diff --git a/platform/core-impl/src/com/intellij/openapi/editor/impl/IntervalTreeImpl.java b/platform/core-impl/src/com/intellij/openapi/editor/impl/IntervalTreeImpl.java index 54ab504d2a94..bdf9b68045fc 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/impl/IntervalTreeImpl.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/impl/IntervalTreeImpl.java @@ -65,7 +65,7 @@ public abstract class IntervalTreeImpl extends RedBla private final IntervalTreeImpl myIntervalTree; - public IntervalNode(IntervalTreeImpl intervalTree, @NotNull E key, int start, int end) { + public IntervalNode(@NotNull IntervalTreeImpl intervalTree, @NotNull E key, int start, int end) { // maxEnd == 0 so to not disrupt existing maxes myIntervalTree = intervalTree; myStart = start; diff --git a/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java b/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java index 72180cd2ec84..7d1343e5ad70 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerImpl.java @@ -28,7 +28,7 @@ public class RangeMarkerImpl extends UserDataHolderBase implements RangeMarkerEx private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.editor.impl.RangeMarkerImpl"); protected final DocumentEx myDocument; - protected RangeMarkerTree.RMNode myNode; + protected RangeMarkerTree.RMNode myNode; private final long myId; private static final StripedIDGenerator counter = new StripedIDGenerator(); @@ -91,7 +91,7 @@ public class RangeMarkerImpl extends UserDataHolderBase implements RangeMarkerEx public void invalidate(final DocumentEvent e) { setValid(false); - RangeMarkerTree.RMNode node = myNode; + RangeMarkerTree.RMNode node = myNode; if (node != null) { node.processAliveKeys(new Processor() { diff --git a/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerTree.java b/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerTree.java index bd320dfc7462..6fc5bb1d8830 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerTree.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/impl/RangeMarkerTree.java @@ -88,10 +88,10 @@ public class RangeMarkerTree extends IntervalTreeImpl.RMNode addInterval(@NotNull T interval, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer) { + public RMNode addInterval(@NotNull T interval, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer) { RangeMarkerImpl marker = (RangeMarkerImpl)interval; marker.setValid(true); - RangeMarkerTree.RMNode node = (RMNode)super.addInterval(interval, start, end, greedyToLeft, greedyToRight, layer); + RMNode node = (RMNode)super.addInterval(interval, start, end, greedyToLeft, greedyToRight, layer); if (DEBUG && node.intervals.size() > DUPLICATE_LIMIT) { l.readLock().lock(); @@ -113,7 +113,7 @@ public class RangeMarkerTree extends IntervalTreeImpl node) { @NonNls final StringBuilder msg = new StringBuilder(); final AtomicInteger alive = new AtomicInteger(); node.processAliveKeys(new Processor() { @@ -135,8 +135,8 @@ public class RangeMarkerTree extends IntervalTreeImpl createNewNode(@NotNull T key, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer) { + return new RMNode(this, key, start, end, greedyToLeft, greedyToRight); } @Override @@ -146,21 +146,26 @@ public class RangeMarkerTree extends IntervalTreeImpl.RMNode lookupNode(@NotNull T key) { - return (RMNode)((RangeMarkerImpl)key).myNode; + protected RMNode lookupNode(@NotNull T key) { + return (RMNode)((RangeMarkerImpl)key).myNode; } @Override protected void setNode(@NotNull T key, IntervalNode intervalNode) { - ((RangeMarkerImpl)key).myNode = (RangeMarkerTree.RMNode)intervalNode; + ((RangeMarkerImpl)key).myNode = (RMNode)intervalNode; } - public class RMNode extends IntervalTreeImpl.IntervalNode { + static class RMNode extends IntervalTreeImpl.IntervalNode { private final boolean isExpandToLeft; private final boolean isExpandToRight; - public RMNode(@NotNull T key, int start, int end, boolean greedyToLeft, boolean greedyToRight) { - super(RangeMarkerTree.this, key, start, end); + public RMNode(@NotNull RangeMarkerTree rangeMarkerTree, + @NotNull T key, + int start, + int end, + boolean greedyToLeft, + boolean greedyToRight) { + super(rangeMarkerTree, key, start, end); isExpandToLeft = greedyToLeft; isExpandToRight = greedyToRight; } @@ -227,7 +232,7 @@ public class RangeMarkerTree extends IntervalTreeImpl insertedNode = (RMNode)findOrInsert(node); // can change if two range become the one if (insertedNode != node) { // merge happened diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/ProblemDescriptorImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/ProblemDescriptorImpl.java index ff171fa13760..e80cbf8e61b8 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/ProblemDescriptorImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/ProblemDescriptorImpl.java @@ -87,7 +87,11 @@ public class ProblemDescriptorImpl extends CommonProblemDescriptorImpl implement assertPhysical(startElement); if (startElement != endElement) assertPhysical(endElement); - if (startElement.getTextRange().getStartOffset() >= endElement.getTextRange().getEndOffset()) { + final TextRange startElementRange = startElement.getTextRange(); + LOG.assertTrue(startElementRange != null, startElement); + final TextRange endElementRange = endElement.getTextRange(); + LOG.assertTrue(endElementRange != null, endElement); + if (startElementRange.getStartOffset() >= endElementRange.getEndOffset()) { if (!(startElement instanceof PsiFile && endElement instanceof PsiFile)) { LOG.error("Empty PSI elements should not be passed to createDescriptor. Start: " + startElement + ", end: " + endElement); } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java index b0b76948bf27..7fac178a6060 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java @@ -141,7 +141,11 @@ public class InspectionResultsViewComparator implements Comparator { private static int compareEntity(final RefEntity entity, final PsiElement element) { if (entity instanceof RefElement) { - return PsiUtilCore.compareElementsByPosition(((RefElement)entity).getElement(), element); + final PsiElement psiElement = ((RefElement)entity).getElement(); + if (psiElement != null && element != null) { + return PsiUtilCore.compareElementsByPosition(psiElement, element); + } + if (element == null) return psiElement == null ? 0 : 1; } if (element instanceof PsiQualifiedNamedElement) { return StringUtil.compare(entity.getQualifiedName(), ((PsiQualifiedNamedElement)element).getQualifiedName(), true); diff --git a/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java b/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java index 8ffa8b89fd4e..db88fb00b106 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java @@ -31,6 +31,7 @@ import com.intellij.openapi.progress.util.ProgressIndicatorBase; import com.intellij.openapi.project.Project; import com.intellij.openapi.startup.StartupManager; import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.wm.ex.ProgressIndicatorEx; import com.intellij.pom.PomManager; @@ -407,6 +408,12 @@ public class DocumentCommitThread implements Runnable, Disposable { catch (Exception e) { s += e; } + try { + Disposer.dispose(project); + } + catch (Throwable ignored) { + // do not fill log with endless exceptions + } throw new RuntimeException(s); } 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 607b043b00b8..b297fd94ce71 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 @@ -110,7 +110,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener, DocumentBulkUpdateListener bulkUpdateListener = new DocumentBulkUpdateListener() { @Override public void updateStarted(@NotNull Document doc) { - if (doc != myEditor.getDocument() && myOffset >= doc.getTextLength()) return; + if (doc != myEditor.getDocument() && myOffset >= doc.getTextLength() || savedBeforeBulkCaretMarker != null) return; savedBeforeBulkCaretMarker = doc.createRangeMarker(myOffset, myOffset); } @Override @@ -237,7 +237,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener, } public void setIgnoreWrongMoves(boolean ignoreWrongMoves) { - this.myIgnoreWrongMoves = ignoreWrongMoves; + myIgnoreWrongMoves = ignoreWrongMoves; } @Override @@ -695,9 +695,8 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener, moveToOffset(newLength, performSoftWrapAdjustment); } else { - final int line; try { - line = event.translateLineViaDiff(myLogicalCaret.line); + final int line = event.translateLineViaDiff(myLogicalCaret.line); moveToLogicalPosition(new LogicalPosition(line, myLogicalCaret.column), performSoftWrapAdjustment, null, false); } catch (FilesTooBigForDiffException e1) { diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeHighlighterTree.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeHighlighterTree.java index 8a191e1b86bd..cd0947bc871f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeHighlighterTree.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/RangeHighlighterTree.java @@ -44,19 +44,20 @@ public class RangeHighlighterTree extends RangeMarkerTree { @NotNull @Override protected RHNode createNewNode(@NotNull RangeHighlighterEx key, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer) { - return new RHNode(key, start, end, greedyToLeft, greedyToRight,layer); + return new RHNode(this, key, start, end, greedyToLeft, greedyToRight,layer); } - class RHNode extends RangeMarkerTree.RMNode { + static class RHNode extends RMNode { final int myLayer; - public RHNode(@NotNull final RangeHighlighterEx key, + public RHNode(@NotNull RangeHighlighterTree rangeMarkerTree, + @NotNull final RangeHighlighterEx key, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer) { - super(key, start, end, greedyToLeft, greedyToRight); + super(rangeMarkerTree, key, start, end, greedyToLeft, greedyToRight); myLayer = layer; } diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedFieldAccessInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedFieldAccessInspection.java index e89e21c45978..0de37c8ed3df 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedFieldAccessInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedFieldAccessInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2011 Bas Leijdekkers + * Copyright 2006-201@ Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,6 +73,10 @@ public class UnqualifiedFieldAccessInspection extends BaseInspection { if (field.hasModifierProperty(PsiModifier.STATIC)) { return; } + final PsiClass containingClass = field.getContainingClass(); + if (containingClass instanceof PsiAnonymousClass) { + return; + } registerError(expression); } } diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedMethodAccessInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedMethodAccessInspection.java index 12ceb5425306..2d54bc48f77f 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedMethodAccessInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedMethodAccessInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2011 Bas Leijdekkers + * Copyright 2006-2012 Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,6 +68,10 @@ public class UnqualifiedMethodAccessInspection extends BaseInspection { if (method.isConstructor() || method.hasModifierProperty(PsiModifier.STATIC)) { return; } + final PsiClass containingClass = method.getContainingClass(); + if (containingClass instanceof PsiAnonymousClass) { + return; + } registerError(expression); } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_field_access/UnqualifiedFieldAccess.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_field_access/UnqualifiedFieldAccess.java index c74a6852d584..6c7518d8d83b 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_field_access/UnqualifiedFieldAccess.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_field_access/UnqualifiedFieldAccess.java @@ -9,4 +9,17 @@ public class UnqualifiedFieldAccess { final String s = String.valueOf(field.hashCode()); System.out.println(s); } + + void foo() { + new Object() { + int i; + void foo() { + new Object() { + void foo() { + i = 0; + } + }; + } + }; + } } \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_method_access/UnqualifiedMethodAccess.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_method_access/UnqualifiedMethodAccess.java index 0e3b456c86c5..0e626f3fe31d 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_method_access/UnqualifiedMethodAccess.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/style/unqualified_method_access/UnqualifiedMethodAccess.java @@ -15,4 +15,16 @@ public class UnqualifiedMethodAccess extends JPanel { void foo(String s) { this.foo(); } + + void anonymous() { + new Object() { + void bar() { + new Object() { + void foo() { + bar(); + } + }; + } + }; + } } diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java index 3e25901512c5..50f35abf515b 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java @@ -556,17 +556,22 @@ public class SvnVcs extends AbstractVcs { } private void createPool() { + if (myPool != null) return; final String property = System.getProperty(KEEP_CONNECTIONS_KEY); final boolean keep; if (StringUtil.isEmptyOrSpaces(property)) { - keep = ! ApplicationManager.getApplication().isUnitTestMode(); // default + keep = !ApplicationManager.getApplication().isUnitTestMode(); // default } else { keep = Boolean.getBoolean(KEEP_CONNECTIONS_KEY); } myPool = new DefaultSVNRepositoryPool(myConfiguration.getAuthenticationManager(this), myConfiguration.getOptions(myProject), 60*1000, keep); } + @NotNull private ISVNRepositoryPool getPool() { + if (myPool == null) { + createPool(); + } return myPool; } diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java index 1255ace19796..fd7c1b22761f 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java @@ -86,18 +86,22 @@ public class CopiesPanel { myCurrentInfoList = null; final Runnable focus = new Runnable() { + @Override public void run() { IdeFocusManager.getInstance(myProject).requestFocus(myRefreshLabel, true); } }; final Runnable refreshView = new Runnable() { + @Override public void run() { final List infoList = myVcs.getAllWcInfos(); Runnable runnable = new Runnable() { + @Override public void run() { if (myCurrentInfoList != null) { final List> newList = ObjectsConvertor.convert(infoList, new Convertor>() { + @Override public OverrideEqualsWrapper convert(WCInfo o) { return new OverrideEqualsWrapper(InfoEqualityPolicy.getInstance(), o); } @@ -119,8 +123,14 @@ public class CopiesPanel { } }; final Runnable refreshOnPooled = new Runnable() { + @Override public void run() { - ApplicationManager.getApplication().executeOnPooledThread(refreshView); + if (ApplicationManager.getApplication().isUnitTestMode()) { + refreshView.run(); + } + else { + ApplicationManager.getApplication().executeOnPooledThread(refreshView); + } } }; myConnection.subscribe(SvnVcs.ROOTS_RELOADED, refreshOnPooled); @@ -133,6 +143,7 @@ public class CopiesPanel { panel.add(myPanel, BorderLayout.NORTH); holderPanel.add(panel, BorderLayout.WEST); myRefreshLabel = new MyLinkLabel(myTextHeight, "Refresh", new LinkListener() { + @Override public void linkSelected(LinkLabel aSource, Object aLinkData) { if (myRefreshLabel.isEnabled()) { myVcs.invokeRefreshSvnRoots(true); @@ -280,6 +291,7 @@ public class CopiesPanel { private void mergeFrom(final WCInfo wcInfo, final VirtualFile root, final Component mergeLabel) { SelectBranchPopup.showForBranchRoot(myProject, root, new SelectBranchPopup.BranchSelectedCallback() { + @Override public void branchSelected(Project project, SvnBranchConfigurationNew configuration, String url, long revision) { new QuickMerge(project, url, wcInfo, SVNPathUtil.tail(url), root).execute(); } @@ -393,6 +405,7 @@ public class CopiesPanel { } } + @Override public int getHashCode(WCInfo value) { final HashCodeBuilder builder = new HashCodeBuilder(); builder.append(value.getPath()); @@ -404,6 +417,7 @@ public class CopiesPanel { return builder.getCode(); } + @Override public boolean isEqual(WCInfo val1, WCInfo val2) { if (val1 == val2) return true; if (val1 == null || val2 == null || val1.getClass() != val2.getClass()) return false; @@ -425,6 +439,7 @@ public class CopiesPanel { return ourComparator; } + @Override public int compare(WCInfo o1, WCInfo o2) { return o1.getPath().compareTo(o2.getPath()); } diff --git a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGRunnableState.java b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGRunnableState.java index 314b5729fa97..8a64a074f259 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGRunnableState.java +++ b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGRunnableState.java @@ -246,9 +246,10 @@ public class TestNGRunnableState extends JavaCommandLineState { LOG.info("Language level is " + effectiveLanguageLevel.toString()); LOG.info("is15 is " + is15); final String pathToBundledJar = PathUtil.getJarPathForClass(AfterClass.class); - final String incompatibilityMessage = TestNGVersionChecker - .getVersionIncompatibilityMessage(project, config.getPersistantData().getScope().getSourceScope(config).getLibrariesScope(), - pathToBundledJar); + final SourceScope sourceScope = config.getPersistantData().getScope().getSourceScope(config); + final String incompatibilityMessage = sourceScope != null ? + TestNGVersionChecker.getVersionIncompatibilityMessage(project, sourceScope.getLibrariesScope(), pathToBundledJar) : + null; if (incompatibilityMessage != null) { javaParameters.getClassPath().add(pathToBundledJar); }