1067-1-2

int getTotalDigitsFacet(EDataType eDataType) { return getExtendedMetaData(eDataType).getTotalDigitsFacet(); } protected int basicGetTotalDigitsFacet(EDataType eDataType) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { String totalDigitsLiteral = eAnnotation.getDetails().get("totalDigits"); if (totalDigitsLiteral != null) { return Integer.parseInt(totalDigitsLiteral); } } return -1; } public void setTotalDigitsFacet(EDataType eDataType, int digits) { if (digits == -1) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("totalDigits"); } } else { EAnnotation eAnnotation = getAnnotation(eDataType, true); eAnnotation.getDetails().put("totalDigits", Integer.toString(digits)); } getExtendedMetaData(eDataType).setTotalDigitsFacet(digits); } public int getFractionDigitsFacet(EDataType eDataType) { return getExtendedMetaData(eDataType).getFractionDigitsFacet(); } protected int basicGetFractionDigitsFacet(EDataType eDataType) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { String fractionDigitsLiteral = eAnnotation.getDetails().get("fractionDigits"); if (fractionDigitsLiteral != null) { return Integer.parseInt(fractionDigitsLiteral); } } return -1; }
int getFractionDigitsFacet(EDataType eDataType) { return getExtendedMetaData(eDataType).getFractionDigitsFacet(); } protected int basicGetFractionDigitsFacet(EDataType eDataType) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { String fractionDigitsLiteral = eAnnotation.getDetails().get("fractionDigits"); if (fractionDigitsLiteral != null) { return Integer.parseInt(fractionDigitsLiteral); } } return -1; } public void setFractionDigitsFacet(EDataType eDataType, int digits) { if (digits == -1) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("fractionDigits"); } } else { EAnnotation eAnnotation = getAnnotation(eDataType, true); eAnnotation.getDetails().put("fractionDigits", Integer.toString(digits)); } getExtendedMetaData(eDataType).setFractionDigitsFacet(digits); } public int getLengthFacet(EDataType eDataType) { return getExtendedMetaData(eDataType).getLengthFacet(); } protected int basicGetLengthFacet(EDataType eDataType) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { String lengthLiteral = eAnnotation.getDetails().get("length"); if (lengthLiteral != null) { return Integer.parseInt(lengthLiteral); } } return -1; }

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    int getTotalDigitsFacet(EDataType eDataType)↵

1

    int getFractionDigitsFacet(EDataType eDataType)↵

2

      {↵

2

      {↵

3

        return getExtendedMetaData(eDataType).getTotalDigitsFacet();↵

3

        return getExtendedMetaData(eDataType).getFractionDigitsFacet();↵

4

      }↵

4

      }↵

5

      protected int basicGetTotalDigitsFacet(EDataType eDataType)↵

5

      protected int basicGetFractionDigitsFacet(EDataType eDataType)↵

6

      {↵

6

      {↵

7

        EAnnotation eAnnotation = getAnnotation(eDataType, false);↵

7

        EAnnotation eAnnotation = getAnnotation(eDataType, false);↵

8

        if (eAnnotation != null)↵

8

        if (eAnnotation != null)↵

9

        {↵

9

        {↵

10

          String totalDigitsLiteral = eAnnotation.getDetails().get("totalDigits");↵

10

          String fractionDigitsLiteral = eAnnotation.getDetails().get("fractionDigits");↵

11

          if (totalDigitsLiteral != null)↵

11

          if (fractionDigitsLiteral != null)↵

12

          {↵

12

          {↵

13

            return Integer.parseInt(totalDigitsLiteral);↵

13

            return Integer.parseInt(fractionDigitsLiteral);↵

14

          }↵

14

          }↵

15

        }↵

15

        }↵

16

        return -1;↵

16

        return -1;↵

17

      }↵

17

      }↵

18

      public void setTotalDigitsFacet(EDataType eDataType, int digits)↵

18

      public void setFractionDigitsFacet(EDataType eDataType, int digits)↵

19

      {↵

19

      {↵

20

        if (digits == -1)↵

20

        if (digits == -1)↵

21

        {↵

21

        {↵

22

          EAnnotation eAnnotation = getAnnotation(eDataType, false);↵

22

          EAnnotation eAnnotation = getAnnotation(eDataType, false);↵

23

          if (eAnnotation != null)↵

23

          if (eAnnotation != null)↵

24

          {↵

24

          {↵

25

            eAnnotation.getDetails().remove("totalDigits");↵

25

            eAnnotation.getDetails().remove("fractionDigits");↵

26

          }↵

26

          }↵

27

        }↵

27

        }↵

28

        else↵

28

        else↵

29

        {↵

29

        {↵

30

          EAnnotation eAnnotation = getAnnotation(eDataType, true);↵

30

          EAnnotation eAnnotation = getAnnotation(eDataType, true);↵

31

          eAnnotation.getDetails().put("totalDigits", Integer.toString(digits));↵

31

          eAnnotation.getDetails().put("fractionDigits", Integer.toString(digits));↵

32

        } ↵

32

        } ↵

33

        getExtendedMetaData(eDataType).setTotalDigitsFacet(digits);↵

33

        getExtendedMetaData(eDataType).setFractionDigitsFacet(digits);↵

34

      }↵

34

      }↵

35

      public int getFractionDigitsFacet(EDataType eDataType)↵

35

      public int getLengthFacet(EDataType eDataType)↵

36

      {↵

36

      {↵

37

        return getExtendedMetaData(eDataType).getFractionDigitsFacet();↵

37

        return getExtendedMetaData(eDataType).getLengthFacet();↵

38

      }↵

38

      }↵

39

      protected int basicGetFractionDigitsFacet(EDataType eDataType)↵

39

      protected int basicGetLengthFacet(EDataType eDataType)↵

40

      {↵

40

      {↵

41

        EAnnotation eAnnotation = getAnnotation(eDataType, false);↵

41

        EAnnotation eAnnotation = getAnnotation(eDataType, false);↵

42

        if (eAnnotation != null)↵

42

        if (eAnnotation != null)↵

43

        {↵

43

        {↵

44

          String fractionDigitsLiteral = eAnnotation.getDetails().get("fractionDigits");↵

44

          String lengthLiteral = eAnnotation.getDetails().get("↵

45

          if (fractionDigits↵

45

    length");↵

46

    Literal != null)↵

46

          if (lengthLiteral != null)↵

47

          {↵

47

          {↵

48

            return Integer.parseInt(fractionDigitsLiteral);↵

48

            return Integer.parseInt(lengthLiteral);↵

49

          }↵

49

          }↵

50

        }↵

50

        }↵

51

        return -1;↵

51

        return -1;↵

52

      }

52

      }

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