Skip to content

Commit 1aaf19c

Browse files
Perform clean code of ui/org.eclipse.pde.runtime
1 parent b6b9ddf commit 1aaf19c

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@ private void createTreeViewer(Composite parent) {
285285
@Override
286286
public int compare(Viewer viewer, Object e1, Object e2) {
287287
// let Comparables compare themselves
288-
if (e1 instanceof Comparable c1 && e2 instanceof Comparable && e1.getClass().equals(e2.getClass())) {
289-
Comparable c2 = (Comparable) e2;
290-
288+
if (e1 instanceof Comparable c1 && e2 instanceof Comparable c2 && e1.getClass().equals(e2.getClass())) {
291289
return c1.compareTo(c2);
292290
}
293291

ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,11 @@ public Object[] getChildren(Object element) {
7777
return ((ConfigurationElement) element).getElements();
7878
}
7979

80-
if (element instanceof Bundle) {
80+
if (element instanceof Bundle bundle) {
8181
if (fRegistryBrowser.getGroupBy() != RegistryBrowser.BUNDLES) { // expands only in Bundles mode
8282
return null;
8383
}
8484

85-
Bundle bundle = (Bundle) element;
86-
8785
List<Object> folders = new ArrayList<>(9);
8886

8987
folders.add(new Attribute(Attribute.F_LOCATION, bundle.getLocation()));

ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,8 @@ protected StyledString getStyledText(Object element) {
340340
return new StyledString(text);
341341
}
342342
}
343-
if (element instanceof Extension) {
343+
if (element instanceof Extension extension) {
344344
if (((RegistryBrowserContentProvider) fRegistryBrowser.getAdapter(IContentProvider.class)).isInExtensionSet) {
345-
Extension extension = ((Extension) element);
346-
347345
StyledString ss = new StyledString(extension.getExtensionPointUniqueIdentifier());
348346
String name = extension.getLabel();
349347
if (name != null && name.length() > 0) {

0 commit comments

Comments
 (0)