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