Use predefined Array for children and small reformatting

This commit is contained in:
Nikolay Krasko
2012-09-18 18:53:24 +04:00
parent 639c180d83
commit 110db34baa
@@ -110,10 +110,7 @@ public class JetStructureViewElement implements StructureViewTreeElement {
public TreeElement[] getChildren() { public TreeElement[] getChildren() {
if (myElement instanceof JetFile) { if (myElement instanceof JetFile) {
final JetFile jetFile = (JetFile) myElement; final JetFile jetFile = (JetFile) myElement;
context = WholeProjectAnalyzerFacade.analyzeProjectWithCacheOnAFile(jetFile).getBindingContext();
context = WholeProjectAnalyzerFacade.analyzeProjectWithCacheOnAFile(jetFile)
.getBindingContext();
return wrapDeclarations(jetFile.getDeclarations()); return wrapDeclarations(jetFile.getDeclarations());
} }
else if (myElement instanceof JetClass) { else if (myElement instanceof JetClass) {
@@ -137,7 +134,7 @@ public class JetStructureViewElement implements StructureViewTreeElement {
} }
} }
return new TreeElement[0]; return EMPTY_ARRAY;
} }
private String getElementText() { private String getElementText() {
@@ -147,8 +144,7 @@ public class JetStructureViewElement implements StructureViewTreeElement {
if (myElement instanceof JetDeclaration) { if (myElement instanceof JetDeclaration) {
JetDeclaration declaration = (JetDeclaration) myElement; JetDeclaration declaration = (JetDeclaration) myElement;
final DeclarationDescriptor descriptor = final DeclarationDescriptor descriptor = context.get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration);
context.get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration);
if (descriptor != null) { if (descriptor != null) {
text = getDescriptorTreeText(descriptor); text = getDescriptorTreeText(descriptor);
} }