43-1-2

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 <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 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 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/block/LengthConstraintType.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 LengthConstraintType implements Serializable {↵

1

    public final class ChartChangeEventType implements Serializable {↵

2

        /** For serialization. */↵

2

        /** For serialization. */↵

3

        private static final long serialVersionUID = -1156658804028142978L;↵

3

        private static final long serialVersionUID = 5481917022435735602L;↵

4

        ↵

4

        ↵

5

        /** NONE. */↵

5

        /** GENERAL. */↵

6

        public static final LengthConstraintType NONE ↵

6

        public static final ↵

7

            = new LengthConstraintType("LengthConstraintType.NONE↵

7

    ChartChangeEventType GENERAL ↵

8

    ");↵

8

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

9

        /** Range. */↵

9

        /** NEW_DATASET. */↵

10

        public static final LengthConstraintType RANGE ↵

10

        public static final ↵

11

            = new LengthConstraintType("RectangleConstraintType.RANGE↵

11

    ChartChangeEventType NEW_DATASET ↵

12

    ");↵

12

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

13

        /** FIXED. */↵

13

        /** DATASET_UPDATED. */↵

14

        public static final LengthConstraintType FIXED ↵

14

        public static final ChartChangeEventType DATASET_UPDATED↵

15

            = new LengthConstraintType("LengthConstraintType.FIXED");↵

15

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

16

        /** The name. */↵

16

        /** The name. */↵

17

        private String name;↵

17

        private String name;↵

18

        /**↵

18

        /**↵

19

         * Private constructor.↵

19

         * Private constructor.↵

20

         *↵

20

         *↵

21

         * @param name  the name.↵

21

         * @param name  the name.↵

22

         */↵

22

         */↵

23

        private LengthConstraintType(String name) {↵

23

        private ChartChangeEventType(String name) {↵

24

            this.name = name;↵

24

            this.name = name;↵

25

        }↵

25

        }↵

26

        /**↵

26

        /**↵

27

         * Returns a string representing the object.↵

27

         * Returns a string representing the object.↵

28

         *↵

28

         *↵

29

         * @return The string.↵

29

         * @return The string.↵

30

         */↵

30

         */↵

31

        public String toString() {↵

31

        public String toString() {↵

32

            return this.name;↵

32

            return this.name;↵

33

        }↵

33

        }↵

34

        /**↵

34

        /**↵

35

         * 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 ↵

36

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

36

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

37

         *↵

37

         *↵

38

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

38

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

39

         *↵

39

         *↵

40

         * @return A boolean.↵

40

         * @return A boolean.↵

41

         */↵

41

         */↵

42

        public boolean equals(Object obj) {↵

42

        public boolean equals(Object obj) {↵

43

            if (this == obj) {↵

43

            if (this == obj) {↵

44

                return true;↵

44

                return true;↵

45

            }↵

45

            }↵

46

            if (!(obj instanceof LengthConstraintType)) {↵

46

            if (!(obj instanceof ChartChangeEventType)) {↵

47

                return false;↵

47

                return false;↵

48

            }↵

48

            }↵

49

            LengthConstraintType that = (LengthConstraintType) obj;↵

49

            ChartChangeEventType that = (ChartChangeEventType) obj;↵

50

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

50

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

51

                return false;↵

51

                return false;↵

52

            }↵

52

            }↵

53

            return true;↵

53

            return true;↵

54

        }↵

54

        }↵

55

        ↵

55

        ↵

56

        /**↵

56

        /**↵

57

         * Returns a hash code value for the object.↵

57

         * Returns a hash code value for the object.↵

58

         *↵

58

         *↵

59

         * @return The hashcode↵

59

         * @return The hashcode↵

60

         */↵

60

         */↵

61

        public int hashCode() {↵

61

        public int hashCode() {↵

62

            return this.name.hashCode();↵

62

            return this.name.hashCode();↵

63

        }↵

63

        }↵

64

        /**↵

64

        /**↵

65

         * Ensures that serialization returns the unique instances.↵

65

         * Ensures that serialization returns the unique instances.↵

66

         * ↵

66

         * ↵

67

         * @return The object.↵

67

         * @return The object.↵

68

         * ↵

68

         * ↵

69

         * @throws ObjectStreamException if there is a problem.↵

69

         * @throws ObjectStreamException if there is a problem.↵

70

         */↵

70

         */↵

71

        private Object readResolve() throws ObjectStreamException {↵

71

        private Object readResolve() throws ObjectStreamException {↵

72

            if (this.equals(LengthConstraintType.NONE)) {↵

72

            if (this.equals(ChartChangeEventType.GENERAL)) {↵

73

                return LengthConstraintType.NONE;↵

73

                return ChartChangeEventType.GENERAL;↵

74

            }↵

74

            }↵

75

            else if (this.equals(LengthConstraintType.RANGE)) {↵

75

            else if (this.equals(ChartChangeEventType.NEW_DATASET)) {↵

76

                return LengthConstraintType.RANGE;↵

76

                return ChartChangeEventType.NEW_DATASET;↵

77

            }↵

77

            }↵

78

            else if (this.equals(LengthConstraintType.FIXED)) {↵

78

            else if (this.equals(↵

79

                return LengthConstraintType.FIX↵

79

    ChartChangeEventType.DATASET_UPDATED)) {↵

80

    ED;↵

80

                return ChartChangeEventType.DATASET_UPDATED;↵

81

            }↵

81

            }↵

82

            return null;↵

82

            return null;↵

83

83

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