@@ -91,21 +91,24 @@ Map<String, byte[]> compileFromJava(@NotNull String className,
91
91
String filename = className .replaceAll ("\\ ." , '\\' + File .separator ) + ".java" ;
92
92
File file = new File (sourceDir , filename );
93
93
writeText (file , javaCode );
94
+ if (s_standardJavaFileManager == null )
95
+ s_standardJavaFileManager = s_compiler .getStandardFileManager (null , null , null );
94
96
compilationUnits = s_standardJavaFileManager .getJavaFileObjects (file );
95
97
96
98
} else {
97
99
javaFileObjects .put (className , new JavaSourceFromString (className , javaCode ));
98
100
compilationUnits = javaFileObjects .values ();
99
101
}
100
102
// reuse the same file manager to allow caching of jar files
103
+ List <String > options = Arrays .asList ("-g" , "-nowarn" );
101
104
boolean ok = s_compiler .getTask (writer , fileManager , new DiagnosticListener <JavaFileObject >() {
102
105
@ Override
103
106
public void report (Diagnostic <? extends JavaFileObject > diagnostic ) {
104
107
if (diagnostic .getKind () == Diagnostic .Kind .ERROR ) {
105
108
writer .println (diagnostic );
106
109
}
107
110
}
108
- }, null , null , compilationUnits ).call ();
111
+ }, options , null , compilationUnits ).call ();
109
112
Map <String , byte []> result = fileManager .getAllBuffers ();
110
113
if (!ok ) {
111
114
// compilation error, so we want to exclude this file from future compilation passes
0 commit comments