private static boolean protectAgainstErrors(File targetFolder, FileObject[][] sources, Object context) throws MalformedURLException { Preferences pref = NbPreferences.forModule(BuildArtifactMapperImpl.class).node(BuildArtifactMapperImpl.class.getSimpleName()); if (!pref.getBoolean(UIProvider.ASK_BEFORE_RUN_WITH_ERRORS, true)) { return true; } sources(targetFolder, sources); for (FileObject file : sources[0]) { if (ErrorsCache.isInError(file, true) && !alreadyWarned.contains(context)) { UIProvider uip = Lookup.getDefault().lookup(UIProvider.class); if (uip == null || uip.warnContainsErrors(pref)) { alreadyWarned.add(context); return true; } return false; } } return true; }
static void setErrors(Context context, CompileTuple active, DiagnosticListenerImpl errors) { if (!active.virtual) { Iterable<Diagnostic<? extends JavaFileObject>> filteredErrorsList = Iterators.filter(errors.getDiagnostics(active.jfo), new FilterOutJDK7AndLaterWarnings()); ErrorsCache.setErrors(context.getRootURI(), active.indexable, filteredErrorsList, active.aptGenerated ? ERROR_CONVERTOR_NO_BADGE : ERROR_CONVERTOR); } }
final Collection<? extends URL> errUrls = ErrorsCache.getAllFilesInError(depRoot); if (!errUrls.isEmpty()) {
for (CompileTuple file : files) { if (!file.virtual) { ErrorsCache.setErrors( ctx.getRootURI(), file.indexable,
for (Indexable i : files) { clear(context, javaContext, i, removedTypes, removedFiles, fmTx); ErrorsCache.setErrors(context.getRootURI(), i, Collections.<Diagnostic<?>>emptyList(), ERROR_CONVERTOR); ExecutableFilesIndex.DEFAULT.setMainClass(context.getRootURI(), i.getURL(), false); javaContext.getCheckSums().remove(i.getURL());