Charset (Chunk<? extends Module> chunk) { CompilerEncodingService service = null; for (Module module : chunk.getNodes()) { if (service == null) { service = getInstance(module.getProject()); } final Charset charset = service.getPreferredModuleEncoding(module); if (charset != null) { return charset; } } return null; }