Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2017-10-03 13:07:13 +0000
committerSarika Sinha2017-10-03 13:07:13 +0000
commit40f63e10c26a0e4b0da854e36506a89852a88803 (patch)
treeb2bf7f525696d51ac09e143a57189e08a25fb8b2
parent14f77b8ecb5be93acc888e0644ee4706d4cb8864 (diff)
downloadeclipse.jdt.debug-40f63e10c26a0e4b0da854e36506a89852a88803.tar.gz
eclipse.jdt.debug-40f63e10c26a0e4b0da854e36506a89852a88803.tar.xz
eclipse.jdt.debug-40f63e10c26a0e4b0da854e36506a89852a88803.zip
Bug 525353 - Java 9 Application Start Delivers NullPointerExceptionI20171005-2000
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
index ebca8424a..55e296f92 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
@@ -951,7 +951,7 @@ public final class JavaRuntime {
break;
case IClasspathEntry.CPE_LIBRARY:
IPackageFragmentRoot root = project.findPackageFragmentRoot(entry.getPath());
- if (!root.getRawClasspathEntry().getPath().segment(0).contains("JRE_CONTAINER")) { //$NON-NLS-1$
+ if (root != null && !root.getRawClasspathEntry().getPath().segment(0).contains("JRE_CONTAINER")) { //$NON-NLS-1$
IRuntimeClasspathEntry r;
if (JavaRuntime.isModule(entry, project)) {
r = JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.MODULE_PATH);
@@ -982,13 +982,13 @@ public final class JavaRuntime {
* @since 3.10
*/
public static boolean isModule(IClasspathEntry entry, IJavaProject proj) {
- if (!isModularProject(proj)) {
+ if (entry == null) {
return false;
}
-
- if (entry == null) {
+ if (!isModularProject(proj)) {
return false;
}
+
for (IClasspathAttribute classpathAttribute : entry.getExtraAttributes()) {
if (classpathAttribute.getName().equals(IClasspathAttribute.MODULE) && "true".equals(classpathAttribute.getValue())) {//$NON-NLS-1$
return true;

Back to the top