List of usage examples for org.eclipse.jdt.core.compiler IProblem Unclassified
int Unclassified
To view the source code for org.eclipse.jdt.core.compiler IProblem Unclassified.
Click Source Link
From source file:org.ant4eclipse.ant.jdt.ecj.JavacCompilerAdapter.java
License:Open Source License
/** * Creates the problem instances which can be used to report some issues. * //from w w w .j a va 2s . c om * @param problems * The receiving list for the problems. Not <code>null</code>. * @param sourcefilename * The filename these problems are related to. Not <code>null</code>. * @param text * The content of the javac outcome. Not <code>null</code>. */ private void createProblems(List<CategorizedProblem> problems, String sourcefilename, String text) { List<String> lines = Utilities.splitText(text); Collections.reverse(lines); for (int i = 0; i < lines.size() - 2; i++) { int col = lines.get(i).indexOf('^'); if (col != -1) { // we've got a marker for the issue which usually looks like in the following example // // mysource.java:12 : there's an error // public class mysource- { // ^ // String line = lines.get(i + 2); int suffix = line.indexOf(SUFFIX_JAVA); if (suffix != -1) { line = line.substring(suffix + SUFFIX_JAVA.length() + 1); // +1 to skip a ':' before the line number int colon = line.indexOf(':'); if (colon != -1) { int lineno = Integer.parseInt(line.substring(0, colon)); String error = line.substring(colon + 1).trim(); problems.add(this._problemfactory.createProblem(sourcefilename.toCharArray(), IProblem.Unclassified, new String[] { error }, new String[] { error }, ProblemSeverities.Error, -1, -1, lineno, problems.size())); } } } } }
From source file:org.eclipse.objectteams.otdt.tests.compiler.TestBase.java
License:Open Source License
private void printAllProblems() { for (Iterator iter = _compiler.logger.globalProblems.iterator(); iter.hasNext();) { IProblem prob = (IProblem) iter.next(); System.err.println(prob.toString()); if (prob.getID() == IProblem.Unclassified) // it was an exception. throw new InternalError(prob.toString()); }/* w ww .j a v a2 s . c om*/ }