private void init() { if( _fm != null ) { return; } synchronized( this ) { if( _fm != null ) { return; } _javacTool = JavacTool.create(); StandardJavaFileManager fm = _javacTool.getStandardFileManager( null, null, Charset.forName( "UTF-8" ) ); try { fm.setLocation( StandardLocation.SOURCE_PATH, _module.getCollectiveSourcePath().stream().map( IResource::toJavaFile ).filter( f -> !SourcePathUtil.excludeFromTestPath( f.getAbsolutePath() ) ).collect( Collectors.toList() ) ); fm.setLocation( StandardLocation.CLASS_PATH, _module.getCollectiveJavaClassPath().stream().map( IResource::toJavaFile ).filter( f -> !SourcePathUtil.excludeFromTestPath( f.getAbsolutePath() ) ).collect( Collectors.toList() ) ); _fm = fm; } catch( IOException e ) { throw new RuntimeException( e ); } } }
/** * Prepare the compiler thread for use. It is not yet started. * It will be started by the executor service. */ public synchronized void use() { assert(!inUse); inUse = true; compiler = com.sun.tools.javac.api.JavacTool.create(); fileManager = compiler.getStandardFileManager(null, null, null); fileManagerBase = (BaseFileManager)fileManager; smartFileManager = new SmartFileManager(fileManager); context = new Context(); context.put(JavaFileManager.class, smartFileManager); ResolveWithDeps.preRegister(context); JavaCompilerWithDeps.preRegister(context, this); subTasks = new ArrayList<Future<?>>(); }
fileManager = getStandardFileManager(diagnosticListener, null, null); context.put(JavaFileManager.class, fileManager); processOptions(context, fileManager, options);
fileManager = getStandardFileManager(diagnosticListener, null, null); context.put(JavaFileManager.class, fileManager); processOptions(context, fileManager, options);
fileManager = getStandardFileManager(diagnosticListener, null, null); fileManager = ccw.wrap(fileManager);
fileManager = getStandardFileManager(diagnosticListener, null, null); fileManager = ccw.wrap(fileManager);