mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Small refactoring
This commit is contained in:
committed by
Dmitry Jemerov
parent
6fb52b41bc
commit
6f1f173553
@@ -142,11 +142,7 @@ public class CoreJavaFileManager implements JavaFileManager {
|
||||
int newComponentStart = 0;
|
||||
int lookupStart = 0;
|
||||
|
||||
while (true) {
|
||||
if (lookupStart > className.length()) {
|
||||
return newComponentStart != lookupStart ? null : curClass;
|
||||
}
|
||||
|
||||
while (lookupStart <= className.length()) {
|
||||
int b = className.indexOf("$", lookupStart);
|
||||
b = b < 0 ? className.length(): b;
|
||||
|
||||
@@ -161,6 +157,10 @@ public class CoreJavaFileManager implements JavaFileManager {
|
||||
newComponentStart = lookupStart;
|
||||
curClass = inner;
|
||||
}
|
||||
|
||||
if (lookupStart != newComponentStart) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ public class NotNullInnerClass extends PsiTestCase {
|
||||
|
||||
PsiClass clazzInner$Wrong2 = manager.findClass("foo.Nested.Inner$$X", scope);
|
||||
assertNull(clazzInner$Wrong2);
|
||||
|
||||
PsiClass clazzInner$Wrong3 = manager.findClass("foo.Nested.Inner$$", scope);
|
||||
assertNull(clazzInner$Wrong3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user