You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2019/12/18 12:34:00 UTC

[jira] [Closed] (JCR-4171) Conditions that are always true.

     [ https://issues.apache.org/jira/browse/JCR-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke closed JCR-4171.
-------------------------------

> Conditions that are always true.
> --------------------------------
>
>                 Key: JCR-4171
>                 URL: https://issues.apache.org/jira/browse/JCR-4171
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: core
>            Reporter: JC
>            Priority: Trivial
>
> Hi
> In a recent Github mirror, I found conditions that are always true.
> Path: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
> {code:java}
>   92     /** storage model modifier: binary keys */
>   93     public static final int SM_BINARY_KEYS = 1;
>   94 
> ...
>  666     public int getStorageModel() {
>  667         return SM_BINARY_KEYS;
>  668     }
> ...
>  732     protected Object[] getKey(NodeId id) {
>  733         if (getStorageModel() == SM_BINARY_KEYS) {
>  734             return new Object[] { id.getRawBytes() };
>  735         } else {
>  736             return new Object[] {
>  737                     id.getMostSignificantBits(), id.getLeastSignificantBits     () };
>  738         }
> ...
> {code}
> The condition in Line 733 seems always return true. I've found similar lines in Line 754, 800, 852 and 1111. These are just trivial things but there are else blocks. As I thought the conditions should do something more rather than being always true, I'm reporting them just in case.
> Thanks!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)