42-2-4

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 <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 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;
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;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateTickMarkPosition.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/event/ChartChangeEventType.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    public final class DateTickMarkPosition implements Serializable {↵

1

    public final class ChartChangeEventType implements Serializable {↵

2

        /** For serialization. */↵

2

        /** For serialization. */↵

3

        private static final long serialVersionUID = 2540750672764537240L;↵

3

        private static final long serialVersionUID = 5481917022435735602L;↵

4

        ↵

4

        ↵

5

        /** Start of period. */↵

5

        /** GENERAL. */↵

6

        public static final DateTickMarkPosition START↵

6

        public static final ChartChangeEventType GENERAL ↵

7

            = new DateTickMarkPosition("DateTickMarkPosition.START");↵

7

                = new ↵

8

        /** Middle of period. */↵

9

        public static final DateTickMarkPosition MIDDLE↵

8

    ChartChangeEventType("ChartChangeEventType.GENERAL");↵

9

        /** NEW_DATASET. */↵

10

        public static final ChartChangeEventType NEW_DATASET ↵

10

            = new DateTickMarkPosition("DateTickMarkPosition.MIDDLE");↵

11

                = new ↵

11

        /** End of period. */↵

12

        public static final DateTickMarkPosition EN↵

12

    ChartChangeEventType("ChartChangeEventType.NEW_DATASET");↵

13

        /** DATASET_UPDATED. */↵

13

    D↵

14

        public static final ChartChangeEventType DATASET_UPDATED↵

14

            = new DateTickMarkPosition("DateTickMarkPosition.END");↵

15

                = new ChartChangeEventType("ChartChangeEventType.DATASET_UPDATED");↵

15

        /** The name. */↵

16

        /** The name. */↵

16

        private String name;↵

17

        private String name;↵

17

        /**↵

18

        /**↵

18

         * Private constructor.↵

19

         * Private constructor.↵

19

         *↵

20

         *↵

20

         * @param name  the name.↵

21

         * @param name  the name.↵

21

         */↵

22

         */↵

22

        private DateTickMarkPosition(String name) {↵

23

        private ChartChangeEventType(String name) {↵

23

            this.name = name;↵

24

            this.name = name;↵

24

        }↵

25

        }↵

25

        /**↵

26

        /**↵

26

         * Returns a string representing the object.↵

27

         * Returns a string representing the object.↵

27

         *↵

28

         *↵

28

         * @return The string.↵

29

         * @return The string.↵

29

         */↵

30

         */↵

30

        public String toString() {↵

31

        public String toString() {↵

31

            return this.name;↵

32

            return this.name;↵

32

        }↵

33

        }↵

33

        /**↵

34

        /**↵

34

         * Returns <code>true</code> if this object is equal to the specified ↵

35

         * Returns <code>true</code> if this object is equal to the specified ↵

35

         * object, and <code>false</code> otherwise.↵

36

         * object, and <code>false</code> otherwise.↵

36

         *↵

37

         *↵

37

         * @param obj  the other object.↵

38

         * @param obj  the object (<code>null</code> permitted).↵

38

         *↵

39

         *↵

39

         * @return A boolean.↵

40

         * @return A boolean.↵

40

         */↵

41

         */↵

41

        public boolean equals(Object obj) {↵

42

        public boolean equals(Object obj) {↵

42

            if (this == obj) {↵

43

            if (this == obj) {↵

43

                return true;↵

44

                return true;↵

44

            }↵

45

            }↵

45

            if (!(obj instanceof DateTickMarkPosition)) {↵

46

            if (!(obj instanceof ChartChangeEventType)) {↵

46

                return false;↵

47

                return false;↵

47

            }↵

48

            }↵

48

            DateTickMarkPosition position = (DateTickMarkPosition) obj;↵

49

            ChartChangeEventType that = (ChartChangeEventType) obj;↵

49

            if (!this.name.equals(position.toString())) {↵

50

            if (!this.name.equals(that.toString())) {↵

50

                return false;↵

51

                return false;↵

51

            }↵

52

            }↵

52

            return true;↵

53

            return true;↵

54

        }↵

53

        }↵

55

        ↵

54

        ↵

56

        /**↵

57

         * Returns a hash code value for the object.↵

58

         *↵

59

         * @return The hashcode↵

60

         */↵

61

        public int hashCode() {↵

62

            return this.name.hashCode();↵

63

        }↵

55

        /**↵

64

        /**↵

56

         * Ensures that serialization returns the unique instances.↵

65

         * Ensures that serialization returns the unique instances.↵

57

         * ↵

66

         * ↵

58

         * @return The object.↵

67

         * @return The object.↵

59

         * ↵

68

         * ↵

60

         * @throws ObjectStreamException if there is a problem.↵

69

         * @throws ObjectStreamException if there is a problem.↵

61

         */↵

70

         */↵

62

        private Object readResolve() throws ObjectStreamException {↵

71

        private Object readResolve() throws ObjectStreamException {↵

63

            if (this.equals(DateTickMarkPosition.START)) {↵

72

            if (this.equals(↵

64

                return DateTickMarkPosition.START↵

73

    ChartChangeEventType.GENERAL)) {↵

65

    ;↵

74

                return ChartChangeEventType.GENERAL;↵

66

            }↵

75

            }↵

67

            else if (this.equals(DateTickMarkPosition.MIDDLE)) {↵

76

            else if (this.equals(↵

68

                return DateTickMarkPosition.MIDDLE↵

77

    ChartChangeEventType.NEW_DATASET)) {↵

69

    ;↵

78

                return ChartChangeEventType.NEW_DATASET;↵

70

            }    ↵

79

            }↵

71

            else if (this.equals(DateTickMarkPosition.END)) {↵

80

            else if (this.equals(↵

72

                return DateTickMarkPosition.EN↵

81

    ChartChangeEventType.DATASET_UPDATED)) {↵

73

    D;↵

82

                return ChartChangeEventType.DATASET_UPDATED;↵

74

            }    ↵

83

            }↵

75

            return null;↵

84

            return null;↵

76

85

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location |
Number of node comparisons | 0