Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using deprecated URL constructor in JEPluginImages #1938

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005 IBM Corporation and others.
* Copyright (c) 2005, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,18 +14,12 @@

package org.eclipse.jdt.jeview;

import java.net.MalformedURLException;
import java.net.URL;

import org.eclipse.jface.resource.ImageDescriptor;


public class JEPluginImages {

private static URL fgIconBaseURL= null;
static {
fgIconBaseURL= JEViewPlugin.getDefault().getBundle().getEntry("/icons/c/"); //$NON-NLS-1$
}
private static final String fgIconBase= "/icons/c/";

public static final String CHILDREN= "children.png";
public static final String INFO= "info.png";
Expand All @@ -43,11 +37,7 @@ public class JEPluginImages {
public static final ImageDescriptor IMG_SET_FOCUS_CODE_SELECT= create(CODE_SELECT);

private static ImageDescriptor create(String name) {
try {
return ImageDescriptor.createFromURL(new URL(fgIconBaseURL, name));
} catch (MalformedURLException e) {
return ImageDescriptor.getMissingImageDescriptor();
}
return ImageDescriptor.createFromURL(JEViewPlugin.getDefault().getBundle().getEntry(fgIconBase+ name));
}

private JEPluginImages() {
Expand Down
Loading