final ConstantValue cv = field.getConstantValue(); if (cv != null) { String cvs = cv.toString(); //Remove start and end quotes if field is a String if (cvs.startsWith("\"") && cvs.endsWith("\"")) { cvs = cvs.substring(1, cvs.length() - 1); } sb.append(field.getName()); sb.append('='); sb.append(cvs); sb.append(LS); }
if (fe.shouldUse(this)) { formatterArg.append(Constants.FORMATTER); formatterArg.append(fe.getClassname()); File outFile = getOutput(fe, test); if (outFile != null) { formatterArg.append(","); formatterArg.append(outFile); } cmd.createArgument().setValue(formatterArg.toString()); formatterArg = new StringBuffer(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/util/JavaClassHelper.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Method name: StringBuffer getConstants(byte[]) Method name: TestResultHolder executeAsForked(JUnitTest, ExecuteWatchdog, File)
Number of AST nodes: 9 Number of AST nodes: 9
1
final ConstantValue cv = field.getConstantValue();
2
                if (cv != null) {
3
                    String cvs = cv.toString();
4
                    //Remove start and end quotes if field is a String
5
                    if (cvs.startsWith("\"") && cvs.endsWith("\"")) {
6
                        cvs = cvs.substring(1, cvs.length() - 1);
7
                    }
1
if (fe.shouldUse(this)) {
2
                formatterArg.append(Constants.FORMATTER);
3
                formatterArg.append(fe.getClassname());
4
                File outFile = getOutput(fe, test);
5
                if (outFile != null) {
6
                    formatterArg.append(",");
8
                    sb.append(field.getName());
7
                    
9
                    sb.append('=');
8
formatterArg.append(outFile);
9
                }
10
                    sb.append(cvs);
10
                
11
                    sb.append(LS);
12
    
11
cmd.createArgument().setValue(formatterArg.toString());
12
                formatterArg = new StringBuffer();
13
            }
13
            }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons1