jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1675) Provide names for constants in QueryConstants
Date Wed, 09 Jul 2008 16:13:31 GMT

    [ https://issues.apache.org/jira/browse/JCR-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612169#action_12612169
] 

Thomas Mueller commented on JCR-1675:
-------------------------------------

I saw that QueryConstants uses a rather tricky way to define constants
int OPERATION_NE_VALUE = OPERATION_EQ_GENERAL + 1;
This is really hard for debugging because you can't easily map a number to a constant.
Is this what you mean? If yes I suggest to assign explicit values, as in:
int OPERATION_EQ_VALUE = 11;
int OPERATION_EQ_GENERAL = 12;
...
An alternative would be to use the 'enum pattern' (using singleton objects rather than int
constants) but that's more tricky in JDK 1.4 as 'enum' is not supported.

By the way, the main advantage of int constants (the ability to use switch / case) is never
used in the code - if else if else everywhere.

> Provide names for constants in QueryConstants
> ---------------------------------------------
>
>                 Key: JCR-1675
>                 URL: https://issues.apache.org/jira/browse/JCR-1675
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-spi-commons
>            Reporter: Michael Dürig
>            Priority: Minor
>
> For debugging, logging, and user interaction purposes QueryConstants should include descriptive
names for the constants it provides.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message