try { InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line = null; while ((line = br.readLine()) != null) { LOG.fine(type + ">" + line); //$NON-NLS-1$ buf.append(line + "\n"); //$NON-NLS-1$ } } catch (IOException ioe) { ioe.printStackTrace(); }
try { InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line = null; while ((line = br.readLine()) != null) { LOG.info(">" + line); //$NON-NLS-1$ buf.append(line + "\n"); } } catch (IOException ioe) { ioe.printStackTrace(); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/base/StreamThread.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/spam/spamassassin/IPCHelper.java
Method name: void run() Method name: void run()
Number of AST nodes: 7 Number of AST nodes: 7
1
try {
1
try {
2
            InputStreamReader isr = new InputStreamReader(is);
2
                InputStreamReader isr = new InputStreamReader(is);
3
            BufferedReader br = new BufferedReader(isr);
3
                BufferedReader br = new BufferedReader(isr);
4
            String line = null;
4
                String line = null;
5
            while ((line = br.readLine()) != null) {
5
                while ((line = br.readLine()) != null) {
6
                LOG.fine(type + ">" + line); //$NON-NLS-1$
6
                    LOG.info(">" + line); //$NON-NLS-1$
7
                buf.append(line + "\n"); //$NON-NLS-1$
7
                    buf.append(line + "\n");
8
            }
8
            
9
    }
9
        } catch (IOException ioe) {
10
            } catch (IOException ioe) {
10
            ioe.printStackTrace();
11
                ioe.printStackTrace();
11
        }
12
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    2
    InputStreamReader isr = new InputStreamReader(is);
    2
    InputStreamReader isr = new InputStreamReader(is);
    3
    BufferedReader br = new BufferedReader(isr);
    3
    BufferedReader br = new BufferedReader(isr);
    4
    String line = null;
    4
    String line = null;
    5
    while ((line = br.readLine()) != null)
    5
    while ((line = br.readLine()) != null)
    6
    LOG.fine(type + ">" + line);
    6
    LOG.fine(type + ">" + line);
    6
    LOG.info(">" + line);
    Differences
    Expression1Expression2Difference
    type">"TYPE_COMPATIBLE_REPLACEMENT
    ">"lineTYPE_COMPATIBLE_REPLACEMENT
    type + ">" + line">" + lineINFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    fineinfoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression line cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression type + ">" + line cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ">" + line cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOG.fine(type + ">" + line) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOG.info(">" + line) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOG.fine(type + ">" + line) is a void method call, and thus it cannot be parameterized
    Expression LOG.info(">" + line) is a void method call, and thus it cannot be parameterized
    6
    LOG.info(">" + line);
    7
    buf.append(line + "\n");
    7
    buf.append(line + "\n");
    Precondition Violations (7)
    Row Violation
    1Expression line cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression type + ">" + line cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ">" + line cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression LOG.fine(type + ">" + line) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression LOG.info(">" + line) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression LOG.fine(type + ">" + line) is a void method call, and thus it cannot be parameterized
    7Expression LOG.info(">" + line) is a void method call, and thus it cannot be parameterized