Ericsson / CodeCheckerEclipsePlugin

This is an Eclipse plugin that shows C/C++ static analysis results found by Clang Static Analyzer and Clang Tidy
Eclipse Public License 1.0
32 stars 13 forks source link

refactor ResultListActionThriftImpl.java #34

Closed dkrupp closed 8 years ago

dkrupp commented 8 years ago

maybe dif fileinfoaction is not needed as the filepath is in the checkedFile field of the reportData record in thrift.

So maybe fiaResult and fiaBug object can be removed.

 FileInfoAction fiaResult = new FileInfoAction(new FileInfoRequest(action.getRequest()
                .getServer(), rd.getFileId()));
        fiaResult = innerRunner.requireResult(fiaResult);
        if (fiaResult.getStatus() != ActionStatus.SUCCEEDED) {
            throw new RuntimeException("Bad status for inner action: " + fiaResult);
        }

        FileInfoAction fiaBug = new FileInfoAction(new FileInfoRequest(action.getRequest()
                .getServer(), rd.getLastBugPosition().getFileId()));
        fiaBug = innerRunner.requireResult(fiaBug);
        if (fiaBug.getStatus() != ActionStatus.SUCCEEDED) {
            throw new RuntimeException("Bad status for inner action: " + fiaBug);
        }

        BugPathItem lastBugItem = new BugPathItem(new BugPathItem.Position(rd
                .getLastBugPosition().getStartLine(), rd.getLastBugPosition().getStartCol()),
                new BugPathItem.Position(rd.getLastBugPosition().getEndLine(), rd
                        .getLastBugPosition().getEndCol()), rd.getLastBugPosition().getMsg(),
                fiaBug.getResult().get().getFilePath());