Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Nice2018-11-15 16:59:12 +0000
committerjay2018-11-20 03:29:33 +0000
commit3e00ac385389b41dd7afc3cf048ac313c5570c74 (patch)
tree1bec31eb258374870e42af5980086dba1ccd34cc
parentcd18c5e54d23c07c921c7cbaeb64f4b29ed570e2 (diff)
downloadeclipse.jdt.debug-R4_9_maintenance.tar.gz
eclipse.jdt.debug-R4_9_maintenance.tar.xz
eclipse.jdt.debug-R4_9_maintenance.zip
Bug 541192 - improve release file handlingR4_9_maintenance
Don't allow exception to propagate if file is corrupted. Log message rather than printing to the console. Read file in default character set. Change-Id: I77a9e605e0e498b7156efbed585d9a652e940b39 Signed-off-by: Dave Nice <dave@niceweb.org.uk>
-rw-r--r--org.eclipse.jdt.launching/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java8
-rw-r--r--org.eclipse.jdt.launching/pom.xml2
3 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.jdt.launching/META-INF/MANIFEST.MF b/org.eclipse.jdt.launching/META-INF/MANIFEST.MF
index 65dda941a..d38c22f6e 100644
--- a/org.eclipse.jdt.launching/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.launching/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.launching; singleton:=true
-Bundle-Version: 3.11.0.qualifier
+Bundle-Version: 3.11.1.qualifier
Bundle-Activator: org.eclipse.jdt.internal.launching.LaunchingPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
index b1180ad07..ee00af0df 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
@@ -20,8 +20,10 @@ package org.eclipse.jdt.internal.launching;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
+import java.io.UncheckedIOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
@@ -845,15 +847,15 @@ public class StandardVMType extends AbstractVMInstallType {
if (Files.notExists(Paths.get(javaHome.getAbsolutePath(), RELEASE_FILE))) {
return version;
}
- try (Stream<String> lines = Files.lines(Paths.get(javaHome.getAbsolutePath(), RELEASE_FILE)).filter(s -> s.contains(JAVA_VERSION))) {
+ try (Stream<String> lines = Files.lines(Paths.get(javaHome.getAbsolutePath(), RELEASE_FILE), Charset.defaultCharset()).filter(s -> s.contains(JAVA_VERSION))) {
Optional<String> hasVersion = lines.findFirst();
if (hasVersion.isPresent()) {
String line = hasVersion.get();
version = line.substring(14, line.length() - 1); // length of JAVA_VERSION + 2 in JAVA_VERSION="9"
}
}
- catch (IOException e) {
- e.printStackTrace();
+ catch (UncheckedIOException | IOException e) {
+ LaunchingPlugin.log(e);
}
return version;
diff --git a/org.eclipse.jdt.launching/pom.xml b/org.eclipse.jdt.launching/pom.xml
index cde6c0faf..2713e369d 100644
--- a/org.eclipse.jdt.launching/pom.xml
+++ b/org.eclipse.jdt.launching/pom.xml
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.launching</artifactId>
- <version>3.11.0-SNAPSHOT</version>
+ <version>3.11.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>

Back to the top