Skip to content

Commit a4a3767

Browse files
committed
extract to local variable - minor fix
1 parent d55f79a commit a4a3767

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathBasePage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,15 @@ public BuildPathBasePage switchToTab(Class<? extends BuildPathBasePage> tabClass
407407
JavaPlugin.logErrorMessage("Page does not support tab switching: "+this.getClass()); //$NON-NLS-1$
408408
return null;
409409
}
410-
if(fSWTControl.getParent() instanceof TabFolder tabFolder) {
410+
Composite parent= fSWTControl.getParent();
411+
if(parent instanceof TabFolder tabFolder) {
411412
for (TabItem tabItem : tabFolder.getItems()) {
412413
if (tabClass.isInstance(tabItem.getData())) {
413414
tabFolder.setSelection(tabItem);
414415
return (BuildPathBasePage) tabItem.getData();
415416
}
416417
}
417-
}
418-
if(fSWTControl.getParent() instanceof CTabFolder cTabFolder) {
418+
} else if(parent instanceof CTabFolder cTabFolder) {
419419
for (CTabItem ctabItem : cTabFolder.getItems()) {
420420
if (tabClass.isInstance(ctabItem.getData())) {
421421
cTabFolder.setSelection(ctabItem);

0 commit comments

Comments
 (0)