Package edu.umd.cs.findbugs.plugin.eclipse.quickfix.exception

Examples of edu.umd.cs.findbugs.plugin.eclipse.quickfix.exception.BugResolutionException


        assert workingUnit != null;
        assert bug != null;

        InfixExpression oddnessCheck = findOddnessCheck(getASTNode(workingUnit, bug.getPrimarySourceLineAnnotation()));
        if (oddnessCheck == null) {
            throw new BugResolutionException("No matching oddness check found at the specified source line.");
        }
        Expression numberExpression = findNumberExpression(oddnessCheck);
        if (numberExpression == null) {
            throw new BugResolutionException();
        }
        InfixExpression correctOddnessCheck = createCorrectOddnessCheck(rewrite, numberExpression);
        rewrite.replace(oddnessCheck, correctOddnessCheck, null);
    }
View Full Code Here


        assert bug != null;

        ClassInstanceCreation classLoaderCreation = findClassLoaderCreation(getASTNode(workingUnit,
                bug.getPrimarySourceLineAnnotation()));
        if (classLoaderCreation == null) {
            throw new BugResolutionException("No matching class loader creation found at the specified source line.");
        }
        updateVariableReferences(rewrite, classLoaderCreation);
        rewrite.replace(classLoaderCreation, createDoPrivilegedInvocation(rewrite, classLoaderCreation), null);
        updateImportDeclarations(rewrite, workingUnit);
    }
View Full Code Here

        assert workingUnit != null;

        ClassInstanceCreation primitiveTypeCreation = findPrimitiveTypeCreation(getASTNode(workingUnit,
                bug.getPrimarySourceLineAnnotation()));
        if (primitiveTypeCreation == null) {
            throw new BugResolutionException("Primitive type creation not found.");
        }
        MethodInvocation valueOfInvocation = createValueOfInvocation(rewrite, workingUnit, primitiveTypeCreation);
        rewrite.replace(primitiveTypeCreation, valueOfInvocation, null);
    }
View Full Code Here

    private void runInternal(IMarker marker) throws BugResolutionException, BadLocationException, CoreException {
        assert marker != null;

        BugInstance bug = MarkerUtil.findBugInstanceForMarker(marker);
        if (bug == null) {
            throw new BugResolutionException(MISSING_BUG_INSTANCE);
        }

        IProject project = marker.getResource().getProject();
        ICompilationUnit originalUnit = getCompilationUnit(marker);
        if (originalUnit == null) {
            throw new BugResolutionException("No compilation unit found for marker " + marker.getType() + " (" + marker.getId()
                    + ")");
        }

        Document doc = new Document(originalUnit.getBuffer().getContents());
        CompilationUnit workingUnit = createWorkingCopy(originalUnit);
View Full Code Here

                }
            }
        }

        if (original == null) {
            throw new BugResolutionException("No original field found.");
        }

        // set up the clone part
        MethodInvocation cloneInvoke = invokeClone(workingUnit, original);
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.plugin.eclipse.quickfix.exception.BugResolutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.