File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/AbstractNullnessCheckNode.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/BinaryLogicOperatorNode.java | |||
Method name: String[] extractMutationTexts(Node, int)
|
Method name: String[] extractMutationTexts(Node, int)
|
|||
Number of AST nodes: 24 | Number of AST nodes: 24 | |||
1 | if ( operand instanceof ParameterNode ) {↵ | 1 | if ( operand instanceof ParameterNode ) {↵ | |
2 | String[] rtn = new String[count];↵ | 2 | String[] rtn = new String[count];↵ | |
3 | for ( int i = 0; i < count; i++ ) {↵ | 3 | for ( int i = 0; i < count; i++ ) {↵ | |
4 | rtn[i] = "?";↵ | 4 | rtn[i] = "?";↵ | |
5 | }↵ | 5 | }↵ | |
6 | return rtn;↵ | 6 | return rtn;↵ | |
7 | }↵ | 7 | }↵ | |
8 | else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) {↵ | 8 | else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) {↵ | |
9 | String[] rtn = new String[ operand.getNumberOfChildren() ];↵ | 9 | String[] rtn = new String[ operand.getNumberOfChildren() ];↵ | |
10 | int x = 0;↵ | 10 | int x = 0;↵ | |
11 | AST node = operand.getFirstChild();↵ | 11 | AST node = operand.getFirstChild();↵ | |
12 | while ( node != null ) {↵ | 12 | while ( node != null ) {↵ | |
13 | rtn[ x++ ] = node.getText();↵ | 13 | rtn[ x++ ] = node.getText();↵ | |
14 | node = node.getNextSibling();↵ | 14 | node = node.getNextSibling();↵ | |
15 | }↵ | 15 | }↵ | |
16 | return rtn;↵ | 16 | return rtn;↵ | |
17 | }↵ | 17 | }↵ | |
18 | else if ( operand instanceof SqlNode ) {↵ | 18 | else if ( operand instanceof SqlNode ) {↵ | |
19 | String nodeText = operand.getText();↵ | 19 | String nodeText = operand.getText();↵ | |
20 | if ( nodeText.startsWith( "(" ) ) {↵ | 20 | if ( nodeText.startsWith( "(" ) ) {↵ | |
21 | nodeText = nodeText.substring( 1 );↵ | 21 | nodeText = nodeText.substring( 1 );↵ | |
22 | }↵ | 22 | }↵ | |
23 | if ( nodeText.endsWith( ")" ) ) {↵ | 23 | if ( nodeText.endsWith( ")" ) ) {↵ | |
24 | nodeText = nodeText.substring( 0, nodeText.length() - 1 );↵ | 24 | nodeText = nodeText.substring( 0, nodeText.length() - 1 );↵ | |
25 | }↵ | 25 | }↵ | |
26 | String[] splits = StringHelper.split( ", ", nodeText );↵ | 26 | String[] splits = StringHelper.split( ", ", nodeText );↵ | |
27 | if ( count != splits.length ) {↵ | 27 | if ( count != splits.length ) {↵ | |
28 | throw new HibernateException( "SqlNode's text did not reference expected number of columns" );↵ | 28 | throw new HibernateException( "SqlNode's text did not reference expected number of columns" );↵ | |
29 | }↵ | 29 | }↵ | |
30 | return splits;↵ | 30 | return splits;↵ | |
31 | }↵ | 31 | }↵ | |
32 | else {↵ | 32 | else {↵ | |
33 | throw new HibernateException( "dont know how to extract row value elements from node : " + operand );↵ | 33 | throw new HibernateException( "dont know how to extract row value elements from node : " + operand );↵ | |
34 | } | 34 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 148 |
Number of mapped statements | 24 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 4.1 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | if (operand instanceof ParameterNode) | 1 | if (operand instanceof ParameterNode) | |
2 | String[] rtn = new String[count]; | 2 | String[] rtn = new String[count]; | |
3 | for (int i = 0; i < count; i++) | 3 | for (int i = 0; i < count; i++) | |
4 | rtn[i] = "?"; | 4 | rtn[i] = "?"; | |
5 | return rtn; | 5 | return rtn; | |
6 | else if (operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR) | 6 | else if (operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR) | |
7 | String[] rtn = new String[operand.getNumberOfChildren()]; | 7 | String[] rtn = new String[operand.getNumberOfChildren()]; | |
8 | int x = 0; | 8 | int x = 0; | |
9 | AST node = operand.getFirstChild(); | 9 | AST node = operand.getFirstChild(); | |
10 | while (node != null) | 10 | while (node != null) | |
11 | rtn[x++] = node.getText(); | 11 | rtn[x++] = node.getText(); | |
12 | node = node.getNextSibling(); | 12 | node = node.getNextSibling(); | |
13 | return rtn; | 13 | return rtn; | |
14 | else if (operand instanceof SqlNode) | 14 | else if (operand instanceof SqlNode) | |
15 | String nodeText = operand.getText(); | 15 | String nodeText = operand.getText(); | |
16 | if (nodeText.startsWith("(")) | 16 | if (nodeText.startsWith("(")) | |
17 | nodeText = nodeText.substring(1); | 17 | nodeText = nodeText.substring(1); | |
18 | if (nodeText.endsWith(")")) | 18 | if (nodeText.endsWith(")")) | |
19 | nodeText = nodeText.substring(0, nodeText.length() - 1); | 19 | nodeText = nodeText.substring(0, nodeText.length() - 1); | |
20 | String[] splits = StringHelper.split(", ", nodeText); | 20 | String[] splits = StringHelper.split(", ", nodeText); | |
21 | if (count != splits.length) | 21 | if (count != splits.length) | |
22 | throw new HibernateException("SqlNode's text did not reference expected number of columns"); | 22 | throw new HibernateException("SqlNode's text did not reference expected number of columns"); | |
23 | return splits; | 23 | return splits; | |
else | else | |||
24 | throw new HibernateException("dont know how to extract row value elements from node : " + operand); | 24 | throw new HibernateException("dont know how to extract row value elements from node : " + operand); |
Row | Violation |
---|