Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Feb 19, 2024
1 parent 059e413 commit 65f6bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ private static boolean processSubComponent(PsiElementProcessor<HaxeNamedComponen
if (!processor.execute(component)) {
return false;
}
if (component instanceof HaxeClass) {
for (HaxeNamedComponent subComponent : getNamedComponents((HaxeClass)component)) {
if (component instanceof HaxeClass haxeClass) {
for (HaxeNamedComponent subComponent : getNamedComponents(haxeClass)) {
if (!processor.execute(subComponent)) {
return false;
}
Expand All @@ -172,7 +172,7 @@ private static List<HaxeNamedComponent> getNamedComponents(@Nullable final HaxeC
if (body != null) {
final Collection<HaxeNamedComponent> members = PsiTreeUtil.findChildrenOfAnyType(body, MEMBER_TYPES);
for (HaxeNamedComponent member : members) {
if (member instanceof HaxeMethod && ((HaxeMethod)member).isConstructor()) {
if (member instanceof HaxeMethod method && method.isConstructor()) {
continue;
}
components.add(member);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1325,8 +1325,8 @@ public static String getQName(PsiFile file, final String result, boolean searchI
final HaxeImportStatement importStatement =
(HaxeImportStatement)(StreamUtil.reverse(Arrays.stream(fileChildren))
.filter(element ->
element instanceof HaxeImportStatement &&
((HaxeImportStatement)element).getModel().exposeByName(result) != null)
element instanceof HaxeImportStatement impStatement
&& impStatement.getModel().exposeByName(result) != null)
.findFirst()
.orElse(null));

Expand Down

0 comments on commit 65f6bdb

Please sign in to comment.