43-1-5

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 RangeType implements Serializable { /** For serialization. */ private static final long serialVersionUID = -9073319010650549239L; /** Full range (positive and negative). */ public static final RangeType FULL = new RangeType("RangeType.FULL"); /** Positive range. */ public static final RangeType POSITIVE = new RangeType("RangeType.POSITIVE"); /** Negative range. */ public static final RangeType NEGATIVE = new RangeType("RangeType.NEGATIVE"); /** The name. */ private String name; /** * Private constructor. * * @param name the name. */ private RangeType(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 RangeType)) { return false; } RangeType that = (RangeType) 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(RangeType.FULL)) { return RangeType.FULL; } else if (this.equals(RangeType.POSITIVE)) { return RangeType.POSITIVE; } else if (this.equals(RangeType.NEGATIVE)) { return RangeType.NEGATIVE; } 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/RangeType.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 RangeType implements Serializable {↵

2

        /** For serialization. */↵

2

        /** For serialization. */↵

3

        private static final long serialVersionUID = -1156658804028142978L;↵

3

        private static final long serialVersionUID = -9073319010650549239L;↵

4

        ↵

4

         ↵

5

        /** NONE. */↵

5

        /** ↵

6

        public static final LengthConstraintType NONE ↵

7

            = new LengthConstraintType("LengthConstraint↵

6

    Full range (positive and negative). */↵

8

    Type.NONE");↵

7

        public static final RangeType FULL = new RangeType("RangeType.FULL");↵

9

        /** Range. */↵

8

        /** Positive range. */↵

10

        public static final LengthConstraintType RANGE ↵

9

        public static final RangeType POSITIVE ↵

11

            = new LengthConstraintType("RectangleConstraintType.RANGE");↵

10

            = new RangeType("RangeType.POSITIVE");↵

12

        /** FIXED. */↵

11

        /** Negative range. */↵

13

        public static final LengthConstraintType FIXED ↵

12

        public static final RangeType NEGATIVE ↵

14

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

13

            = new RangeType("RangeType.NEGATIVE");↵

15

        /** The name. */↵

14

        /** The name. */↵

16

        private String name;↵

15

        private String name;↵

17

        /**↵

16

        /**↵

18

         * Private constructor.↵

17

         * Private constructor.↵

19

         *↵

18

         *↵

20

         * @param name  the name.↵

19

         * @param name  the name.↵

21

         */↵

20

         */↵

22

        private LengthConstraintType(String name) {↵

21

        private RangeType(String name) {↵

23

            this.name = name;↵

22

            this.name = name;↵

24

        }↵

23

        }↵

25

        /**↵

24

        /**↵

26

         * Returns a string representing the object.↵

25

         * Returns a string representing the object.↵

27

         *↵

26

         *↵

28

         * @return The string.↵

27

         * @return The string.↵

29

         */↵

28

         */↵

30

        public String toString() {↵

29

        public String toString() {↵

31

            return this.name;↵

30

            return this.name;↵

32

        }↵

31

        }↵

33

        /**↵

32

        /**↵

34

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

33

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

35

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

34

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

36

         *↵

35

         *↵

37

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

36

         * @param obj  the other object.↵

38

         *↵

37

         *↵

39

         * @return A boolean.↵

38

         * @return A boolean.↵

40

         */↵

39

         */↵

41

        public boolean equals(Object obj) {↵

40

        public boolean equals(Object obj) {↵

42

            if (this == obj) {↵

41

            if (this == obj) {↵

43

                return true;↵

42

                return true;↵

44

            }↵

43

            }↵

45

            if (!(obj instanceof LengthConstraintType)) {↵

44

            if (!(obj instanceof RangeType)) {↵

46

                return false;↵

45

                return false;↵

47

            }↵

46

            }↵

48

            LengthConstraintType that = (LengthConstraintType) obj;↵

47

            RangeType that = (RangeType) obj;↵

49

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

48

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

50

                return false;↵

49

                return false;↵

51

            }↵

50

            }↵

52

            return true;↵

51

            return true;↵

53

        }↵

52

        }↵

54

        ↵

53

        ↵

55

        /**↵

54

        /**↵

56

         * Returns a hash code value for the object.↵

55

         * Returns a hash code value for the object.↵

57

         *↵

56

         *↵

58

         * @return The hashcode↵

57

         * @return The hashcode↵

59

         */↵

58

         */↵

60

        public int hashCode() {↵

59

        public int hashCode() {↵

61

            return this.name.hashCode();↵

60

            return this.name.hashCode();↵

62

        }↵

61

        }↵

63

        /**↵

62

        /**↵

64

         * Ensures that serialization returns the unique instances.↵

63

         * Ensures that serialization returns the unique instances.↵

65

         * ↵

64

         * ↵

66

         * @return The object.↵

65

         * @return The object.↵

67

         * ↵

66

         * ↵

68

         * @throws ObjectStreamException if there is a problem.↵

67

         * @throws ObjectStreamException if there is a problem.↵

69

         */↵

68

         */↵

70

        private Object readResolve() throws ObjectStreamException {↵

69

        private Object readResolve() throws ObjectStreamException {↵

71

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

70

            if (this.equals(RangeType.FULL)) {↵

72

                return LengthConstraintType.NONE;↵

71

                return RangeType.FULL;↵

73

            }↵

72

            }↵

74

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

73

            else if (this.equals(RangeType.POSITIVE)) {↵

75

                return LengthConstraintType.RANGE;↵

74

                return RangeType.POSITIVE;↵

76

            }↵

75

            }↵

77

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

76

            else if (this.equals(↵

78

                return LengthConstraintType.FIXED↵

77

    RangeType.NEGATIVE)) {↵

79

    ;↵

78

                return RangeType.NEGATIVE;↵

80

            }↵

79

            }↵

81

            return null;↵

80

            return null;↵

82

81

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