Example usage for org.eclipse.jdt.core.compiler IProblem DuplicateTypes

List of usage examples for org.eclipse.jdt.core.compiler IProblem DuplicateTypes

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.compiler IProblem DuplicateTypes.

Prototype

int DuplicateTypes

To view the source code for org.eclipse.jdt.core.compiler IProblem DuplicateTypes.

Click Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.MatchLocator.java

License:Open Source License

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;
}

From source file:spoon.support.compiler.jdt.JDTBasedSpoonCompiler.java

License:Open Source License

/**
 * report a compilation problem (callback for JDT)
 *//*from  www  .  j  a va2s .c  om*/
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) {
        throw new ModelBuildingException(pb.getMessage());
    }

    probs.add(pb);
}