class Operation extends EnumeratedAttribute { // Property type operations /** + */ public static final int INCREMENT_OPER = 0; /** - */ public static final int DECREMENT_OPER = 1; /** = */ public static final int EQUALS_OPER = 2; /** {@inheritDoc}. */ public String[] getValues() { return new String[] {"+", "-", "="}; } /** * Convert string to index. * @param oper the string to convert. * @return the index. */ public static int toOperation(String oper) { if ("+".equals(oper)) { return INCREMENT_OPER; } else if ("-".equals(oper)) { return DECREMENT_OPER; } return EQUALS_OPER; }
class Type extends EnumeratedAttribute { // Property types /** int */ public static final int INTEGER_TYPE = 0; /** date */ public static final int DATE_TYPE = 1; /** string */ public static final int STRING_TYPE = 2; /** {@inheritDoc} */ public String[] getValues() { return new String[] {"int", "date", "string"}; } /** * Convert string to index. * @param type the string to convert. * @return the index. */ public static int toType(String type) { if ("int".equals(type)) { return INTEGER_TYPE; } else if ("date".equals(type)) { return DATE_TYPE; } return STRING_TYPE; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/PropertyFile.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
class Operation extends EnumeratedAttribute {
1
class Type extends EnumeratedAttribute {
2
            // Property type operations
2
            // Property types
3
            /** + */
3
            /** int */
4
            public static final int INCREMENT_OPER =   0;
4
            public static final int INTEGER_TYPE =     0;
5
            /** - */
5
            /** date */
6
            public static final int DECREMENT_OPER =   1;
6
            public static final int DATE_TYPE =        1;
7
            /** = */
7
            /** string */
8
            public static final int EQUALS_OPER =      2;
8
            public static final int STRING_TYPE =      2;
9
            /** {@inheritDoc}. */
9
            /** {@inheritDoc} */
10
            public String[] getValues() {
10
            public String[] getValues() {
11
                return new String[] {"+", "-", "="};
11
                return new String[] {"int", "date", "string"};
12
            }
12
            }
13
            /**
13
            /**
14
             * Convert string to index.
14
             * Convert string to index.
15
             * @param oper the string to convert.
15
             * @param type the string to convert.
16
             * @return the index.
16
             * @return the index.
17
             */
17
             */
18
            public static int toOperation(String oper) {
18
            public static int toType(String type) {
19
                if ("+".equals(oper)) {
19
                if ("int".equals(type)) {
20
                    return INCREMENT_OPER;
20
                    return INTEGER_TYPE;
21
                } else if ("-".equals(oper)) {
21
                } else if ("date".equals(type)) {
22
                    return DECREMENT_OPER;
22
                    return DATE_TYPE;
23
                }
23
                }
24
                return EQUALS_OPER;
24
                return STRING_TYPE;
25
            }
25
            }
26
        
26
        
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.0
Clones location
Number of node comparisons0