/** * Returns additional display text for the AST node. * * @return String - The additional display text. */ public String getDisplayText() { StringBuffer buf = new StringBuffer(); if ( getWalker().getQuerySpaces().size() > 0 ) { buf.append( " querySpaces (" ); for ( Iterator iterator = getWalker().getQuerySpaces().iterator(); iterator.hasNext(); ) { buf.append( iterator.next() ); if ( iterator.hasNext() ) { buf.append( "," ); } } buf.append( ")" ); } return buf.toString(); }
private String keyString() { StringBuffer buff = new StringBuffer(); Iterator itr = subProperties.keySet().iterator(); while ( itr.hasNext() ) { buff.append( itr.next() ); if ( itr.hasNext() ) { buff.append( ", " ); } } return buff.toString(); }
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/AbstractStatement.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/any/ComplexPropertyValue.java
Method name: String getDisplayText() Method name: String keyString()
Number of AST nodes: 4 Number of AST nodes: 4
1
/**
1
private String keyString() {
2
	 * Returns additional display text for the AST node.
2
		StringBuffer buff = new StringBuffer();
3
	 *
3
		Iterator itr = subProperties.keySet().iterator();
4
	 * @return String - The additional display text.
4
		while ( itr.hasNext() ) {
5
	 */
5
			buff.append( itr.next() );
6
	public String getDisplayText() {
6
			if ( itr.hasNext() ) {
7
		StringBuffer buf = new StringBuffer();
7
				buff.append( ", " );
8
		if ( getWalker().getQuerySpaces().size() > 0 ) {
8
			}
9
			buf.append( " querySpaces (" );
9
		}
10
			for ( Iterator iterator = getWalker().getQuerySpaces().iterator(); iterator.hasNext(); ) {
10
		return buff.toString();
11
				buf.append( iterator.next() );
11
	}
12
				if ( iterator.hasNext() ) {
13
					buf.append( "," );
14
				}
15
			}
16
			buf.append( ")" );
17
		}
18
		return buf.toString();
19
	}
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score1.000
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    for (Iterator iterator = getWalker().getQuerySpaces().iterator(); iterator.hasNext(); )
    4
    for (Iterator iterator = getWalker().getQuerySpaces().iterator(); iterator.hasNext(); )
    3
    while (itr.hasNext())
    Differences
    Expression1Expression2Difference
    iteratoritrVARIABLE_NAME_MISMATCH
    getQuerySpaceskeySetMETHOD_INVOCATION_NAME_MISMATCH
    getWalker()subPropertiesAST_TYPE_MISMATCH
    3
    while (itr.hasNext())
    5
    buf.append(iterator.next());
    5
    buf.append(iterator.next());
    4
    buff.append(itr.next());
    Differences
    Expression1Expression2Difference
    iteratoritrVARIABLE_NAME_MISMATCH
    bufbuffVARIABLE_NAME_MISMATCH
    4
    buff.append(itr.next());
    6
    if (iterator.hasNext())
    6
    if (iterator.hasNext())
    5
    if (itr.hasNext())
    Differences
    Expression1Expression2Difference
    iteratoritrVARIABLE_NAME_MISMATCH
    5
    if (itr.hasNext())
    7
    buf.append(",");
    7
    buf.append(",");
    6
    buff.append(", ");
    Differences
    Expression1Expression2Difference
    ","", "LITERAL_VALUE_MISMATCH
    bufbuffVARIABLE_NAME_MISMATCH
    6
    buff.append(", ");
    Precondition Violations (0)
    Row Violation