lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LUCENE-1248) Unncessary creation of object in org.apache.lucene.analysis.WordlistLoader.getWordSet()
Date Sun, 10 Mar 2013 13:33:13 GMT

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

Erick Erickson resolved LUCENE-1248.
------------------------------------

    Resolution: Won't Fix

SPRING_CLEANING_2013 We can reopen if necessary. 
                
> Unncessary creation of object in org.apache.lucene.analysis.WordlistLoader.getWordSet()
> ---------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1248
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1248
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/analysis
>    Affects Versions: 2.3.1, 2.3.2
>            Reporter: David Dillard
>            Priority: Trivial
>
> Here's the function:
>   public static HashSet getWordSet(File wordfile) throws IOException {
>     HashSet result = new HashSet();
>     FileReader reader = null;
>     try {
>       reader = new FileReader(wordfile);
>       result = getWordSet(reader);
>     }
>     finally {
>       if (reader != null)
>         reader.close();
>     }
>     return result;
>   }
> The creation of the new HashSet object in the declaration of "result" is unnecessary.
 Either "result" will be unconditionally set by the call to getWordSet() or an exception will
occur.
> This was detected by FindBugs.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message