diff options
author | Brian de Alwis | 2016-05-08 02:51:40 +0000 |
---|---|---|
committer | Brian de Alwis | 2016-05-10 18:45:06 +0000 |
commit | ceb062f8568392a4fc410c9a5bf5faa2fcc5d9fa (patch) | |
tree | 8f4d9a6645f9427bda65e9089b691e8ce235f1b9 | |
parent | 00b622f98bf8aa4c79f03fbffa28e3bfc9a2eca6 (diff) | |
download | eclipse.platform.ua-ceb062f8568392a4fc410c9a5bf5faa2fcc5d9fa.tar.gz eclipse.platform.ua-ceb062f8568392a4fc410c9a5bf5faa2fcc5d9fa.tar.xz eclipse.platform.ua-ceb062f8568392a4fc410c9a5bf5faa2fcc5d9fa.zip |
Bug 491556 - [Welcome] Provide theme-specific mechanism to influence path resolutionY20160513-1000I20160513-2000I20160512-1000I20160511-2000I20160511-0400I20160510-2000
resolveVariable() previously returned null when resolving a product:
file that didn't exist, and the original value on an IOException.
Change-Id: Ic0039970a1c05fe22803c3c020f26319fa52e104
-rw-r--r-- | org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java index 06bfddc28..52b2f05a2 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java @@ -181,33 +181,33 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements if (value == null) { return null; } - if (value.startsWith("intro:")) { //$NON-NLS-1$ - bundle = UniversalIntroPlugin.getDefault().getBundle(); - return resolveFile(bundle, value.substring(6)); - } else if (value.startsWith("product:")) { //$NON-NLS-1$ - return resolveFile(bundle, value.substring(8)); + try { + if (value.startsWith("intro:")) { //$NON-NLS-1$ + bundle = UniversalIntroPlugin.getDefault().getBundle(); + return resolveFile(bundle, value.substring(6)); + } else if (value.startsWith("product:")) { //$NON-NLS-1$ + return resolveFile(bundle, value.substring(8)); + } + } catch (IOException e) { + // just use the value as-is } return value; } - private String resolveFile(Bundle bundle, String path) { + private String resolveFile(Bundle bundle, String path) throws IOException { String prefixedPath = getThemePrefixedPath(path); - try { - URL url = null; - if (prefixedPath != null) { - url = bundle.getEntry(prefixedPath); - } - if (url == null) { - url = bundle.getEntry(path); - } - if (url != null) { - URL localURL = FileLocator.toFileURL(url); - return localURL.toString(); - } - } catch (IOException e) { + URL url = null; + if (prefixedPath != null) { + url = bundle.getEntry(prefixedPath); + } + if (url == null) { + url = bundle.getEntry(path); } - // just use the value as-is - return path; + if (url != null) { + URL localURL = FileLocator.toFileURL(url); + return localURL.toString(); + } + return null; } /** |