Vector v = new Vector(); StringTokenizer st = new StringTokenizer(s, delim); while ( st.hasMoreTokens() ) v.addElement( st.nextToken() ); String [] sa = new String [ v.size() ]; v.copyInto( sa ); return sa;
StringBuffer buf = new StringBuffer(); getDescriptor(buf, c); return buf.toString();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/StringUtil.java File path: /jEdit-4.2/src/org/objectweb/asm/Type.java
Method name: String[] split(String, String) Method name: String getDescriptor(Class)
Number of AST nodes: 7 Number of AST nodes: 3
1
Vector v = new Vector();
2
		StringTokenizer st = new StringTokenizer(s, delim);
3
		while ( st.hasMoreTokens() )
4
			v.addElement( st.nextToken() );
5
		String [] sa = new String [ v.size() ];
6
		v.copyInto( sa );
7
		return sa
1
StringBuffer buf = new StringBuffer();
2
    getDescriptor(buf, c);
8
;
3
    return buf.toString();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                  
    1
    StringBuffer buf = new StringBuffer();
    1
    Vector v = new Vector();
                                                      
    2
    StringTokenizer st = new StringTokenizer(s, delim);
                                                                                                          
                                                      
    3
    return buf.toString();
    Preondition Violations
    Unmatched statement return buf.toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return buf.toString();
    3
    return buf.toString();
    3
    while (st.hasMoreTokens())
                                                            
    4
    v.addElement(st.nextToken());
                                                                    
    5
    String[] sa = new String[v.size()];
                                                                            
    6
    v.copyInto(sa);
    6
    v.copyInto(sa);
    2
    getDescriptor(buf, c);
    Differences
    Expression1Expression2Difference
    copyIntogetDescriptorMETHOD_INVOCATION_NAME_MISMATCH
    v.copyInto(sa)getDescriptor(buf,c)ARGUMENT_NUMBER_MISMATCH
    vMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression v.copyInto(sa) is a void method call, and thus it cannot be parameterized
    Expression getDescriptor(buf,c) is a void method call, and thus it cannot be parameterized
    Expression v.copyInto(sa) is a void method call, and thus it cannot be parameterized
    Expression getDescriptor(buf,c) is a void method call, and thus it cannot be parameterized
    2
    getDescriptor(buf, c);
    7
    return sa;
    7
    return sa;
    Preondition Violations
    Unmatched return sa;
                              
    Precondition Violations (7)
    Row Violation
    1Unmatched statement return buf.toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return buf.toString();
    3Expression v.copyInto(sa) is a void method call, and thus it cannot be parameterized
    4Expression getDescriptor(buf,c) is a void method call, and thus it cannot be parameterized
    5Expression v.copyInto(sa) is a void method call, and thus it cannot be parameterized
    6Expression getDescriptor(buf,c) is a void method call, and thus it cannot be parameterized
    7Unmatched return sa;