tsantalis / RefactoringMiner

MIT License
372 stars 138 forks source link

Getting NullPointerException on detectAtCommit() #767

Closed mo7aammd closed 2 months ago

mo7aammd commented 2 months ago

https://github.com/apache/cassandra/commit/a7c4ba9eeecb365e7c4753d8eaab747edd9a632a


Error => java.lang.NullPointerException: Cannot invoke "gr.uom.java.xmi.diff.UMLAbstractClassDiff.getModelDiff()" because "classDiff" is null


[main] INFO org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl - Processing tmp\cassandra 22abff779df097e0ef38180442e9c680b3d41187 ... [main] INFO org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl - Processing tmp\cassandra a7c4ba9eeecb365e7c4753d8eaab747edd9a632a ... [main] WARN org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl - Ignored revision a7c4ba9eeecb365e7c4753d8eaab747edd9a632a due to error java.lang.NullPointerException: Cannot invoke "gr.uom.java.xmi.diff.UMLAbstractClassDiff.getModelDiff()" because "classDiff" is null at gr.uom.java.xmi.decomposition.AbstractCodeMapping.anonymousWithMethodSignatureChange(AbstractCodeMapping.java:756) at gr.uom.java.xmi.decomposition.AbstractCodeMapping.temporaryVariableAssignment(AbstractCodeMapping.java:581) at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.extractInlineVariableAnalysis(UMLOperationBodyMapper.java:6185) at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.processLeaves(UMLOperationBodyMapper.java:5455) at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.(UMLOperationBodyMapper.java:567) Error => java.lang.NullPointerException: Cannot invoke "gr.uom.java.xmi.diff.UMLAbstractClassDiff.getModelDiff()" because "classDiff" is null at gr.uom.java.xmi.diff.UMLModelDiff.checkForOperationMoves(UMLModelDiff.java:4399) at gr.uom.java.xmi.diff.UMLModelDiff.checkForOperationMovesIncludingRemovedAndAddedClasses(UMLModelDiff.java:4132) at gr.uom.java.xmi.diff.UMLModelDiff.getRefactorings(UMLModelDiff.java:2647) at org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl.detectRefactorings(GitHistoryRefactoringMinerImpl.java:164) at org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl.detectAtCommit(GitHistoryRefactoringMinerImpl.java:770)

tsantalis commented 2 months ago

Thank you @mo7aammd The NPE has been fixed.

mo7aammd commented 2 months ago

I got the same error several times when mining different repos, is there any plan to release this bugfix in the near future? @tsantalis

tsantalis commented 2 months ago

@mo7aammd We will make a new release soon, but you don't have to wait.

You can make your own release from the latest commit.

If you use the tool as a maven dependency, the just change the version in build.gradle from 3.0.7 to 3.0.8 and run in command line gradle publishToMavenLocal This will make a new release in your local maven repository, which you can use it in your dependencies.

If you use the tool as command line, just run in command line ./gradlew distZip This will make a new version of the command line tool with all dependencies bundled.