You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2014/12/21 20:41:13 UTC
[jira] [Created] (FC-52) Use enum instead of static int for errors
Emmanuel Lecharny created FC-52:
-----------------------------------
Summary: Use enum instead of static int for errors
Key: FC-52
URL: https://issues.apache.org/jira/browse/FC-52
Project: FORTRESS
Issue Type: Task
Affects Versions: 1.0.0-RC39
Reporter: Emmanuel Lecharny
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
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)