You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Simon Willnauer (JIRA)" <ji...@apache.org> on 2009/06/12 13:36:08 UTC

[jira] Created: (LUCENE-1686) Remove Unnecessary NULL check in FindSegmentsFile - cleanup

Remove Unnecessary NULL check in FindSegmentsFile - cleanup
-----------------------------------------------------------

                 Key: LUCENE-1686
                 URL: https://issues.apache.org/jira/browse/LUCENE-1686
             Project: Lucene - Java
          Issue Type: Improvement
            Reporter: Simon Willnauer
             Fix For: 2.9, 3.0
         Attachments: segments_info.patch

FindSegmentsFile accesses the member "directory" in line 579 while performing a null check in 592. The null check is unnecessary as if directory is null line 579 would throw a NPE.
I removed the null check and made the member "directory" final. In addition I added a null check in the constructor as If the value is null we should catch it asap. 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1686) Remove Unnecessary NULL check in FindSegmentsFile - cleanup

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

Simon Willnauer updated LUCENE-1686:
------------------------------------

    Priority: Trivial  (was: Major)

> Remove Unnecessary NULL check in FindSegmentsFile - cleanup
> -----------------------------------------------------------
>
>                 Key: LUCENE-1686
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1686
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Simon Willnauer
>            Priority: Trivial
>             Fix For: 2.9, 3.0
>
>         Attachments: segments_info.patch
>
>
> FindSegmentsFile accesses the member "directory" in line 579 while performing a null check in 592. The null check is unnecessary as if directory is null line 579 would throw a NPE.
> I removed the null check and made the member "directory" final. In addition I added a null check in the constructor as If the value is null we should catch it asap. 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Closed: (LUCENE-1686) Remove Unnecessary NULL check in FindSegmentsFile - cleanup

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

Uwe Schindler closed LUCENE-1686.
---------------------------------

    Resolution: Fixed

Comitted revision 784094.

This was my fault, because I refactored the class and missed to remove this unnecessary check. Before there was also support for java.io.File instead of o.a.l.store.Directory in this class for which this null-check was.
I removed the initial null check in the ctor, as it is not necessary (this class is internal only and never called with NULL directory).

> Remove Unnecessary NULL check in FindSegmentsFile - cleanup
> -----------------------------------------------------------
>
>                 Key: LUCENE-1686
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1686
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Simon Willnauer
>            Assignee: Uwe Schindler
>            Priority: Trivial
>             Fix For: 2.9, 3.0
>
>         Attachments: segments_info.patch
>
>
> FindSegmentsFile accesses the member "directory" in line 579 while performing a null check in 592. The null check is unnecessary as if directory is null line 579 would throw a NPE.
> I removed the null check and made the member "directory" final. In addition I added a null check in the constructor as If the value is null we should catch it asap. 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1686) Remove Unnecessary NULL check in FindSegmentsFile - cleanup

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

Simon Willnauer updated LUCENE-1686:
------------------------------------

    Attachment: segments_info.patch

> Remove Unnecessary NULL check in FindSegmentsFile - cleanup
> -----------------------------------------------------------
>
>                 Key: LUCENE-1686
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1686
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Simon Willnauer
>            Priority: Trivial
>             Fix For: 2.9, 3.0
>
>         Attachments: segments_info.patch
>
>
> FindSegmentsFile accesses the member "directory" in line 579 while performing a null check in 592. The null check is unnecessary as if directory is null line 579 would throw a NPE.
> I removed the null check and made the member "directory" final. In addition I added a null check in the constructor as If the value is null we should catch it asap. 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Assigned: (LUCENE-1686) Remove Unnecessary NULL check in FindSegmentsFile - cleanup

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

Uwe Schindler reassigned LUCENE-1686:
-------------------------------------

    Assignee: Uwe Schindler

Thanks, I was working on this class some days ago, I will apply this!

Thanks!

> Remove Unnecessary NULL check in FindSegmentsFile - cleanup
> -----------------------------------------------------------
>
>                 Key: LUCENE-1686
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1686
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Simon Willnauer
>            Assignee: Uwe Schindler
>            Priority: Trivial
>             Fix For: 2.9, 3.0
>
>         Attachments: segments_info.patch
>
>
> FindSegmentsFile accesses the member "directory" in line 579 while performing a null check in 592. The null check is unnecessary as if directory is null line 579 would throw a NPE.
> I removed the null check and made the member "directory" final. In addition I added a null check in the constructor as If the value is null we should catch it asap. 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org