Vector vec = new Vector(); getAllNamesAux( vec ); String [] names = new String [ vec.size() ]; vec.copyInto( names ); return names;
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[] getAllNames() Method name: int getScreenLineCount(int)
Number of AST nodes: 5 Number of AST nodes: 3
1
Vector vec = new Vector();
2
		getAllNamesAux( vec );
3
		String [] names = new String [ vec.size() ];
4
		vec.copyInto( names 
1
int newCount = textArea.chunkCache
2
				.getLineSubregionCount(line);
5
);
3
			setScreenLineCount(line,newCount);
6
		return names;
4
			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 comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    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 vec = new Vector();
                                                          
                                                                                                                                    
    3
    int newCount = textArea.chunkCache.getLineSubregionCount(line);
    2
    getAllNamesAux(vec);
    2
    getAllNamesAux(vec);
    4
    setScreenLineCount(line, newCount);
    Differences
    Expression1Expression2Difference
    getAllNamesAuxsetScreenLineCountMETHOD_INVOCATION_NAME_MISMATCH
    getAllNamesAux(vec)setScreenLineCount(line,newCount)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression getAllNamesAux(vec) 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 getAllNamesAux(vec) 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);
    3
    String[] names = new String[vec.size()];
    3
    String[] names = new String[vec.size()];
    Preondition Violations
    Unmatched statement String[] names=new String[vec.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                      
    4
    vec.copyInto(names);
    4
    vec.copyInto(names);
    Preondition Violations
    Unmatched statement vec.copyInto(names); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                  
                                          
    5
    return newCount;
    Preondition Violations
    Unmatched return newCount;
    5
    return newCount;
    5
    return names;
    5
    return names;
    Preondition Violations
    Unmatched return names;
                                    
    Precondition Violations (8)
    Row Violation
    1Expression getAllNamesAux(vec) 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 getAllNamesAux(vec) 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 statement String[] names=new String[vec.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement vec.copyInto(names); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return newCount;
    8Unmatched return names;