Vector v = new Vector(); while ( e.hasMoreElements() ) v.addElement( e.nextElement() ); String [] sa = new String [ v.size() ]; v.copyInto( sa ); return sa;
int newCount = textArea.chunkCache .getLineSubregionCount(line); setScreenLineCount(line,newCount); return newCount;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/NameSpace.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/DisplayManager.java
Method name: String[] enumerationToStringArray(Enumeration) Method name: int getScreenLineCount(int)
Number of AST nodes: 6 Number of AST nodes: 3
1
Vector v = new Vector();
2
		while ( e.hasMoreElements() )
3
			v.addElement( e.nextElement() 
1
int newCount = textArea.chunkCache
4
);
2
				.getLineSubregionCount(line);
5
		String [] sa = new String [ v.size() ];
3
		
6
		v.copyInto( sa );
4
	setScreenLineCount(line,newCount);
7
		return sa;
5
			return newCount;
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 comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment5
    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
    Vector v = new Vector();
                                                      
    2
    while (e.hasMoreElements())
                                                              
    3
    v.addElement(e.nextElement());
                                                                      
                                                                                                                                    
    3
    int newCount = textArea.chunkCache.getLineSubregionCount(line);
    4
    String[] sa = new String[v.size()];
                                                                            
    5
    v.copyInto(sa);
    5
    v.copyInto(sa);
    4
    setScreenLineCount(line, newCount);
    Differences
    Expression1Expression2Difference
    copyIntosetScreenLineCountMETHOD_INVOCATION_NAME_MISMATCH
    v.copyInto(sa)setScreenLineCount(line,newCount)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 setScreenLineCount(line,newCount) 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 setScreenLineCount(line,newCount) is a void method call, and thus it cannot be parameterized
    4
    setScreenLineCount(line, newCount);
                                          
    5
    return newCount;
    Preondition Violations
    Unmatched return newCount;
    5
    return newCount;
    6
    return sa;
    6
    return sa;
    Preondition Violations
    Unmatched return sa;
                              
    Precondition Violations (6)
    Row Violation
    1Expression v.copyInto(sa) is a void method call, and thus it cannot be parameterized
    2Expression setScreenLineCount(line,newCount) is a void method call, and thus it cannot be parameterized
    3Expression v.copyInto(sa) is a void method call, and thus it cannot be parameterized
    4Expression setScreenLineCount(line,newCount) is a void method call, and thus it cannot be parameterized
    5Unmatched return newCount;
    6Unmatched return sa;