Java Code Examples for org.eclipse.jdt.core.compiler.IProblem#UndefinedMethod
The following examples show how to use
org.eclipse.jdt.core.compiler.IProblem#UndefinedMethod .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LinkedNodeFinder.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private static int getProblemKind(IProblem problem) { switch (problem.getID()) { case IProblem.UndefinedField: return FIELD; case IProblem.UndefinedMethod: return METHOD; case IProblem.UndefinedLabel: return LABEL; case IProblem.UndefinedName: case IProblem.UnresolvedVariable: return NAME; case IProblem.UndefinedType: return TYPE; } return 0; }
Example 2
Source File: BaseDiagnosticsHandler.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 5 votes |
public boolean isSyntaxLikeError(IProblem problem) { //Syntax issues are always reported if ((problem.getID() & IProblem.Syntax) != 0) { return true; } if (!isDefaultProject && problem.getID() == IProblem.PackageIsNotExpectedPackage) { return false; } //Type and Import issues are never reported if ((problem.getID() & IProblem.TypeRelated) != 0 || // (problem.getID() & IProblem.ImportRelated) != 0) { return false; } //For the rest, we need to cherry pick what is ignored or not switch (problem.getID()) { case IProblem.AbstractMethodMustBeImplemented: case IProblem.AmbiguousMethod: case IProblem.DanglingReference: case IProblem.MethodMustOverrideOrImplement: case IProblem.MissingReturnType: case IProblem.MissingTypeInConstructor: case IProblem.MissingTypeInLambda: case IProblem.MissingTypeInMethod: case IProblem.UndefinedConstructor: case IProblem.UndefinedField: case IProblem.UndefinedMethod: case IProblem.UndefinedName: case IProblem.UnresolvedVariable: return false; default: //We log problems for troubleshooting purposes String error = getError(problem); JavaLanguageServerPlugin.logInfo(problem.getMessage() + " is of type " + error); } return true; }
Example 3
Source File: JRJdtCompiler.java From jasperreports with GNU Lesser General Public License v3.0 | 4 votes |
@Override public void acceptResult(CompilationResult result) { String className = ((CompilationUnit) result.getCompilationUnit()).className; int classIdx; for (classIdx = 0; classIdx < units.length; ++classIdx) { if (className.equals(units[classIdx].getName())) { break; } } if (result.hasErrors()) { //IProblem[] problems = result.getErrors(); IProblem[] problems = getJavaCompilationErrors(result); unitResults[classIdx].problems = problems; String sourceCode = units[classIdx].getSourceCode(); for (int i = 0; i < problems.length; i++) { IProblem problem = problems[i]; if (IProblem.UndefinedMethod == problem.getID()) { if ( problem.getSourceStart() >= 0 && problem.getSourceEnd() >= 0 ) { String methodName = sourceCode.substring( problem.getSourceStart(), problem.getSourceEnd() + 1 ); Method method = FunctionsUtil.getInstance(jasperReportsContext).getMethod4Function(methodName); if (method != null) { unitResults[classIdx].addMissingMethod(method); //continue; } } } } } else { ClassFile[] resultClassFiles = result.getClassFiles(); for (int i = 0; i < resultClassFiles.length; i++) { units[classIdx].setCompileData(resultClassFiles[i].getBytes()); } } }