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