From: <dn...@us...> - 2013-07-31 19:49:28
|
Revision: 10632 http://sourceforge.net/p/languagetool/code/10632 Author: dnaber Date: 2013-07-31 19:49:26 +0000 (Wed, 31 Jul 2013) Log Message: ----------- implement AutoCloseable Modified Paths: -------------- trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/index/Indexer.java trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaIndexHandler.java Modified: trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/index/Indexer.java =================================================================== --- trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/index/Indexer.java 2013-07-31 19:31:47 UTC (rev 10631) +++ trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/index/Indexer.java 2013-07-31 19:49:26 UTC (rev 10632) @@ -46,7 +46,7 @@ * * @author Tao Lin, Miaojuan Dai */ -public class Indexer { +public class Indexer implements AutoCloseable { private static final Version LUCENE_VERSION = Version.LUCENE_41; @@ -165,6 +165,7 @@ writer.addDocument(doc); } + @Override public void close() throws IOException { writer.close(); } Modified: trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaIndexHandler.java =================================================================== --- trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaIndexHandler.java 2013-07-31 19:31:47 UTC (rev 10631) +++ trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaIndexHandler.java 2013-07-31 19:49:26 UTC (rev 10632) @@ -42,7 +42,7 @@ * * @author Tao Lin */ -public class WikipediaIndexHandler extends DefaultHandler { +public class WikipediaIndexHandler extends DefaultHandler implements AutoCloseable { public static final String MAX_DOC_COUNT_VALUE = "maxDocCountValue"; public static final String MAX_DOC_COUNT_FIELD = "maxDocCount"; @@ -130,6 +130,7 @@ } } + @Override public void close() throws Exception { indexer.close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |