private Node newBranchInstrumentationNode ( NodeTraversal traversal , Node node , int idx ) { String arrayName = createArrayName ( traversal ) ; // Create instrumentation Node Node getElemNode = IR . getelem ( IR . name ( arrayName ) , IR . number ( idx ) ) ; // Make line number 0-based Node exprNode = IR . exprResult ( IR . assign ( getElemNode , IR . trueNode ( ) ) ) ; // Note line as instrumented String fileName = traversal . getSourceName ( ) ; if ( ! instrumentationData . containsKey ( fileName ) ) { instrumentationData . put ( fileName , new FileInstrumentationData ( fileName , arrayName ) ) ; } return exprNode . useSourceInfoIfMissingFromForTree ( node ) ; }
Create an assignment to the branch coverage data for the given index into the array .