try { setGranularity(new Integer(parameters[i].getValue() ).intValue()); } catch (NumberFormatException nfe) { setError("Invalid granularity setting " + parameters[i].getValue()); }
try { setMillis(new Long(parameters[i].getValue() ).longValue()); } catch (NumberFormatException nfe) { setError("Invalid millisecond setting " + parameters[i].getValue()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/DateSelector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/DateSelector.java
Method name: void setParameters(Parameter[]) Method name: void setParameters(Parameter[])
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
                        setGranularity(new Integer(parameters[i].getValue()
2
                        setMillis(new Long(parameters[i].getValue()
3
                        ).intValue());
3
                        ).longValue());
4
                    } catch (NumberFormatException nfe) {
4
                    } catch (NumberFormatException nfe) {
5
                        setError("Invalid granularity setting "
5
                        setError("Invalid millisecond setting "
6
                            + parameters[i].getValue());
6
                                + parameters[i].getValue());
7
                    }
7
                    }
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.4
Clones locationClones are in the same method
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    try
    13
    try
    6
    try
    Differences
    Expression1Expression2Difference
    "Invalid granularity setting ""Invalid millisecond setting "LITERAL_VALUE_MISMATCH
    6
    try
    14
    setGranularity(new Integer(parameters[i].getValue()).intValue());
    14
    setGranularity(new Integer(parameters[i].getValue()).intValue());
    7
    setMillis(new Long(parameters[i].getValue()).longValue());
    Differences
    Expression1Expression2Difference
    intValuelongValueMETHOD_INVOCATION_NAME_MISMATCH
    intlongVARIABLE_TYPE_MISMATCH
    java.lang.Integerjava.lang.LongSUBCLASS_TYPE_MISMATCH
    setGranularitysetMillisMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression new Integer(parameters[i].getValue()).intValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression new Long(parameters[i].getValue()).longValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Type int of variable new Integer(parameters[i].getValue()).intValue() does not match with type long of variable new Long(parameters[i].getValue()).longValue()
    Expression new Integer(parameters[i].getValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression new Long(parameters[i].getValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression setGranularity(new Integer(parameters[i].getValue()).intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setMillis(new Long(parameters[i].getValue()).longValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setGranularity(new Integer(parameters[i].getValue()).intValue()) is a void method call, and thus it cannot be parameterized
    Expression setMillis(new Long(parameters[i].getValue()).longValue()) is a void method call, and thus it cannot be parameterized
    7
    setMillis(new Long(parameters[i].getValue()).longValue());
    Precondition Violations (9)
    Row Violation
    1Expression new Integer(parameters[i].getValue()).intValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression new Long(parameters[i].getValue()).longValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Type int of variable new Integer(parameters[i].getValue()).intValue() does not match with type long of variable new Long(parameters[i].getValue()).longValue()
    4Expression new Integer(parameters[i].getValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5Expression new Long(parameters[i].getValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6Expression setGranularity(new Integer(parameters[i].getValue()).intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression setMillis(new Long(parameters[i].getValue()).longValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression setGranularity(new Integer(parameters[i].getValue()).intValue()) is a void method call, and thus it cannot be parameterized
    9Expression setMillis(new Long(parameters[i].getValue()).longValue()) is a void method call, and thus it cannot be parameterized