File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
main/java/com/google/googlejavaformat/java
test/resources/com/google/googlejavaformat/java/testdata Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 4747import org .openjdk .javax .tools .SimpleJavaFileObject ;
4848import org .openjdk .javax .tools .StandardLocation ;
4949import org .openjdk .tools .javac .file .JavacFileManager ;
50+ import org .openjdk .tools .javac .main .Option ;
5051import org .openjdk .tools .javac .parser .JavacParser ;
5152import org .openjdk .tools .javac .parser .ParserFactory ;
5253import org .openjdk .tools .javac .tree .JCTree .JCCompilationUnit ;
@@ -135,6 +136,10 @@ static void format(
135136 DiagnosticCollector <JavaFileObject > diagnostics = new DiagnosticCollector <>();
136137 context .put (DiagnosticListener .class , diagnostics );
137138 Options .instance (context ).put ("allowStringFolding" , "false" );
139+ // TODO(cushon): this should default to the latest supported source level, remove this after
140+ // backing out
141+ // https://github.com/google/error-prone-javac/commit/c97f34ddd2308302587ce2de6d0c984836ea5b9f
142+ Options .instance (context ).put (Option .SOURCE , "9" );
138143 JCCompilationUnit unit ;
139144 JavacFileManager fileManager = new JavacFileManager (context , true , UTF_8 );
140145 try {
Original file line number Diff line number Diff line change 1+ interface
2+ InterfaceWithPrivateStaticMethod
3+ {
4+ private static void bar() { }
5+ default void foo() { bar(); }
6+ }
Original file line number Diff line number Diff line change 1+ interface InterfaceWithPrivateStaticMethod {
2+ private static void bar() {}
3+
4+ default void foo() {
5+ bar();
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments