changeset 4272:3c440892cf45

8163484: javax.lang.model.element.ModuleElement doesn't provide info about "requires static" and "exports dynamic"
author jjg
date Tue, 23 Aug 2016 19:49:42 -0700
parents 82914aba2ab3
children 5a5b5ef095c4
files src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java
diffstat 2 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java	Tue Aug 23 18:43:29 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java	Tue Aug 23 19:49:42 2016 -0700
@@ -127,6 +127,12 @@
      */
     interface RequiresDirective extends Directive {
         /**
+         * Returns whether or not this is a static dependency.
+         * @return whether or not this is a static dependency
+         */
+        boolean isStatic();
+
+        /**
          * Returns whether or not this is a transitive dependency.
          * @return whether or not this is a transitive dependency
          */
@@ -145,6 +151,18 @@
      */
     interface ExportsDirective extends Directive {
         /**
+         * Returns whether or not this is a dynamic exports.
+         * @return whether or not this is a dynamic exports
+         */
+        boolean isDynamic();
+
+        /**
+         * Returns whether or not this is a private exports.
+         * @return whether or not this is a private exports
+         */
+        boolean isPrivate();
+
+        /**
          * Returns the package being exported.
          * @return the package being exported
          */
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java	Tue Aug 23 18:43:29 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java	Tue Aug 23 19:49:42 2016 -0700
@@ -119,6 +119,16 @@
         }
 
         @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public boolean isDynamic() {
+            return flags.contains(ExportsFlag.DYNAMIC_PHASE);
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public boolean isPrivate() {
+            return flags.contains(ExportsFlag.PRIVATE_REFLECTION);
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public PackageElement getPackage() {
             return packge;
         }
@@ -210,6 +220,11 @@
         }
 
         @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public boolean isStatic() {
+            return flags.contains(RequiresFlag.STATIC_PHASE);
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public boolean isTransitive() {
             return flags.contains(RequiresFlag.TRANSITIVE);
         }