You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2008/07/09 17:23:32 UTC

[jira] Created: (JCR-1675) Provide names for constants in QueryConstants

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.


[jira] Updated: (JCR-1675) Provide names for constants in QueryConstants

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig updated JCR-1675:
-------------------------------

    Attachment: JCR-1675_QueryConstants.patch

Suggested patch

> 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
>         Attachments: JCR-1675_QueryConstants.patch
>
>
> 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.


[jira] Commented: (JCR-1675) Provide names for constants in QueryConstants

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Resolved: (JCR-1675) Provide names for constants in QueryConstants

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-1675.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5

Applied patch in revision: 677231

Thank you for providing the patch.

> 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
>             Fix For: 1.5
>
>         Attachments: JCR-1675_QueryConstants.patch
>
>
> 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.


[jira] Closed: (JCR-1675) Provide names for constants in QueryConstants

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig closed JCR-1675.
------------------------------


Thanks for fixing this

> 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
>             Fix For: 1.5
>
>         Attachments: JCR-1675_QueryConstants.patch
>
>
> 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.