I wonder about this commit, I started an issue for that:
https://issues.apache.org/jira/browse/LUCENE-1672
I will merge the changes and attach a new patch there. There are more
deprecations needed (methods that use these now deprecated methods under the
hood, e.g. in IndexSearcher).
Uwe
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: mikemccand@apache.org [mailto:mikemccand@apache.org]
> Sent: Wednesday, June 03, 2009 12:39 PM
> To: java-commits@lucene.apache.org
> Subject: svn commit: r781333 - in
> /lucene/java/trunk/src/java/org/apache/lucene: index/IndexReader.java
> index/IndexWriter.java store/RAMDirectory.java
>
> Author: mikemccand
> Date: Wed Jun 3 10:38:57 2009
> New Revision: 781333
>
> URL: http://svn.apache.org/viewvc?rev=781333&view=rev
> Log:
> LUCENE-1451: deprecate methods that use FSDirectory.getDirectory under-
> the-hood
>
> Modified:
> lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
> lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
> lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java
>
> Modified:
> lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
> URL:
> http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/
> index/IndexReader.java?rev=781333&r1=781332&r2=781333&view=diff
> ==========================================================================
> ====
> --- lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
> (original)
> +++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
> Wed Jun 3 10:38:57 2009
> @@ -204,7 +204,7 @@
> * path.
> * @throws CorruptIndexException if the index is corrupt
> * @throws IOException if there is a low-level IO error
> - * @deprecated Use {@link #open(String, boolean)} instead
> + * @deprecated Use {@link #open(Directory, boolean)} instead
> * @param path the path to the index directory */
> public static IndexReader open(String path) throws
> CorruptIndexException, IOException {
> return open(FSDirectory.getDirectory(path), true, null, null, false);
> @@ -219,7 +219,8 @@
> * @throws IOException if there is a low-level IO error
> * @param path the path to the index directory
> * @param readOnly true if this should be a readOnly
> - * reader */
> + * reader
> + * @deprecated Use {@link #open(Directory, boolean)} instead*/
> public static IndexReader open(String path, boolean readOnly) throws
> CorruptIndexException, IOException {
> return open(FSDirectory.getDirectory(path), true, null, null,
> readOnly);
> }
> @@ -229,7 +230,7 @@
> * @param path the path to the index directory
> * @throws CorruptIndexException if the index is corrupt
> * @throws IOException if there is a low-level IO error
> - * @deprecated Use {@link #open(File, boolean)} instead
> + * @deprecated Use {@link #open(Directory, boolean)} instead
> */
> public static IndexReader open(File path) throws CorruptIndexException,
> IOException {
> return open(FSDirectory.getDirectory(path), true, null, null, false);
> @@ -244,7 +245,9 @@
> * @throws IOException if there is a low-level IO error
> * @param path the path to the index directory
> * @param readOnly true if this should be a readOnly
> - * reader */
> + * reader
> + * @deprecated Use {@link #open(Directory, boolean)}
> + * instead */
> public static IndexReader open(File path, boolean readOnly) throws
> CorruptIndexException, IOException {
> return open(FSDirectory.getDirectory(path), true, null, null,
> readOnly);
> }
> @@ -555,6 +558,7 @@
> * @return version number.
> * @throws CorruptIndexException if the index is corrupt
> * @throws IOException if there is a low-level IO error
> + * @deprecated Use {@link #getCurrentVersion(Directory)} instead
> */
> public static long getCurrentVersion(File directory) throws
> CorruptIndexException, IOException {
> Directory dir = FSDirectory.getDirectory(directory);
> @@ -1167,7 +1171,7 @@
> * currently locked.
> * @param directory the directory to check for a lock
> * @throws IOException if there is a low-level IO error
> - * @deprecated Please use {@link IndexWriter#isLocked(String)} instead
> + * @deprecated Please use {@link IndexWriter#isLocked(Directory)}
> instead
> */
> public static boolean isLocked(String directory) throws IOException {
> Directory dir = FSDirectory.getDirectory(directory);
>
> Modified:
> lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
> URL:
> http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/
> index/IndexWriter.java?rev=781333&r1=781332&r2=781333&view=diff
> ==========================================================================
> ====
> --- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
> (original)
> +++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
> Wed Jun 3 10:38:57 2009
> @@ -837,6 +837,8 @@
> * if it does not exist and <code>create</code> is
> * <code>false</code> or if there is any other low-level
> * IO error
> + * @deprecated Use {@link #IndexWriter(Directory, Analyzer,
> + * boolean, MaxFieldLength)}
> */
> public IndexWriter(String path, Analyzer a, boolean create,
> MaxFieldLength mfl)
> throws CorruptIndexException, LockObtainFailedException,
> IOException {
> @@ -864,7 +866,7 @@
> * IO error
> * @deprecated This constructor will be removed in the 3.0 release.
> * Use {@link
> - * #IndexWriter(String,Analyzer,boolean,MaxFieldLength)}
> + * #IndexWriter(Directory,Analyzer,boolean,MaxFieldLength)}
> * instead, and call {@link #commit()} when needed.
> */
> public IndexWriter(String path, Analyzer a, boolean create)
> @@ -897,6 +899,8 @@
> * if it does not exist and <code>create</code> is
> * <code>false</code> or if there is any other low-level
> * IO error
> + * @deprecated Use {@link #IndexWriter(Directory,
> + * Analyzer, boolean, MaxFieldLength)}
> */
> public IndexWriter(File path, Analyzer a, boolean create,
> MaxFieldLength mfl)
> throws CorruptIndexException, LockObtainFailedException,
> IOException {
> @@ -924,7 +928,7 @@
> * IO error
> * @deprecated This constructor will be removed in the 3.0 release.
> * Use {@link
> - * #IndexWriter(File,Analyzer,boolean,MaxFieldLength)}
> + * #IndexWriter(Directory,Analyzer,boolean,MaxFieldLength)}
> * instead, and call {@link #commit()} when needed.
> */
> public IndexWriter(File path, Analyzer a, boolean create)
> @@ -1012,6 +1016,7 @@
> * @throws IOException if the directory cannot be
> * read/written to or if there is any other low-level
> * IO error
> + * @deprecated Use {@link #IndexWriter(Directory, Analyzer,
> MaxFieldLength)}
> */
> public IndexWriter(String path, Analyzer a, MaxFieldLength mfl)
> throws CorruptIndexException, LockObtainFailedException, IOException
> {
> @@ -1035,7 +1040,7 @@
> * IO error
> * @deprecated This constructor will be removed in the 3.0
> * release, and call {@link #commit()} when needed.
> - * Use {@link #IndexWriter(String,Analyzer,MaxFieldLength)} instead.
> + * Use {@link #IndexWriter(Directory,Analyzer,MaxFieldLength)}
> instead.
> */
> public IndexWriter(String path, Analyzer a)
> throws CorruptIndexException, LockObtainFailedException, IOException
> {
> @@ -1063,6 +1068,8 @@
> * @throws IOException if the directory cannot be
> * read/written to or if there is any other low-level
> * IO error
> + * @deprecated Use {@link #IndexWriter(Directory,
> + * Analyzer, MaxFieldLength)}
> */
> public IndexWriter(File path, Analyzer a, MaxFieldLength mfl)
> throws CorruptIndexException, LockObtainFailedException, IOException
> {
> @@ -1085,7 +1092,7 @@
> * read/written to or if there is any other low-level
> * IO error
> * @deprecated This constructor will be removed in the 3.0 release.
> - * Use {@link #IndexWriter(File,Analyzer,MaxFieldLength)}
> + * Use {@link #IndexWriter(Directory,Analyzer,MaxFieldLength)}
> * instead, and call {@link #commit()} when needed.
> */
> public IndexWriter(File path, Analyzer a)
> @@ -5367,6 +5374,7 @@
> * currently locked.
> * @param directory the directory to check for a lock
> * @throws IOException if there is a low-level IO error
> + * @deprecated Use {@link #isLocked(Directory)}
> */
> public static boolean isLocked(String directory) throws IOException {
> Directory dir = FSDirectory.getDirectory(directory);
>
> Modified:
> lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java
> URL:
> http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/
> store/RAMDirectory.java?rev=781333&r1=781332&r2=781333&view=diff
> ==========================================================================
> ====
> --- lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java
> (original)
> +++ lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java
> Wed Jun 3 10:38:57 2009
> @@ -79,6 +79,7 @@
> * @param dir a <code>File</code> specifying the index directory
> *
> * @see #RAMDirectory(Directory)
> + * @deprecated Use {@link #RAMDirectory(Directory)} instead
> */
> public RAMDirectory(File dir) throws IOException {
> this(FSDirectory.getDirectory(dir), true);
> @@ -90,6 +91,7 @@
> * @param dir a <code>String</code> specifying the full index directory
> path
> *
> * @see #RAMDirectory(Directory)
> + * @deprecated Use {@link #RAMDirectory(Directory)} instead
> */
> public RAMDirectory(String dir) throws IOException {
> this(FSDirectory.getDirectory(dir), true);
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
|