You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2013/01/18 15:09:55 UTC

svn commit: r1435146 - in /lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound: HyphenationCompoundWordTokenFilter.java hyphenation/HyphenationTree.java hyphenation/PatternParser.java

Author: uschindler
Date: Fri Jan 18 14:09:55 2013
New Revision: 1435146

URL: http://svn.apache.org/viewvc?rev=1435146&view=rev
Log:
LUCENE-4570: Fix deprecated API usage (otherwise may lead to bugs if Hyphenation filters load files from directories with non-ascii path names)

Modified:
    lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/HyphenationCompoundWordTokenFilter.java
    lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java
    lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java

Modified: lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/HyphenationCompoundWordTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/HyphenationCompoundWordTokenFilter.java?rev=1435146&r1=1435145&r2=1435146&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/HyphenationCompoundWordTokenFilter.java (original)
+++ lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/HyphenationCompoundWordTokenFilter.java Fri Jan 18 14:09:55 2013
@@ -148,7 +148,7 @@ public class HyphenationCompoundWordToke
    */
   public static HyphenationTree getHyphenationTree(File hyphenationFile)
       throws IOException {
-    return getHyphenationTree(new InputSource(hyphenationFile.toURL().toExternalForm()));
+    return getHyphenationTree(new InputSource(hyphenationFile.toURI().toASCIIString()));
   }
 
   /**

Modified: lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java?rev=1435146&r1=1435145&r2=1435146&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java (original)
+++ lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java Fri Jan 18 14:09:55 2013
@@ -111,7 +111,7 @@ public class HyphenationTree extends Ter
    * @throws IOException In case the parsing fails
    */
   public void loadPatterns(File f) throws IOException {
-    InputSource src = new InputSource(f.toURL().toExternalForm());
+    InputSource src = new InputSource(f.toURI().toASCIIString());
     loadPatterns(src);
   }
 

Modified: lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java?rev=1435146&r1=1435145&r2=1435146&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java (original)
+++ lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java Fri Jan 18 14:09:55 2013
@@ -98,7 +98,7 @@ public class PatternParser extends Defau
    * @throws IOException In case of an exception while parsing
    */
   public void parse(File file) throws IOException {
-    InputSource src = new InputSource(file.toURL().toExternalForm());
+    InputSource src = new InputSource(file.toURI().toASCIIString());
     parse(src);
   }