Fixed NPE occurring when the initializers of field declarations are lambda expressions with a body
@@ -219,6 +219,10 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
public UMLOperationBodyMapper(AbstractExpression expression1, AbstractExpression expression2) throws RefactoringMinerTimedOutException {
this.mappings = new LinkedHashSet<AbstractCodeMapping>();
+ this.nonMappedLeavesT1 = new ArrayList<StatementObject>();
+ this.nonMappedLeavesT2 = new ArrayList<StatementObject>();
+ this.nonMappedInnerNodesT1 = new ArrayList<CompositeStatementObject>();
+ this.nonMappedInnerNodesT2 = new ArrayList<CompositeStatementObject>();
List<AbstractExpression> leaves1 = new ArrayList<AbstractExpression>();
leaves1.add(expression1);
List<AbstractExpression> leaves2 = new ArrayList<AbstractExpression>();
@@ -2492,7 +2496,9 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
this.nonMappedInnerNodesT2.addAll(mapper.nonMappedInnerNodesT2);
this.nonMappedLeavesT1.addAll(mapper.nonMappedLeavesT1);
this.nonMappedLeavesT2.addAll(mapper.nonMappedLeavesT2);
+ if(this.operation1 != null && this.operation2 != null) {
this.refactorings.addAll(mapper.getRefactorings());
+ }
lambdaMappers.add(mapper);
}
}
