Uploaded image for project: 'FORTRESS'
  1. FORTRESS
  2. FC-52

Use enum instead of static int for errors

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0.0-RC39
    • None
    • None

    Description

      We have a few classes that are used to store the error we use in Fortress :

      • GlobalErrIds
      • EErrIds
      • GlobalPwMsgIds

      Those classes declare errors ID using public static final int. The idea is to use enum as a replacement.

      Technically, it's a no brainer, except that a few oddities have to be handled :

      • first, we should decide if we should keep the numbering. With enum, it's not mandatory, as it's done automatically.
      • If so, we should decide if the Exception should take a number of an instance of one of the enum. It would be good to be able to use the enums, but we have to check that some of the exeption aren't receiving ID fro one of the existing class.
      • If there are some collisions, then either we define an interface tha every enum should implement, but we will have to be sure that the ID number - if we define them explicitely - aren't colliding.
      • Serialization must be handled to. It should not be a real issue though.

      All in all, it's a 2 hours work once we have decided the path we should follow regarding those few points

      Attachments

        Activity

          People

            Unassigned Unassigned
            elecharny Emmanuel Lécharny
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: