mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
test fix
This commit is contained in:
+1
-1
@@ -77,7 +77,7 @@ public class ImplicitVariableElementInfoFactory implements SmartPointerElementIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pointsToTheSameElementAs(SmartPointerElementInfo other) {
|
||||
public boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other) {
|
||||
if (other instanceof ImplicitVariableInfo) {
|
||||
return myVar == ((ImplicitVariableInfo)other).myVar;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class FileElementInfo implements SmartPointerElementInfo {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pointsToTheSameElementAs(SmartPointerElementInfo other) {
|
||||
public boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other) {
|
||||
if (other instanceof FileElementInfo) {
|
||||
return myVirtualFile == ((FileElementInfo)other).myVirtualFile;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class HardElementInfo implements SmartPointerElementInfo {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pointsToTheSameElementAs(SmartPointerElementInfo other) {
|
||||
public boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other) {
|
||||
return Comparing.equal(myElement, other.restoreElement());
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -77,4 +77,13 @@ class InjectedSelfElementInfo extends SelfElementInfo {
|
||||
|
||||
return result.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other) {
|
||||
if (getClass() != other.getClass()) return false;
|
||||
if (!super.pointsToTheSameElementAs(other)) return false;
|
||||
SmartPointerElementInfo myElementInfo = ((SmartPsiElementPointerImpl)myPsiFileRangeInHostElement).getElementInfo();
|
||||
SmartPointerElementInfo oElementInfo = ((SmartPsiElementPointerImpl)((InjectedSelfElementInfo)other).myPsiFileRangeInHostElement).getElementInfo();
|
||||
return myElementInfo.pointsToTheSameElementAs(oElementInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ public class SelfElementInfo implements SmartPointerElementInfo {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pointsToTheSameElementAs(SmartPointerElementInfo other) {
|
||||
public boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other) {
|
||||
if (other instanceof SelfElementInfo) {
|
||||
return myVirtualFile == ((SelfElementInfo)other).myVirtualFile
|
||||
&& myType == ((SelfElementInfo)other).myType
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ interface SmartPointerElementInfo {
|
||||
|
||||
void dispose();
|
||||
int elementHashCode(); // must be immutable
|
||||
boolean pointsToTheSameElementAs(SmartPointerElementInfo other);
|
||||
boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other);
|
||||
|
||||
VirtualFile getVirtualFile();
|
||||
|
||||
|
||||
+5
-8
@@ -85,7 +85,7 @@ class SmartPsiElementPointerImpl<E extends PsiElement> implements SmartPointerEx
|
||||
if (element != null && !element.isValid()) {
|
||||
element = null;
|
||||
}
|
||||
if (element == null && myElementInfo != null) {
|
||||
if (element == null) {
|
||||
element = (E)myElementInfo.restoreElement();
|
||||
if (element != null && (!element.getClass().equals(myElementClass) || !element.isValid())) {
|
||||
element = null;
|
||||
@@ -168,17 +168,13 @@ class SmartPsiElementPointerImpl<E extends PsiElement> implements SmartPointerEx
|
||||
}
|
||||
|
||||
public void documentAndPsiInSync() {
|
||||
if (myElementInfo != null) {
|
||||
myElementInfo.documentAndPsiInSync();
|
||||
}
|
||||
myElementInfo.documentAndPsiInSync();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (myElementInfo != null) {
|
||||
myElementInfo.dispose();
|
||||
myElement = null;
|
||||
}
|
||||
myElementInfo.dispose();
|
||||
myElement = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,6 +186,7 @@ class SmartPsiElementPointerImpl<E extends PsiElement> implements SmartPointerEx
|
||||
myElementInfo.fastenBelt(offset);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
SmartPointerElementInfo getElementInfo() {
|
||||
return myElementInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user