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