@Override protected Iterable<ICompilerProblem> computeFatalProblems() throws InterruptedException { final Iterable<ICompilerProblem> fatalProblemsFromSuper = super.computeFatalProblems(); if (!Iterables.isEmpty(fatalProblemsFromSuper)) return fatalProblemsFromSuper; IResolvedQualifiersReference rootClassRef = getRootClassReference(); if (rootClassRef == null) return ImmutableList.<ICompilerProblem>of(new ImproperlyConfiguredTargetProblem()); String rootClassFileName = targetSettings.getRootSourceFileName(); if (rootClassFileName == null) return ImmutableList.<ICompilerProblem>of(new ImproperlyConfiguredTargetProblem()); Collection<ICompilationUnit> rootClassCompilationUnits = project.getCompilationUnits(rootClassFileName); assert rootClassCompilationUnits.isEmpty() || rootClassCompilationUnits.size() == 1; if (rootClassCompilationUnits.isEmpty()) return ImmutableList.<ICompilerProblem>of(new FileNotFoundProblem(rootClassFileName)); assert Iterables.getOnlyElement(rootClassCompilationUnits) != null : "The build should have been aborted before this point if there is no root class compilation unit."; IDefinition rootClassDefinition = rootClassRef.resolve(project); if (rootClassDefinition == null) return ImmutableList.<ICompilerProblem>of(new UnableToFindRootClassDefinitionProblem(targetSettings.getRootClassName())); return ImmutableList.<ICompilerProblem>of(); }
@Override protected Iterable<ICompilerProblem> computeFatalProblems() throws InterruptedException { final Iterable<ICompilerProblem> fatalProblemsFromSuper = super.computeFatalProblems(); if (!Iterables.isEmpty(fatalProblemsFromSuper)) return fatalProblemsFromSuper; IResolvedQualifiersReference rootClassRef = getRootClassReference(); if (rootClassRef == null) return ImmutableList.<ICompilerProblem>of(new ImproperlyConfiguredTargetProblem()); String rootClassFileName = targetSettings.getRootSourceFileName(); if (rootClassFileName == null) return ImmutableList.<ICompilerProblem>of(new ImproperlyConfiguredTargetProblem()); Collection<ICompilationUnit> rootClassCompilationUnits = project.getCompilationUnits(rootClassFileName); assert rootClassCompilationUnits.isEmpty() || rootClassCompilationUnits.size() == 1; if (rootClassCompilationUnits.isEmpty()) return ImmutableList.<ICompilerProblem>of(new FileNotFoundProblem(rootClassFileName)); assert Iterables.getOnlyElement(rootClassCompilationUnits) != null : "The build should have been aborted before this point if there is no root class compilation unit."; IDefinition rootClassDefinition = rootClassRef.resolve(project); if (rootClassDefinition == null) return ImmutableList.<ICompilerProblem>of(new UnableToFindRootClassDefinitionProblem(targetSettings.getRootClassName())); return ImmutableList.<ICompilerProblem>of(); }
/** * Helper method used by addFileEntriesToSWC() to process one file. */ private void processFileEntry(Entry<String, FileEntryValue> entry, Collection<ICompilerProblem> problems) { String path = entry.getKey(); IBinaryFileSpecification fileSpec = entry.getValue().getFileSpec(); ISourceLocation sourceLocation = entry.getValue().getSourceLocation(); byte[] contents = getContents(fileSpec); if (contents != null) { swc.addFile(path, fileSpec.getLastModified(), contents); } else { final ICompilerProblem problem = sourceLocation != null ? new FileNotFoundProblem(sourceLocation, fileSpec.getPath()) : new FileNotFoundProblem(fileSpec.getPath()); problems.add(problem); } }
/** * Helper method used by addFileEntriesToSWC() to process one file. */ private void processFileEntry(Entry<String, FileEntryValue> entry, Collection<ICompilerProblem> problems) { String path = entry.getKey(); IBinaryFileSpecification fileSpec = entry.getValue().getFileSpec(); ISourceLocation sourceLocation = entry.getValue().getSourceLocation(); byte[] contents = getContents(fileSpec); if (contents != null) { swc.addFile(path, fileSpec.getLastModified(), contents); } else { final ICompilerProblem problem = sourceLocation != null ? new FileNotFoundProblem(sourceLocation, fileSpec.getPath()) : new FileNotFoundProblem(fileSpec.getPath()); problems.add(problem); } }
/** * Collect CSS from 'defaults-css-files' configuration option. */ private void collectDefaultCSS( final ICSSManager cssManager, final ActivatedStyleSheets activatedStyleSheets, final Collection<ICompilerProblem> problems) { for (final String defaultsCSSPath : getTargetSettings().getDefaultsCSSFiles()) { final ICSSDocument defaultsCSSModel = cssManager.getCSS(defaultsCSSPath); if (defaultsCSSModel == null) problems.add(new FileNotFoundProblem(defaultsCSSPath)); else activatedStyleSheets.addDefaultCSS(defaultsCSSModel); } }
/** * Collect CSS from 'defaults-css-files' configuration option. */ private void collectDefaultCSS( final ICSSManager cssManager, final ActivatedStyleSheets activatedStyleSheets, final Collection<ICompilerProblem> problems) { for (final String defaultsCSSPath : getTargetSettings().getDefaultsCSSFiles()) { final ICSSDocument defaultsCSSModel = cssManager.getCSS(defaultsCSSPath); if (defaultsCSSModel == null) problems.add(new FileNotFoundProblem(defaultsCSSPath)); else activatedStyleSheets.addDefaultCSS(defaultsCSSModel); } }
/** * Collect CSS from 'defaults-css-files' configuration option. */ private void collectDefaultCSS( final ICSSManager cssManager, final ActivatedStyleSheets activatedStyleSheets, final Collection<ICompilerProblem> problems) { for (final String defaultsCSSPath : getTargetSettings().getDefaultsCSSFiles()) { final ICSSDocument defaultsCSSModel = cssManager.getCSS(defaultsCSSPath); if (defaultsCSSModel == null) problems.add(new FileNotFoundProblem(defaultsCSSPath)); else activatedStyleSheets.addDefaultCSS(defaultsCSSModel); } }
problems.add(new FileNotFoundProblem(className)); return "";
problems.add(new FileNotFoundProblem(name)); continue;
ICompilerProblem problem = new FileNotFoundProblem(filePath); problems.add(problem);
ICompilerProblem problem = new FileNotFoundProblem(filePath); problems.add(problem);
problems.add(new FileNotFoundProblem(dep)); continue;
/** * {@code StyleModuleCompilationUnit} does not provide an AST, unless we * decided to start CMP-879. However, the return value will contain the CSS * syntax errors in {@link ISyntaxTreeRequestResult#getProblems()}. */ @Override protected ISyntaxTreeRequestResult handleSyntaxTreeRequest() throws InterruptedException { final List<ICompilerProblem> syntaxErrors = new ArrayList<ICompilerProblem>(); CSSDocument css = null; try { final ANTLRFileStream fileStream = new ANTLRFileStream(cssFile.getPath()); css = CSSDocument.parse(fileStream, syntaxErrors); } catch (IOException e) { ICompilerProblem problem = new FileNotFoundProblem(cssFile.getPath()); syntaxErrors.add(problem); } return new StyleModuleSyntaxTreeRequestResult(css, syntaxErrors, cssFile.getLastModified()); }
/** * {@code StyleModuleCompilationUnit} does not provide an AST, unless we * decided to start CMP-879. However, the return value will contain the CSS * syntax errors in {@link ISyntaxTreeRequestResult#getProblems()}. */ @Override protected ISyntaxTreeRequestResult handleSyntaxTreeRequest() throws InterruptedException { final List<ICompilerProblem> syntaxErrors = new ArrayList<ICompilerProblem>(); CSSDocument css = null; try { final ANTLRFileStream fileStream = new ANTLRFileStream(cssFile.getPath()); css = CSSDocument.parse(fileStream, syntaxErrors); } catch (IOException e) { ICompilerProblem problem = new FileNotFoundProblem(cssFile.getPath()); syntaxErrors.add(problem); } return new StyleModuleSyntaxTreeRequestResult(css, syntaxErrors, cssFile.getLastModified()); }
problems.add(new FileNotFoundProblem(inputFile.getAbsolutePath()));
problems.add(new FileNotFoundProblem(inputFile.getAbsolutePath()));
ICompilerProblem problem = new FileNotFoundProblem(token, filenameTokenText); //the text will be the path not found problems.add(problem); retVal = next(); ICompilerProblem problem = new FileNotFoundProblem(token, includedFileSpec.getPath()); problems.add(problem); retVal = next();
ICompilerProblem problem = new FileNotFoundProblem(token, filenameTokenText); //the text will be the path not found problems.add(problem); retVal = next(); ICompilerProblem problem = new FileNotFoundProblem(token, includedFileSpec.getPath()); problems.add(problem); retVal = next();
node.addProblem(new FileNotFoundProblem(e.getMessage()));
node.addProblem(new FileNotFoundProblem(e.getMessage()));