Java Code Examples for org.eclipse.jdt.core.compiler.IProblem#AbstractMethodMustBeImplemented

The following examples show how to use org.eclipse.jdt.core.compiler.IProblem#AbstractMethodMustBeImplemented . 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: BaseDiagnosticsHandler.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
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 2
Source File: UnimplementedCodeCleanUp.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean canFix(ICompilationUnit compilationUnit, IProblemLocation problem) {
	int id= problem.getProblemId();
	if (id == IProblem.AbstractMethodMustBeImplemented || id == IProblem.EnumConstantMustImplementAbstractMethod)
		return isEnabled(CleanUpConstants.ADD_MISSING_METHODES) || isEnabled(MAKE_TYPE_ABSTRACT);

	return false;
}