You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like the update of javac would solve this problem, if -source 9 could be specified:
com.google.googlejavaformat.java.FormatterException: 1:2: error: modules are not supported in -source 1.8
(use -source 9 or higher to enable modules)
at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:242)
at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:216)
at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:202)
at com.google.googlejavaformat.java.Java9SourceTest.issue75(Java9SourceTest.java:30)
I added initial support for this in c31bb19. If anyone's interested in trying it out, please report any issues you find - we don't have a huge corpus of module-infos to test against yet.
I'll cut a new release soon that includes that change unless any issues turn up.
While running against all 350 module descriptors found in an OpenJDK mirror, I found something in openjdk-jdk9\langtools\test\jdk\javadoc\doclet\testModules\moduletags\module-info.java:
Activity
cushon commentedon Sep 13, 2016
I'd prefer (2), but I'm also not sure what the timeline is for ecj's java 9 support.
sormuras commentedon Sep 13, 2016
I prefer (2) as well, but (1) could serve as an interim solution, until ECJ supports Java 9.
sormuras commentedon Nov 7, 2016
Latest module syntax with layout example can be found here: http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html
sormuras commentedon Jun 9, 2017
Any news on ecj's java 9 support? The
com.google.errorprone:javac:9-dev-r3297-1-shadeddoes not contain it, I guess.cushon commentedon Jun 10, 2017
We migrated from ecj to javac. javac has JDK 9 support, but I'm not sure if the version the formatter is using is new enough.
sormuras commentedon Jun 10, 2017
According to http://central.maven.org/maven2/com/google/errorprone/javac/ there's a:
But it is missing the
-shadedsuffix: 9-dev-r3297-1-shadedAlthough the file size suggests it does include all dependencies... but
org.openjdk.tools.javac.**.*types are missing.sormuras commentedon Aug 20, 2017
Seems like the update of
javacwould solve this problem, if-source 9could be specified:Initial support for formatting module-info files
cushon commentedon Aug 22, 2017
I added initial support for this in c31bb19. If anyone's interested in trying it out, please report any issues you find - we don't have a huge corpus of
module-infos to test against yet.I'll cut a new release soon that includes that change unless any issues turn up.
sormuras commentedon Aug 22, 2017
On may way!
sormuras commentedon Aug 22, 2017
LGTM.
All branches of the JLS module production are hit by the example
M1input/output pair:sormuras commentedon Aug 22, 2017
Great news! (With tiny chance seeing #106 included as well?)
sormuras commentedon Aug 22, 2017
Also all 30
module-info.javafiles in https://github.com/AdoptOpenJDK/jdk9-jigsaw were formatted successfully.Generated patch looks ok
sormuras commentedon Aug 22, 2017
While running against all 350 module descriptors found in an OpenJDK mirror, I found something in
openjdk-jdk9\langtools\test\jdk\javadoc\doclet\testModules\moduletags\module-info.java:Looks a like file to test the "(one of)" rule from the
requiresproduction.Here is the error message, with some more invalid(?) module files:
All other 346
module-info.javafiles were successfully formatted.sormuras commentedon Aug 22, 2017
See OpenJDK diff/patch here: https://gist.github.com/sormuras/d85612b0e20bd98746aed1b347d064bd
Be agnostic order of 'requires' and 'transitive'
cushon commentedon Aug 23, 2017
Thanks for testing! f74657c fixes the issue with
requires transitive static.sormuras commentedon Sep 6, 2017
Fixed in release 1.4