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