This commit is contained in:
Alexey Kudravtsev
2015-05-19 12:31:09 +03:00
parent 907312838e
commit b41d41ddb8
4 changed files with 9 additions and 9 deletions
@@ -127,7 +127,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
@Override
public boolean suitableForFile(@NotNull PsiFile file) {
// both PsiJavaFile and PsiCodeFragment
// both PsiJavaFile and PsiCodeFragment must match
return file instanceof PsiImportHolder && !InjectedLanguageManager.getInstance(file.getProject()).isInjectedFragment(file);
}
@@ -1126,7 +1126,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
if (owner instanceof PsiClass) {
final PsiClass outerClass = (PsiClass)owner;
if (!InheritanceUtil.hasEnclosingInstanceInScope(outerClass, ref, false, false)) {
myHolder.add(HighlightClassUtil.reportIllegalEnclosingUsage(ref, aClass, (PsiClass)owner, ref));
myHolder.add(HighlightClassUtil.reportIllegalEnclosingUsage(ref, null, (PsiClass)owner, ref));
}
}
}
@@ -1552,7 +1552,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
if (thenExpression != null && elseExpression != null) {
final PsiType conditionalType = expression.getType();
if (conditionalType != null) {
final PsiExpression[] sides = new PsiExpression[] {thenExpression, elseExpression};
final PsiExpression[] sides = {thenExpression, elseExpression};
for (PsiExpression side : sides) {
final PsiType sideType = side.getType();
if (sideType != null && !TypeConversionUtil.isAssignable(conditionalType, sideType)) {
@@ -213,7 +213,7 @@ public class BlockSupportImpl extends BlockSupport {
}
@NotNull
public static PsiFileImpl getFileCopy(PsiFileImpl originalFile, FileViewProvider providerCopy) {
public static PsiFileImpl getFileCopy(@NotNull PsiFileImpl originalFile, @NotNull FileViewProvider providerCopy) {
FileViewProvider viewProvider = originalFile.getViewProvider();
Language language = originalFile.getLanguage();
@@ -248,7 +248,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers
Collections.sort(passes, new Comparator<TextEditorHighlightingPass>() {
@Override
public int compare(TextEditorHighlightingPass o1, TextEditorHighlightingPass o2) {
public int compare(@NotNull TextEditorHighlightingPass o1, @NotNull TextEditorHighlightingPass o2) {
if (o1 instanceof GeneralHighlightingPass) return -1;
if (o2 instanceof GeneralHighlightingPass) return 1;
return 0;
@@ -371,9 +371,9 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers
@TestOnly
public void cleanupAfterTest() {
if (!myProject.isOpen()) return;
setUpdateByTimerEnabled(false);
waitForTermination();
if (myProject.isOpen()) {
prepareForTest();
}
}
void waitForTermination() {
@@ -109,7 +109,7 @@ public class PassExecutorService implements Disposable {
mySubmittedPasses.clear();
}
public void submitPasses(@NotNull Map<FileEditor, HighlightingPass[]> passesMap, @NotNull DaemonProgressIndicator updateProgress) {
void submitPasses(@NotNull Map<FileEditor, HighlightingPass[]> passesMap, @NotNull DaemonProgressIndicator updateProgress) {
if (isDisposed()) return;
// null keys are ok