private static String[] extractMutationTexts(Node operand, int count) { if ( operand instanceof ParameterNode ) { String[] rtn = new String[count]; for ( int i = 0; i < count; i++ ) { rtn[i] = "?"; } return rtn; } else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) { String[] rtn = new String[ operand.getNumberOfChildren() ]; int x = 0; AST node = operand.getFirstChild(); while ( node != null ) { rtn[ x++ ] = node.getText(); node = node.getNextSibling(); } return rtn; } else if ( operand instanceof SqlNode ) { String nodeText = operand.getText(); if ( nodeText.startsWith( "(" ) ) { nodeText = nodeText.substring( 1 ); } if ( nodeText.endsWith( ")" ) ) { nodeText = nodeText.substring( 0, nodeText.length() - 1 ); } String[] splits = StringHelper.split( ", ", nodeText ); if ( count != splits.length ) { throw new HibernateException( "SqlNode's text did not reference expected number of columns" ); } return splits; } else { throw new HibernateException( "dont know how to extract row value elements from node : " + operand );
private static String[] extractMutationTexts(Node operand, int count) { if ( operand instanceof ParameterNode ) { String[] rtn = new String[count]; for ( int i = 0; i < count; i++ ) { rtn[i] = "?"; } return rtn; } else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) { String[] rtn = new String[ operand.getNumberOfChildren() ]; int x = 0; AST node = operand.getFirstChild(); while ( node != null ) { rtn[ x++ ] = node.getText(); node = node.getNextSibling(); } return rtn; } else if ( operand instanceof SqlNode ) { String nodeText = operand.getText(); if ( nodeText.startsWith( "(" ) ) { nodeText = nodeText.substring( 1 ); } if ( nodeText.endsWith( ")" ) ) { nodeText = nodeText.substring( 0, nodeText.length() - 1 ); } String[] splits = StringHelper.split( ", ", nodeText ); if ( count != splits.length ) { throw new HibernateException( "SqlNode's text did not reference expected number of columns" ); } return splits; } else { throw new HibernateException( "dont know how to extract row value elements from node : " + operand );
Clone fragments detected by clone detection tool
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private static String[] extractMutationTexts(Node operand, int count) {
1
private static String[] extractMutationTexts(Node operand, int count) {
2
		if ( operand instanceof ParameterNode ) {
2
		if ( operand instanceof ParameterNode ) {
3
			String[] rtn = new String[count];
3
			String[] rtn = new String[count];
4
			for ( int i = 0; i < count; i++ ) {
4
			for ( int i = 0; i < count; i++ ) {
5
				rtn[i] = "?";
5
				rtn[i] = "?";
6
			}
6
			}
7
			return rtn;
7
			return rtn;
8
		}
8
		}
9
		else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) {
9
		else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) {
10
			String[] rtn = new String[ operand.getNumberOfChildren() ];
10
			String[] rtn = new String[ operand.getNumberOfChildren() ];
11
			int x = 0;
11
			int x = 0;
12
			AST node = operand.getFirstChild();
12
			AST node = operand.getFirstChild();
13
			while ( node != null ) {
13
			while ( node != null ) {
14
				rtn[ x++ ] = node.getText();
14
				rtn[ x++ ] = node.getText();
15
				node = node.getNextSibling();
15
				node = node.getNextSibling();
16
			}
16
			}
17
			return rtn;
17
			return rtn;
18
		}
18
		}
19
		else if ( operand instanceof SqlNode ) {
19
		else if ( operand instanceof SqlNode ) {
20
			String nodeText = operand.getText();
20
			String nodeText = operand.getText();
21
			if ( nodeText.startsWith( "(" ) ) {
21
			if ( nodeText.startsWith( "(" ) ) {
22
				nodeText = nodeText.substring( 1 );
22
				nodeText = nodeText.substring( 1 );
23
			}
23
			}
24
			if ( nodeText.endsWith( ")" ) ) {
24
			if ( nodeText.endsWith( ")" ) ) {
25
				nodeText = nodeText.substring( 0, nodeText.length() - 1 );
25
				nodeText = nodeText.substring( 0, nodeText.length() - 1 );
26
			}
26
			}
27
			String[] splits = StringHelper.split( ", ", nodeText );
27
			String[] splits = StringHelper.split( ", ", nodeText );
28
			if ( count != splits.length ) {
28
			if ( count != splits.length ) {
29
				throw new HibernateException( "SqlNode's text did not reference expected number of columns" );
29
				throw new HibernateException( "SqlNode's text did not reference expected number of columns" );
30
			}
30
			}
31
			return splits;
31
			return splits;
32
		}
32
		}
33
		else {
33
		else {
34
			throw new HibernateException( "dont know how to extract row value elements from node : " + operand );
34
			throw new HibernateException( "dont know how to extract row value elements from node : " + operand );
35
		
35
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0