Skip to content

Commit 18abd58

Browse files
Perform clean code of ui/org.eclipse.pde.runtime
1 parent 3807d8b commit 18abd58

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
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) {

ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveMenuSection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private void createActionContributionItemText(Object object, StringBuilder buffe
144144
} else {
145145
// normal JFace Actions
146146
Class<? extends IAction> clazz = action.getClass();
147-
buffer.append(toolkit.createClassSection(text, PDERuntimeMessages.ActiveMenuSection_5, new Class[] {clazz}));
147+
buffer.append(toolkit.createClassSection(text, PDERuntimeMessages.ActiveMenuSection_5, clazz));
148148
Bundle bundle = FrameworkUtil.getBundle(clazz);
149149
toolkit.generatePluginDetailsText(bundle, null, "meow", buffer, text); //$NON-NLS-1$
150150
}

ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActivePartSection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void build(ScrolledForm form, SpyFormToolkit toolkit, ExecutionEvent even
9595
} else {
9696
buffer.append(toolkit.createClassSection(text,
9797
NLS.bind(PDERuntimeMessages.SpyDialog_activePart_desc, partType),
98-
new Class<?>[] { part.getClass(), mPart.getObject().getClass() }));
98+
part.getClass(), mPart.getObject().getClass()));
9999
}
100100

101101
if (part instanceof PageBookView outline) {

0 commit comments

Comments
 (0)