mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Cleanup (optimization; formatting)
This commit is contained in:
@@ -80,14 +80,14 @@ public class PsiImplUtil {
|
||||
|
||||
@NotNull
|
||||
public static PsiMethod[] getConstructors(@NotNull PsiClass aClass) {
|
||||
final List<PsiMethod> constructorsList = new SmartList<PsiMethod>();
|
||||
|
||||
final PsiMethod[] methods = aClass.getMethods();
|
||||
for (final PsiMethod method : methods) {
|
||||
if (method.isConstructor()) constructorsList.add(method);
|
||||
List<PsiMethod> result = null;
|
||||
for (PsiMethod method : aClass.getMethods()) {
|
||||
if (method.isConstructor()) {
|
||||
if (result == null) result = ContainerUtil.newSmartList();
|
||||
result.add(method);
|
||||
}
|
||||
}
|
||||
|
||||
return constructorsList.toArray(new PsiMethod[constructorsList.size()]);
|
||||
return result == null ? PsiMethod.EMPTY_ARRAY : result.toArray(new PsiMethod[result.size()]);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -448,8 +448,8 @@ public class ClsClassImpl extends ClsMemberImpl<PsiClassStub<?>> implements PsiE
|
||||
@NotNull ResolveState state,
|
||||
PsiElement lastParent,
|
||||
@NotNull PsiElement place) {
|
||||
LanguageLevel languageLevel = processor instanceof MethodsProcessor ? ((MethodsProcessor)processor).getLanguageLevel() : PsiUtil.getLanguageLevel(place);
|
||||
return PsiClassImplUtil.processDeclarationsInClass(this, processor, state, null, lastParent, place, languageLevel, false);
|
||||
LanguageLevel level = processor instanceof MethodsProcessor ? ((MethodsProcessor)processor).getLanguageLevel() : PsiUtil.getLanguageLevel(place);
|
||||
return PsiClassImplUtil.processDeclarationsInClass(this, processor, state, null, lastParent, place, level, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user