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