mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[488589] Fix NPE in ReferenceFinder.findLocalReferencesFromElement
Solves https://bugs.eclipse.org/bugs/show_bug.cgi?id=488589 Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
This commit is contained in:
parent
0319d7a2b8
commit
92cdc8ca9a
1 changed files with 4 additions and 5 deletions
|
@ -178,12 +178,12 @@ public class ReferenceFinder implements IReferenceFinder {
|
|||
URI sourceURI = null;
|
||||
if (doProcess(sourceCandidate, targetURIs)) {
|
||||
for(EReference ref: sourceCandidate.eClass().getEAllReferences()) {
|
||||
if(sourceCandidate.eIsSet(ref)) {
|
||||
Object value = sourceCandidate.eGet(ref, false);
|
||||
if(sourceCandidate.eIsSet(ref) && value != null) {
|
||||
if(ref.isContainment()) {
|
||||
Object content = sourceCandidate.eGet(ref, false);
|
||||
if(ref.isMany()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
InternalEList<EObject> contentList = (InternalEList<EObject>) content;
|
||||
InternalEList<EObject> contentList = (InternalEList<EObject>) value;
|
||||
for(int i=0; i<contentList.size(); ++i) {
|
||||
EObject childElement = contentList.basicGet(i);
|
||||
if(!childElement.eIsProxy()) {
|
||||
|
@ -191,14 +191,13 @@ public class ReferenceFinder implements IReferenceFinder {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
EObject childElement = (EObject) content;
|
||||
EObject childElement = (EObject) value;
|
||||
if(!childElement.eIsProxy()) {
|
||||
findLocalReferencesFromElement(targetURIs, childElement, localResource, acceptor);
|
||||
}
|
||||
}
|
||||
} else if (!ref.isContainer()) {
|
||||
if (doProcess(ref, targetURIs)) {
|
||||
Object value = sourceCandidate.eGet(ref, false);
|
||||
if(ref.isMany()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
InternalEList<EObject> values = (InternalEList<EObject>) value;
|
||||
|
|
Loading…
Reference in a new issue