Class [][] candidates = new Class[ ma.length ][]; for( int i=0; i< ma.length; i++ ) candidates[i] = ma[i].getParameterTypes();
Class [][] candidates = new Class [ constructors.length ] []; for(int i=0; i< candidates.length; i++ ) candidates[i] = constructors[i].getParameterTypes();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/NameSpace.java File path: /jEdit-4.2/src/bsh/Reflect.java
Method name: BshMethod getMethod(String, Class[], boolean) Method name: int findMostSpecificConstructorIndex(Class[], Constructor[])
Number of AST nodes: 3 Number of AST nodes: 3
1
Class [][] candidates = new Class[ ma.length ][];
1
Class [][] candidates = new Class [ constructors.length ] [];
2
				for( int i=0; i< ma.length; i++ )
2
		for(int i=0; i< candidates.length; i++ )
3
					candidates[i] = ma[i].getParameterTypes();
3
			candidates[i] = constructors[i].getParameterTypes();
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.2
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    Class[][] candidates = new Class[ma.length];
    14
    Class[][] candidates = new Class[ma.length];
    1
    Class[][] candidates = new Class[constructors.length];
    Differences
    Expression1Expression2Difference
    maconstructorsVARIABLE_NAME_MISMATCH
    bsh.BshMethod[]java.lang.reflect.Constructor[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type bsh.BshMethod[] of variable ma does not match with type java.lang.reflect.Constructor[] of variable constructors
    • Make classes bsh.BshMethod[] and java.lang.reflect.Constructor[] extend a common superclass
    1
    Class[][] candidates = new Class[constructors.length];
    15
    for (int i = 0; i < ma.length; i++)
    15
    for (int i = 0; i < ma.length; i++)
    2
    for (int i = 0; i < candidates.length; i++)
    Differences
    Expression1Expression2Difference
    macandidatesVARIABLE_NAME_MISMATCH
    bsh.BshMethod[]java.lang.Class[][]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression candidates cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type bsh.BshMethod[] of variable ma does not match with type java.lang.Class[][] of variable candidates
    • Make classes bsh.BshMethod[] and java.lang.Class[][] extend a common superclass
    2
    for (int i = 0; i < candidates.length; i++)
    16
    candidates[i] = ma[i].getParameterTypes();
    16
    candidates[i] = ma[i].getParameterTypes();
    3
    candidates[i] = constructors[i].getParameterTypes();
    Differences
    Expression1Expression2Difference
    maconstructorsVARIABLE_NAME_MISMATCH
    bsh.BshMethod[]java.lang.reflect.Constructor[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type bsh.BshMethod[] of variable ma does not match with type java.lang.reflect.Constructor[] of variable constructors
    • Make classes bsh.BshMethod[] and java.lang.reflect.Constructor[] extend a common superclass
    3
    candidates[i] = constructors[i].getParameterTypes();
    Precondition Violations (4)
    Row Violation
    1Type bsh.BshMethod[] of variable ma does not match with type java.lang.reflect.Constructor[] of variable constructors
    2Expression candidates cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type bsh.BshMethod[] of variable ma does not match with type java.lang.Class[][] of variable candidates
    4Type bsh.BshMethod[] of variable ma does not match with type java.lang.reflect.Constructor[] of variable constructors