Skip to content

Commit 26523bf

Browse files
committed
fix compile warnings
1 parent 25dbb72 commit 26523bf

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/ResourceUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ public static Capability getContentCapability(Resource resource) throws IllegalA
129129
String urlString = String.valueOf(url);
130130

131131
try {
132-
new URL(urlString);
132+
new URI(urlString).toURL();
133133
return c;
134-
} catch (MalformedURLException mue) {
134+
} catch (MalformedURLException | URISyntaxException mue) {
135135
// Oh well, just try the next one
136136
}
137137
}
@@ -155,9 +155,9 @@ public static URI getURI(Capability contentCapability) {
155155
return ((URL) uriObj).toURI();
156156
}
157157

158-
if (uriObj instanceof String) {
158+
if (uriObj instanceof String uriStr) {
159159
try {
160-
URL url = new URL((String) uriObj);
160+
URL url = new URI(uriStr).toURL();
161161
return url.toURI();
162162
} catch (MalformedURLException mfue) {
163163
// Ignore

ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/views/resolution/ResolutionView.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
import org.eclipse.swt.layout.GridData;
9797
import org.eclipse.swt.layout.GridLayout;
9898
import org.eclipse.swt.widgets.Composite;
99-
import org.eclipse.swt.widgets.Control;
10099
import org.eclipse.swt.widgets.Display;
101100
import org.eclipse.swt.widgets.Event;
102101
import org.eclipse.swt.widgets.Label;
@@ -250,7 +249,7 @@ public void createPartControl(Composite parent) {
250249
reqsLayout.marginHeight = 0;
251250
reqsLayout.verticalSpacing = 2;
252251
reqsPanel.setLayout(reqsLayout);
253-
Control reqsFilterPanel = reqsFilterPart.createControl(reqsPanel, 5, 5);
252+
reqsFilterPart.createControl(reqsPanel, 5, 5);
254253
reqsFilterPart.setHint(SEARCHSTRING_HINT);
255254
reqsFilterPart.addPropertyChangeListener(event -> {
256255
String filter = (String) event.getNewValue();
@@ -286,7 +285,7 @@ public void createPartControl(Composite parent) {
286285
capsLayout.marginHeight = 0;
287286
capsLayout.verticalSpacing = 2;
288287
capsPanel.setLayout(capsLayout);
289-
Control capsFilterPanel = capsFilterPart.createControl(capsPanel, 5, 5);
288+
capsFilterPart.createControl(capsPanel, 5, 5);
290289
capsFilterPart.setHint(SEARCHSTRING_HINT);
291290
capsFilterPart.addPropertyChangeListener(event -> {
292291
String filter = (String) event.getNewValue();

0 commit comments

Comments
 (0)