Fix warnings ( see Bug 350377 - [Browser] Default browser detection should use environment variables )
diff --git a/bundles/org.eclipse.ui.browser/plugin.properties b/bundles/org.eclipse.ui.browser/plugin.properties
index f5faa3b..dd6e395 100644
--- a/bundles/org.eclipse.ui.browser/plugin.properties
+++ b/bundles/org.eclipse.ui.browser/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2005, 2009 IBM Corporation and others.
+# Copyright (c) 2005, 2011 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserExt.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserExt.java
index 973a0c4..12627e9 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserExt.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserExt.java
@@ -66,7 +66,7 @@
}
public String[] getDefaultLocations() {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
IConfigurationElement[] children = element.getChildren("location"); //$NON-NLS-1$
if (children != null) {
int size = children.length;
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserManager.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserManager.java
index bceae80..10113aa 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserManager.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
@@ -30,7 +31,7 @@
*
*/
public class BrowserManager extends Observable {
- protected List browsers;
+ protected List<IBrowserDescriptor> browsers;
protected IBrowserDescriptor currentBrowser;
private IPreferenceChangeListener pcl;
@@ -60,7 +61,7 @@
};
- InstanceScope instanceScope = new InstanceScope();
+ IScopeContext instanceScope = InstanceScope.INSTANCE;
IEclipsePreferences prefs = instanceScope.getNode(WebBrowserUIPlugin.PLUGIN_ID);
prefs.addPreferenceChangeListener(pcl);
}
@@ -72,7 +73,7 @@
}
protected void dispose() {
- InstanceScope instanceScope = new InstanceScope();
+ IScopeContext instanceScope = InstanceScope.INSTANCE;
IEclipsePreferences prefs = instanceScope.getNode(WebBrowserUIPlugin.PLUGIN_ID);
prefs.removePreferenceChangeListener(pcl);
}
@@ -81,10 +82,10 @@
return new BrowserDescriptorWorkingCopy();
}
- public List getWebBrowsers() {
+ public List<IBrowserDescriptor> getWebBrowsers() {
if (browsers == null)
loadBrowsers();
- return new ArrayList(browsers);
+ return new ArrayList<IBrowserDescriptor>(browsers);
}
public void loadBrowsers() {
@@ -93,7 +94,7 @@
String xmlString = Platform.getPreferencesService().getString
(WebBrowserUIPlugin.PLUGIN_ID, "browsers", null, null); //$NON-NLS-1$
if (xmlString != null && xmlString.length() > 0) {
- browsers = new ArrayList();
+ browsers = new ArrayList<IBrowserDescriptor>();
try {
ByteArrayInputStream in = new ByteArrayInputStream(xmlString.getBytes("utf-8")); //$NON-NLS-1$
@@ -114,7 +115,7 @@
Integer current = memento.getInteger("current"); //$NON-NLS-1$
if (current != null) {
- currentBrowser = (IBrowserDescriptor) browsers.get(current.intValue());
+ currentBrowser = browsers.get(current.intValue());
}
} catch (Exception e) {
Trace.trace(Trace.WARNING, "Could not load browsers: " + e.getMessage()); //$NON-NLS-1$
@@ -132,7 +133,7 @@
}
if (currentBrowser == null && browsers.size() > 0)
- currentBrowser = (IBrowserDescriptor) browsers.get(0);
+ currentBrowser = browsers.get(0);
setChanged();
notifyObservers();
}
@@ -142,7 +143,7 @@
ignorePreferenceChanges = true;
XMLMemento memento = XMLMemento.createWriteRoot("web-browsers"); //$NON-NLS-1$
- Iterator iterator = browsers.iterator();
+ Iterator<IBrowserDescriptor> iterator = browsers.iterator();
while (iterator.hasNext()) {
Object obj = iterator.next();
if (obj instanceof BrowserDescriptor) {
@@ -159,7 +160,7 @@
StringWriter writer = new StringWriter();
memento.save(writer);
String xmlString = writer.getBuffer().toString();
- InstanceScope instanceScope = new InstanceScope();
+ IScopeContext instanceScope = InstanceScope.INSTANCE;
IEclipsePreferences prefs = instanceScope.getNode(WebBrowserUIPlugin.PLUGIN_ID);
prefs.put("browsers", xmlString); //$NON-NLS-1$
prefs.flush();
@@ -170,7 +171,7 @@
}
protected void setupDefaultBrowsers() {
- browsers = new ArrayList();
+ browsers = new ArrayList<IBrowserDescriptor>();
// add system browser
if (WebBrowserUtil.canUseSystemBrowser()) {
@@ -183,7 +184,7 @@
// by default, if internal is there, that is current, else set the first external one
if (!browsers.isEmpty() && currentBrowser == null)
- currentBrowser = (IBrowserDescriptor) browsers.get(0);
+ currentBrowser = browsers.get(0);
}
protected void addBrowser(IBrowserDescriptor browser) {
@@ -203,7 +204,7 @@
if (currentBrowser == null || currentBrowser.equals(browser)) {
currentBrowser = null;
if (browsers.size() > 0)
- currentBrowser = (IBrowserDescriptor) browsers.get(0);
+ currentBrowser = browsers.get(0);
}
}
@@ -212,7 +213,7 @@
loadBrowsers();
if (currentBrowser == null && browsers.size() > 0)
- return (IBrowserDescriptor) browsers.get(0);
+ return browsers.get(0);
return currentBrowser;
}
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserViewer.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserViewer.java
index d42d041..29d178e 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserViewer.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -110,7 +110,7 @@
protected boolean loading;
- protected static java.util.List history;
+ protected static java.util.List<String> history;
protected Browser browser;
@@ -124,7 +124,7 @@
protected int progressWorked = 0;
- protected List propertyListeners;
+ protected List<PropertyChangeListener> propertyListeners;
/**
* Under development - do not use
@@ -467,7 +467,7 @@
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (propertyListeners == null)
- propertyListeners = new ArrayList();
+ propertyListeners = new ArrayList<PropertyChangeListener>();
propertyListeners.add(listener);
}
@@ -670,7 +670,7 @@
int found = -1;
int size = history.size();
for (int i = 0; i < size; i++) {
- String s = (String) history.get(i);
+ String s = history.get(i);
if (s.equals(url)) {
found = i;
break;
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/DefaultBrowserSupport.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/DefaultBrowserSupport.java
index a1187c1..ed86417 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/DefaultBrowserSupport.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/DefaultBrowserSupport.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@
static final String DEFAULT_ID_BASE = "org.eclipse.ui.defaultBrowser"; //$NON-NLS-1$
private static final String HELP_BROWSER_ID = "org.eclipse.help.ui"; //$NON-NLS-1$
- protected HashMap browserIdMap = new HashMap();
+ protected HashMap<String, Object> browserIdMap = new HashMap<String, Object>();
protected static DefaultBrowserSupport instance;
@@ -58,6 +58,7 @@
if (obj instanceof IWebBrowser)
browser = (IWebBrowser) obj;
else if (obj instanceof HashMap) {
+ @SuppressWarnings("rawtypes")
HashMap wmap = (HashMap) obj;
IWorkbenchWindow window = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow();
@@ -139,9 +140,10 @@
IWorkbenchWindow window = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow();
Integer key = getWindowKey(window);
- HashMap wmap = (HashMap) browserIdMap.get(browserId);
+ @SuppressWarnings("unchecked")
+ HashMap<Integer, IWebBrowser> wmap = (HashMap<Integer, IWebBrowser>) browserIdMap.get(browserId);
if (wmap == null) {
- wmap = new HashMap();
+ wmap = new HashMap<Integer, IWebBrowser>();
browserIdMap.put(browserId, wmap);
}
wmap.put(key, webBrowser);
@@ -179,6 +181,7 @@
Integer key = ((InternalBrowserInstance) browser).getWindowKey();
Object entry = browserIdMap.get(baseId);
if (entry != null && entry instanceof HashMap) {
+ @SuppressWarnings("rawtypes")
HashMap wmap = (HashMap) entry;
wmap.remove(key);
if (wmap.isEmpty())
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageResource.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageResource.java
index 2346e00..ab2fe2f 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageResource.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageResource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@
// map of image descriptors since these
// will be lost by the image registry
- private static Map imageDescriptors;
+ private static Map<String, ImageDescriptor> imageDescriptors;
private static Image[] busyImages;
@@ -105,7 +105,7 @@
public static ImageDescriptor getImageDescriptor(String key) {
if (imageRegistry == null)
initializeImageRegistry();
- return (ImageDescriptor) imageDescriptors.get(key);
+ return imageDescriptors.get(key);
}
/**
@@ -113,7 +113,7 @@
*/
protected static void initializeImageRegistry() {
imageRegistry = new ImageRegistry();
- imageDescriptors = new HashMap();
+ imageDescriptors = new HashMap<String, ImageDescriptor>();
// load Web browser images
registerImage(IMG_ELCL_NAV_BACKWARD, URL_ELCL + "nav_backward.gif"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditor.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditor.java
index dc26129..f1c0a0e 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditor.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -177,7 +177,7 @@
URL url = null;
try {
if (path != null)
- url = path.toFile().toURL();
+ url = path.toFile().toURI().toURL();
initialURL = url.toExternalForm();
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error getting URL to file"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
index eb2e3e9..6e6637f 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -219,6 +219,7 @@
* @return a object castable to the given class, or <code>null</code> if
* this object does not have an adapter for the given class
*/
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
return null;
}
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreference.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreference.java
index e2f575c..7229540 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreference.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
import java.util.StringTokenizer;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IEditorDescriptor;
@@ -62,11 +63,11 @@
*
* @return java.util.List
*/
- public static List getInternalWebBrowserHistory() {
+ public static List<String> getInternalWebBrowserHistory() {
String temp = getPreferenceStore().getString(
PREF_INTERNAL_WEB_BROWSER_HISTORY);
StringTokenizer st = new StringTokenizer(temp, "|*|"); //$NON-NLS-1$
- List l = new ArrayList();
+ List<String> l = new ArrayList<String>();
while (st.hasMoreTokens()) {
String s = st.nextToken();
l.add(s);
@@ -80,17 +81,17 @@
* @param list
* the history
*/
- public static void setInternalWebBrowserHistory(List list) {
+ public static void setInternalWebBrowserHistory(List<String> list) {
StringBuffer sb = new StringBuffer();
if (list != null) {
- Iterator iterator = list.iterator();
+ Iterator<String> iterator = list.iterator();
while (iterator.hasNext()) {
- String s = (String) iterator.next();
+ String s = iterator.next();
sb.append(s);
sb.append("|*|"); //$NON-NLS-1$
}
}
- InstanceScope instanceScope = new InstanceScope();
+ IScopeContext instanceScope = InstanceScope.INSTANCE;
IEclipsePreferences prefs = instanceScope.getNode(WebBrowserUIPlugin.PLUGIN_ID);
prefs.put(PREF_INTERNAL_WEB_BROWSER_HISTORY,
sb.toString());
@@ -140,7 +141,7 @@
* </code>INTERNAL</code>, <code>SYSTEM</code> and <code>EXTERNAL</code>
*/
public static void setBrowserChoice(int choice) {
- InstanceScope instanceScope = new InstanceScope();
+ IScopeContext instanceScope = InstanceScope.INSTANCE;
IEclipsePreferences prefs = instanceScope.getNode(WebBrowserUIPlugin.PLUGIN_ID);
prefs.putInt(PREF_BROWSER_CHOICE, choice);
try {
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreferencePage.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreferencePage.java
index 4d9d601..0857fa7 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreferencePage.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -89,11 +89,11 @@
class BrowserContentProvider implements IStructuredContentProvider {
public Object[] getElements(Object inputElement) {
- List list = new ArrayList();
- Iterator iterator = BrowserManager.getInstance().getWebBrowsers()
+ List<IBrowserDescriptor> list = new ArrayList<IBrowserDescriptor>();
+ Iterator<IBrowserDescriptor> iterator = BrowserManager.getInstance().getWebBrowsers()
.iterator();
while (iterator.hasNext()) {
- IBrowserDescriptor browser = (IBrowserDescriptor) iterator
+ IBrowserDescriptor browser = iterator
.next();
list.add(browser);
}
@@ -305,7 +305,7 @@
BrowserManager manager = BrowserManager.getInstance();
if (browser2 == checkedBrowser) {
if (manager.browsers.size() > 0) {
- checkedBrowser = (IBrowserDescriptor) manager.browsers.get(0);
+ checkedBrowser = manager.browsers.get(0);
tableViewer.setChecked(checkedBrowser, true);
}
}
@@ -386,7 +386,7 @@
BrowserManager manager = BrowserManager.getInstance();
if (browser2 == checkedBrowser) {
if (manager.browsers.size() > 0) {
- checkedBrowser = (IBrowserDescriptor) manager.browsers.get(0);
+ checkedBrowser = manager.browsers.get(0);
tableViewer.setChecked(checkedBrowser, true);
}
}
@@ -401,8 +401,8 @@
data.verticalIndent = 9;
search.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- final List foundBrowsers = new ArrayList();
- final List existingPaths = WebBrowserUtil
+ final List<IBrowserDescriptorWorkingCopy> foundBrowsers = new ArrayList<IBrowserDescriptorWorkingCopy>();
+ final List<String> existingPaths = WebBrowserUtil
.getExternalBrowserPaths();
// select a target directory for the search
@@ -421,7 +421,7 @@
public void run(IProgressMonitor monitor) {
monitor.beginTask(Messages.searchingTaskName,
IProgressMonitor.UNKNOWN);
- search(rootDir, existingPaths, foundBrowsers, new HashSet(), monitor);
+ search(rootDir, existingPaths, foundBrowsers, new HashSet<String>(), monitor);
monitor.done();
}
};
@@ -442,16 +442,16 @@
if (pm.getProgressMonitor().isCanceled())
return;
- List browsersToCreate = foundBrowsers;
+ List<IBrowserDescriptorWorkingCopy> browsersToCreate = foundBrowsers;
if (browsersToCreate.isEmpty()) { // no browsers found
WebBrowserUtil.openMessage(Messages.searchingNoneFound);
return;
}
- Iterator iterator = browsersToCreate.iterator();
+ Iterator<IBrowserDescriptorWorkingCopy> iterator = browsersToCreate.iterator();
while (iterator.hasNext()) {
- IBrowserDescriptorWorkingCopy browser2 = (IBrowserDescriptorWorkingCopy) iterator
+ IBrowserDescriptorWorkingCopy browser2 = iterator
.next();
browser2.save();
}
@@ -532,8 +532,8 @@
}
}
- protected static void search(File directory, List existingPaths,
- List foundBrowsers, Set directoriesVisited, IProgressMonitor monitor) {
+ protected static void search(File directory, List<String> existingPaths,
+ List<IBrowserDescriptorWorkingCopy> foundBrowsers, Set<String> directoriesVisited, IProgressMonitor monitor) {
if (monitor.isCanceled())
return;
try {
@@ -551,7 +551,7 @@
new String[] { Integer.toString(foundBrowsers.size()), directory.getAbsolutePath()}));
String[] names = directory.list();
- List subDirs = new ArrayList();
+ List<File> subDirs = new ArrayList<File>();
for (int i = 0; i < names.length; i++) {
if (monitor.isCanceled())
@@ -574,7 +574,7 @@
}
}
while (!subDirs.isEmpty()) {
- File subDir = (File) subDirs.remove(0);
+ File subDir = subDirs.remove(0);
search(subDir, existingPaths, foundBrowsers, directoriesVisited, monitor);
if (monitor.isCanceled()) {
return;
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java
index 79a969b..4631747 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,7 +31,7 @@
private static WebBrowserUIPlugin singleton;
// cached copy of all browsers
- private static List browsers;
+ private static List<BrowserExt> browsers;
/**
* Create the WebBrowserUIPlugin
@@ -112,7 +112,7 @@
IConfigurationElement[] cf = registry.getConfigurationElementsFor(PLUGIN_ID, "browsers"); //$NON-NLS-1$
int size = cf.length;
- browsers = new ArrayList(size);
+ browsers = new ArrayList<BrowserExt>(size);
for (int i = 0; i < size; i++) {
try {
browsers.add(new BrowserExt(cf[i]));
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java
index 36d712b..cbf57b1 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java
@@ -191,7 +191,7 @@
* Add any supported EXTERNAL web browsers found after an arbitrary check in
* specific paths
*/
- public static void addFoundBrowsers(List<BrowserDescriptor> list) {
+ public static void addFoundBrowsers(List<IBrowserDescriptor> browsers2) {
List<String> paths = getExternalBrowserPaths();
String os = Platform.getOS();
@@ -216,7 +216,7 @@
descriptor.location = foundBrowserPath;
descriptor.parameters = browserExt
.getParameters();
- list.add(descriptor);
+ browsers2.add(descriptor);
j += size2;
}
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserView.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserView.java
index 9d98198..1bfb8f7 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserView.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserView.java
@@ -135,7 +135,7 @@
File file = path.toFile();
if (file.exists() && isWebFile(file.getName()))
try {
- return file.toURL();
+ return file.toURI().toURL();
} catch (MalformedURLException e) {
return null;
}
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserViewDropAdapter.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserViewDropAdapter.java
index 8a535a3..4acedb0 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserViewDropAdapter.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserViewDropAdapter.java
@@ -128,7 +128,7 @@
return true;
File f = new File(s[0]);
try {
- view.setURL(f.toURL().toExternalForm());
+ view.setURL(f.toURI().toURL().toExternalForm());
} catch (Exception e) {
// TODO
}
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/DefaultBrowser.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/DefaultBrowser.java
index 6b220ef..a624374 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/DefaultBrowser.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/DefaultBrowser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -73,7 +73,7 @@
* @return String[]
*/
protected String[] prepareCommand(String path, String url) {
- ArrayList tokenList = new ArrayList();
+ ArrayList<String> tokenList = new ArrayList<String>();
//Divide along quotation marks
StringTokenizer qTokenizer = new StringTokenizer(path.trim(),
"\"", true); //$NON-NLS-1$
@@ -109,7 +109,7 @@
// substitute %1 by url
boolean substituted = false;
for (int i = 0; i < tokenList.size(); i++) {
- String token = (String) tokenList.get(i);
+ String token = tokenList.get(i);
String newToken = doSubstitutions(token, url);
if (newToken != null) {
tokenList.set(i, newToken);
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/SafariBrowser.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/SafariBrowser.java
index 6d8b876..be8f16a 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/SafariBrowser.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/SafariBrowser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@
url = url.substring(5);
}
- ArrayList tokenList = new ArrayList();
+ ArrayList<String> tokenList = new ArrayList<String>();
//Divide along quotation marks
StringTokenizer qTokenizer = new StringTokenizer(path.trim(),
"\"", true); //$NON-NLS-1$
@@ -66,7 +66,7 @@
// substitute %1 by url
boolean substituted = false;
for (int i = 0; i < tokenList.size(); i++) {
- String token = (String) tokenList.get(i);
+ String token = tokenList.get(i);
String newToken = doSubstitutions(token, url);
if (newToken != null) {
tokenList.set(i, newToken);