public final class DomainOrder implements Serializable { /** For serialization. */ private static final long serialVersionUID = 4902774943512072627L; /** No order. */ public static final DomainOrder NONE = new DomainOrder("DomainOrder.NONE"); /** Ascending order. */ public static final DomainOrder ASCENDING = new DomainOrder("DomainOrder.ASCENDING"); /** Descending order. */ public static final DomainOrder DESCENDING = new DomainOrder("DomainOrder.DESCENDING"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private DomainOrder(String name) { this.name = name; } /** * Returns a string representing the object. * * @return The string. */ public String toString() { return this.name; } /** * Returns true if this object is equal to the specified * object, and false otherwise. * * @param obj the other object. * * @return A boolean. */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DomainOrder)) { return false; } DomainOrder that = (DomainOrder) obj; if (!this.name.equals(that.toString())) { return false; } return true; } /** * Returns a hash code value for the object. * * @return The hashcode */ public int hashCode() { return this.name.hashCode(); } /** * Ensures that serialization returns the unique instances. * * @return The object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(DomainOrder.ASCENDING)) { return DomainOrder.ASCENDING; } else if (this.equals(DomainOrder.DESCENDING)) { return DomainOrder.DESCENDING; } else if (this.equals(DomainOrder.NONE)) { return DomainOrder.NONE; } return null;
public final class RangeType implements Serializable { /** For serialization. */ private static final long serialVersionUID = -9073319010650549239L; /** Full range (positive and negative). */ public static final RangeType FULL = new RangeType("RangeType.FULL"); /** Positive range. */ public static final RangeType POSITIVE = new RangeType("RangeType.POSITIVE"); /** Negative range. */ public static final RangeType NEGATIVE = new RangeType("RangeType.NEGATIVE"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private RangeType(String name) { this.name = name; } /** * Returns a string representing the object. * * @return The string. */ public String toString() { return this.name; } /** * Returns true if this object is equal to the specified * object, and false otherwise. * * @param obj the other object. * * @return A boolean. */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof RangeType)) { return false; } RangeType that = (RangeType) obj; if (!this.name.equals(that.toString())) { return false; } return true; } /** * Returns a hash code value for the object. * * @return The hashcode */ public int hashCode() { return this.name.hashCode(); } /** * Ensures that serialization returns the unique instances. * * @return The object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(RangeType.FULL)) { return RangeType.FULL; } else if (this.equals(RangeType.POSITIVE)) { return RangeType.POSITIVE; } else if (this.equals(RangeType.NEGATIVE)) { return RangeType.NEGATIVE; } return null;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/DomainOrder.java File path: /jfreechart-1.0.10/src/org/jfree/data/RangeType.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public final class DomainOrder implements Serializable {
1
public final class RangeType implements Serializable {
2
    /** For serialization. */
2
    /** For serialization. */
3
    private static final long serialVersionUID = 4902774943512072627L;
3
    private static final long serialVersionUID = -9073319010650549239L;
4
    
4
     
5
    /** No order. */
5
    /** Full range (positive and negative). */
6
    public static final DomainOrder NONE = new DomainOrder("DomainOrder.NONE");
6
    public static final 
7
    /** Ascending order
7
RangeType FULL = new RangeType("RangeType.FULL");
8
. */
8
    /** Positive range. */
9
    public static final DomainOrder ASCENDING 
9
    public static final 
10
        = new DomainOrder("DomainOrder.ASCENDING");
11
    /** Descending order
10
RangeType POSITIVE 
11
        = new RangeType("RangeType.POSITIVE");
12
. */
12
    /** Negative range. */
13
    public static final DomainOrder DESCENDING 
13
    public static final 
14
        = new DomainOrder("DomainOrder.DESCENDING
14
RangeType NEGATIVE 
15
");
15
        = new RangeType("RangeType.NEGATIVE");
16
    /** The name. */
16
    /** The name. */
17
    private String name;
17
    private String name;
18
    /**
18
    /**
19
     * Private constructor.
19
     * Private constructor.
20
     *
20
     *
21
     * @param name  the name.
21
     * @param name  the name.
22
     */
22
     */
23
    private DomainOrder(String name) {
23
    private RangeType(String name) {
24
        this.name = name;
24
        this.name = name;
25
    }
25
    }
26
    /**
26
    /**
27
     * Returns a string representing the object.
27
     * Returns a string representing the object.
28
     *
28
     *
29
     * @return The string.
29
     * @return The string.
30
     */
30
     */
31
    public String toString() {
31
    public String toString() {
32
        return this.name;
32
        return this.name;
33
    }
33
    }
34
    /**
34
    /**
35
     * Returns true if this object is equal to the specified 
35
     * Returns true if this object is equal to the specified 
36
     * object, and false otherwise.
36
     * object, and false otherwise.
37
     *
37
     *
38
     * @param obj  the other object.
38
     * @param obj  the other object.
39
     *
39
     *
40
     * @return A boolean.
40
     * @return A boolean.
41
     */
41
     */
42
    public boolean equals(Object obj) {
42
    public boolean equals(Object obj) {
43
        if (this == obj) {
43
        if (this == obj) {
44
            return true;
44
            return true;
45
        }
45
        }
46
        if (!(obj instanceof DomainOrder)) {
46
        if (!(obj instanceof RangeType)) {
47
            return false;
47
            return false;
48
        }
48
        }
49
        DomainOrder that = (DomainOrder) obj;
49
        RangeType that = (RangeType) obj;
50
        if (!this.name.equals(that.toString())) {
50
        if (!this.name.equals(that.toString())) {
51
            return false;
51
            return false;
52
        }
52
        }
53
        return true;
53
        return true;
54
    }
54
    }
55
    
55
    
56
    /**
56
    /**
57
     * Returns a hash code value for the object.
57
     * Returns a hash code value for the object.
58
     *
58
     *
59
     * @return The hashcode
59
     * @return The hashcode
60
     */
60
     */
61
    public int hashCode() {
61
    public int hashCode() {
62
        return this.name.hashCode();
62
        return this.name.hashCode();
63
    }
63
    }
64
    /**
64
    /**
65
     * Ensures that serialization returns the unique instances.
65
     * Ensures that serialization returns the unique instances.
66
     * 
66
     * 
67
     * @return The object.
67
     * @return The object.
68
     * 
68
     * 
69
     * @throws ObjectStreamException if there is a problem.
69
     * @throws ObjectStreamException if there is a problem.
70
     */
70
     */
71
    private Object readResolve() throws ObjectStreamException {
71
    private Object readResolve() throws ObjectStreamException {
72
        if (this.equals(DomainOrder.ASCENDING)) {
72
        if (this.equals(RangeType.FULL)) {
73
            return DomainOrder.ASCENDING;
73
            return RangeType.FULL;
74
        }
74
        }
75
        else if (this.equals(DomainOrder.DESCENDING)) {
75
        else if (this.equals(RangeType.POSITIVE)) {
76
            return DomainOrder.DESCENDING;
76
            return RangeType.POSITIVE;
77
        }
77
        }
78
        else if (this.equals(DomainOrder.NONE)) {
78
        else if (this.equals(RangeType.NEGATIVE)) {
79
            return DomainOrder.NONE;
79
            return RangeType.NEGATIVE;
80
        }
80
        }
81
        return null;
81
        return null;
82
    
82
    
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