JDK 9 RFR of JDK-8173609: Elements.printElements needs to support modules
Joseph D. Darcy
joe.darcy at oracle.com
Mon Jan 30 23:15:14 UTC 2017
Hi Bernard,
On 1/30/2017 5:50 AM, B. Blaser wrote:
> Joe,
>
> 2017-01-28 22:39 GMT+01:00 joe darcy <joe.darcy at oracle.com>:
>> Hello,
>>
>> Please review the straightforward fix to address:
>>
>> JDK-8173609: Elements.printElements needs to support modules
>> http://cr.openjdk.java.net/~darcy/8173609.0/
>>
>> Once additional information about modules is available (JDK-8172810:
>> ModuleElement should declare and provide appropriate modifiers), the
>> printing processor should be updated to expose that information.
>>
>> Admittedly this changeset would be better with some regression testing.
>>
>> Thanks,
>>
>> -Joe
>>
> Here is a test for that.
> Regards,
> Bernard
Thanks for patch for the test.
We've largely abandoned the bug number based scheme for categorizing
tests; it became cumbersome to find the tests we were looking for as the
set of tests grew.
Since the functionality in question is related to the annotation
processing implementation in javac, I think a location under
test/tools/javac/processing/model/util would be more appropriate.
Also for a source-based test, it would be more complete to also examine
doc comments and annotations. If you make those amendments, I can push
the test as follow-up work (since I've already pushed the code change).
Thanks,
-Joe
>
> diff --git a/test/tools/javac/modules/T8173609/module-info.java
> b/test/tools/javac/modules/T8173609/module-info.java
> new file mode 100644
> --- /dev/null
> +++ b/test/tools/javac/modules/T8173609/module-info.java
> @@ -0,0 +1,13 @@
> +/*
> + * @test
> + * @bug 8173609
> + * @summary printing of modules
> + * @compile/ref=module-info.out -Xprint p/P.java module-info.java
> + */
> +module JDK_8173609 {
> + requires static transitive java.base;
> + exports p to m.m1, m.m2;
> + opens p to m.m1, m.m2;
> + uses p.P;
> + provides p.P with p.P.P1, p.P.P2;
> +}
> diff --git a/test/tools/javac/modules/T8173609/module-info.out
> b/test/tools/javac/modules/T8173609/module-info.out
> new file mode 100644
> --- /dev/null
> +++ b/test/tools/javac/modules/T8173609/module-info.out
> @@ -0,0 +1,23 @@
> +package p;
> +
> +public class P {
> +
> + public static class P1 extends p.P {
> +
> + public P1();
> + }
> +
> + public static class P2 extends p.P {
> +
> + public P2();
> + }
> +
> + public P();
> +}
> +module JDK_8173609 {
> + requires static transitive java.base;
> + exports p to m.m1, m.m2;
> + opens p to m.m1, m.m2;
> + uses p.P;
> + provides p.P with p.P.P1, p.P.P2;
> +}
> diff --git a/test/tools/javac/modules/T8173609/p/P.java
> b/test/tools/javac/modules/T8173609/p/P.java
> new file mode 100644
> --- /dev/null
> +++ b/test/tools/javac/modules/T8173609/p/P.java
> @@ -0,0 +1,6 @@
> +package p;
> +
> +public class P {
> + public static class P1 extends P {}
> + public static class P2 extends P {}
> +}
More information about the compiler-dev
mailing list