protected void report(Environment environment, CategorizedProblem problem) { if (problem == null) { throw new IllegalArgumentException("problem cannot be null"); } File file = new File(new String(problem.getOriginatingFileName())); String filename = file.getAbsolutePath(); String message = problem.getMessage() + " at " + filename + ":" + problem.getSourceLineNumber(); if (problem.isError()) { if (!environment.getNoClasspath()) { // by default, compilation errors are notified as exception throw new ModelBuildingException(message); } else { // in noclasspath mode, errors are only reported // but undefined import, type, and name errors are irrelevant int problemId = problem.getID(); if (problemId != IProblem.UndefinedType && problemId != IProblem.UndefinedName && problemId != IProblem.ImportNotFound) { environment.report(null, Level.WARN, message); } } } }
/** * report a compilation problem (callback for JDT) */ public void reportProblem(CategorizedProblem pb) { if (pb == null) { return; } // we can not accept this problem, even in noclasspath mode // otherwise a nasty null pointer exception occurs later if (pb.getID() == IProblem.DuplicateTypes) { if (getFactory().getEnvironment().isIgnoreDuplicateDeclarations() == false) { throw new ModelBuildingException(pb.getMessage()); } } else { probs.add(pb); } }
protected boolean hasAlreadyDefinedType(CompilationUnitDeclaration parsedUnit) { CompilationResult result = parsedUnit.compilationResult; if (result == null) return false; for (int i = 0; i < result.problemCount; i++) if (result.problems[i].getID() == IProblem.DuplicateTypes) return true; return false; } /**
@Override public void acceptProblem(CategorizedProblem problem) { if ((problem.getID() & IProblem.Syntax) != 0){ this.hasSyntaxErrors = true; } } private void addToChildren(Object parentInfo, JavaElement handle) {
protected boolean hasAlreadyDefinedType(CompilationUnitDeclaration parsedUnit) { CompilationResult result = parsedUnit.compilationResult; if (result == null) return false; for (int i = 0; i < result.problemCount; i++) if (result.problems[i].getID() == IProblem.DuplicateTypes) return true; return false; } /**
public void acceptProblem(CategorizedProblem problem) { if ((problem.getID() & IProblem.Syntax) != 0){ this.hasSyntaxErrors = true; } } private void addToChildren(Object parentInfo, JavaElement handle) {
protected boolean hasAlreadyDefinedType(CompilationUnitDeclaration parsedUnit) { CompilationResult result = parsedUnit.compilationResult; if (result == null) return false; for (int i = 0; i < result.problemCount; i++) if (result.problems[i].getID() == IProblem.DuplicateTypes) return true; return false; } /**
public void acceptProblem(CategorizedProblem problem) { if ((problem.getID() & IProblem.Syntax) != 0){ this.hasSyntaxErrors = true; } } private void addToChildren(Object parentInfo, JavaElement handle) {
protected boolean hasAlreadyDefinedType(CompilationUnitDeclaration parsedUnit) { CompilationResult result = parsedUnit.compilationResult; if (result == null) return false; for (int i = 0; i < result.problemCount; i++) if (result.problems[i].getID() == IProblem.DuplicateTypes) return true; return false; } /**
public void acceptProblem(CategorizedProblem problem) { if ((problem.getID() & IProblem.Syntax) != 0){ this.hasSyntaxErrors = true; } } private void addToChildren(Object parentInfo, JavaElement handle) {
public void acceptProblem(CategorizedProblem problem) { if ((problem.getID() & IProblem.Syntax) != 0){ this.hasSyntaxErrors = true; } } private void addToChildren(Object parentInfo, JavaElement handle) {
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
/** * @param problem CategorizedProblem * @return String */ public final String localizedMessage(CategorizedProblem problem) { return getLocalizedMessage(problem.getID(), problem.getArguments()); }
public static EclipseDiagnostic newInstance(CategorizedProblem problem, DefaultProblemFactory factory) { if(problem instanceof DefaultProblem) return newInstanceFromDefaultProblem((DefaultProblem) problem, factory); return new EclipseDiagnostic(getKind(problem), problem.getID(), problem.getArguments(), problem.getOriginatingFileName(), factory); }