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