File tree Expand file tree Collapse file tree
palantir-java-format-jdk-bootstrap/src/test/java/com/palantir/javaformat/bootstrap
palantir-java-format-native
src/main/resources/META-INF/native-image Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ type : fix
2+ fix :
3+ description : Native image IncludeAllLocales and updates reachability-metadata's
4+ resources glob to include all entries under `com/sun/tools/javac/resources/**`
5+ links :
6+ - https://github.com/palantir/palantir-java-format/pull/1240
Original file line number Diff line number Diff line change @@ -78,6 +78,23 @@ void can_format_large_input_file(FormatterService formatterService) throws Forma
7878 });
7979 }
8080
81+ @ ParameterizedTest
82+ @ MethodSource ("getFormatters" )
83+ void no_replacements_for_invalid_input (FormatterService formatterService ) throws FormatterException {
84+ String input =
85+ """
86+ class Foo {
87+
88+ /* hello*/
89+ public void main( String aaaa ) {
90+ System.out.println("aaaaa"}; }
91+ }
92+ """ ;
93+
94+ assertThat (formatterService .getFormatReplacements (input , List .of (Range .open (0 , input .length ()))))
95+ .isEmpty ();
96+ }
97+
8198 private static Stream <FormatterService > getFormatters () {
8299 return Stream .of (
83100 new BootstrappingFormatterService (
Original file line number Diff line number Diff line change @@ -56,8 +56,7 @@ graalvmNative {
5656 configurationFileDirectories. from(file(' src/main/resources/META-INF/native-image' ))
5757 buildArgs. addAll(
5858 ' -H:+UnlockExperimentalVMOptions' ,
59- ' -H:IncludeResourceBundles=com.sun.tools.javac.resources.compiler' ,
60- ' -H:IncludeResourceBundles=com.sun.tools.javac.resources.javac' ,
59+ ' -H:+IncludeAllLocales' ,
6160 ' --no-fallback' ,
6261 ' --initialize-at-build-time=com.sun.tools.javac.file.Locations' ,
6362 ' -H:+ReportExceptionStackTraces' ,
@@ -69,12 +68,6 @@ graalvmNative {
6968 }
7069}
7170
72-
73- // The image requires parameters to be passed to; eg. gw nativeRun -Pargs=--palantir,-i,<file>
74- tasks. named(" nativeRun" , org.graalvm.buildtools.gradle.tasks.NativeRunTask ) {
75- runtimeArgs. addAll(project. hasProperty(' appArgs' ) ? project. appArgs. split(' ,' ) : [])
76- }
77-
7871if (Optional . ofNullable(System . getenv(" CI" )). isPresent()) {
7972 externalPublishing {
8073 publication(' nativeImage' ) {
Original file line number Diff line number Diff line change 4747 "allDeclaredFields" : true
4848 },
4949 {
50- "type" : " com.google.common.collect.SingletonImmutableList " ,
50+ "type" : " com.google.common.collect.RegularImmutableList " ,
5151 "allDeclaredFields" : true
5252 },
5353 {
54- "type" : " com.google.common.collect.RegularImmutableList " ,
54+ "type" : " com.google.common.collect.SingletonImmutableList " ,
5555 "allDeclaredFields" : true
5656 },
5757 {
164164 "glob" : " META-INF/services/java.lang.System$LoggerFinder"
165165 },
166166 {
167- "glob" : " com/sun/tools/javac/resources/compiler_en.properties"
168- },
169- {
170- "glob" : " com/sun/tools/javac/resources/compiler_en_US.properties"
167+ "glob" : " com/sun/tools/javac/resources/**"
171168 },
172169 {
173170 "module" : " jdk.compiler" ,
174- "glob" : " com/sun/tools/javac/resources/compiler_en.properties"
175- },
176- {
177- "module" : " jdk.compiler" ,
178- "glob" : " com/sun/tools/javac/resources/compiler_en_US.properties"
171+ "glob" : " com/sun/tools/javac/resources/**"
179172 }
180173 ],
181174 "bundles" : [
182175 {
183- "name" : " com.sun.tools.javac.resources.compiler" ,
184- "locales" : [
185- " en-US "
186- ]
176+ "name" : " com.sun.tools.javac.resources.compiler"
177+ },
178+ {
179+ "name" : " com.sun.tools.javac.resources.javac "
187180 }
188181 ],
189182 "jni" : [
You can’t perform that action at this time.
0 commit comments