changeset 3394:6347efd1be03 jdk-9+119

8156950: NPE while accessing ExportsDirectives.getTargetModules Reviewed-by: jjg
author ksrini
date Sat, 14 May 2016 08:03:03 -0700
parents 41b5241b25d3
children 4c87c9299cee 1578b957d223 fd398d3bb56a
files src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java	Thu May 12 18:47:23 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java	Sat May 14 08:03:03 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -98,7 +98,9 @@
 
         @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public java.util.List<? extends ModuleElement> getTargetModules() {
-            return Collections.unmodifiableList(modules);
+            return modules == null
+                    ? null
+                    : Collections.unmodifiableList(modules);
         }
 
         @Override