StringIndexOutOfBoundsException for specific commit
Xiaoven opened this issue · 1 comments
RefactoringMiner version: a7a51a4 (access time: Feb 3, 2024)
commit: apache/kafka@02df8e1
[main] WARN org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl - Ignored revision 02df8e1496e25f7b4a2609c6f35a522e59cf7ce0 due to error
java.lang.StringIndexOutOfBoundsException: begin 1, end 0, length 1
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4608)
at java.base/java.lang.String.substring(String.java:2711)
at gr.uom.java.xmi.decomposition.AbstractCodeMapping.stringConcatMatch(AbstractCodeMapping.java:1041)
at gr.uom.java.xmi.decomposition.AbstractCodeMapping.temporaryVariableAssignment(AbstractCodeMapping.java:527)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.extractInlineVariableAnalysis(UMLOperationBodyMapper.java:5701)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.processLeaves(UMLOperationBodyMapper.java:5451)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.processCompositeStatements(UMLOperationBodyMapper.java:1044)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.<init>(UMLOperationBodyMapper.java:1020)
at gr.uom.java.xmi.decomposition.ReplacementAlgorithm.processLambdas(ReplacementAlgorithm.java:4375)
at gr.uom.java.xmi.decomposition.ReplacementAlgorithm.processAnonymousAndLambdas(ReplacementAlgorithm.java:4315)
at gr.uom.java.xmi.decomposition.ReplacementAlgorithm.findReplacementsWithExactMatching(ReplacementAlgorithm.java:1255)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.processLeaves(UMLOperationBodyMapper.java:5044)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.processCompositeStatements(UMLOperationBodyMapper.java:1044)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.<init>(UMLOperationBodyMapper.java:1020)
at gr.uom.java.xmi.decomposition.ReplacementAlgorithm.processLambdas(ReplacementAlgorithm.java:4375)
at gr.uom.java.xmi.decomposition.ReplacementAlgorithm.processAnonymousAndLambdas(ReplacementAlgorithm.java:4315)
at gr.uom.java.xmi.decomposition.ReplacementAlgorithm.findReplacementsWithExactMatching(ReplacementAlgorithm.java:1255)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.processLeaves(UMLOperationBodyMapper.java:5044)
at gr.uom.java.xmi.decomposition.UMLOperationBodyMapper.<init>(UMLOperationBodyMapper.java:413)
at gr.uom.java.xmi.diff.UMLClassBaseDiff.createBodyMappers(UMLClassBaseDiff.java:2792)
at gr.uom.java.xmi.diff.UMLClassBaseDiff.process(UMLClassBaseDiff.java:128)
at gr.uom.java.xmi.UMLModel.diff(UMLModel.java:164)
at org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl.detectRefactorings(GitHistoryRefactoringMinerImpl.java:158)
at org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl.detectAtCommit(GitHistoryRefactoringMinerImpl.java:721)
at Kafka.detectCommit(Kafka.java:93)
at Kafka.main(Kafka.java:104)
Thank you @Xiaoven
Here is the list of refactorings detected after the fix:
Refactorings at 02df8e1496e25f7b4a2609c6f35a522e59cf7ce0
Rename Method public shouldImplementJVMMethods() : void renamed to public shouldImplementEqualsAndHashCode() : void in class org.apache.kafka.common.message.SimpleExampleMessageTest
Extract Method private testRoundTrip(message SimpleExampleMessageData, validator Consumer) : void extracted from public testMyTaggedIntArray() : void in class org.apache.kafka.common.message.SimpleExampleMessageTest
Extract Method private generateFixedLengthFieldSize(field FieldSpec, tagged boolean) : void extracted from private generateFieldSize(field FieldSpec, possibleVersions Versions, tagged boolean) : void in class org.apache.kafka.message.MessageDataGenerator
Extract Method private generateVariableLengthFieldSize(field FieldSpec, possibleVersions Versions, tagged boolean) : void extracted from private generateFieldSize(field FieldSpec, possibleVersions Versions, tagged boolean) : void in class org.apache.kafka.message.MessageDataGenerator
Extract Variable defaultString : String in method private fieldDefault(field FieldSpec) : String from class org.apache.kafka.message.MessageDataGenerator
Add Parameter nullableVersions : Versions in method private generateNonDefaultValueCheck(field FieldSpec, nullableVersions Versions) : void from class org.apache.kafka.message.MessageDataGenerator