lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-2353) Config incorrectly handles Windows absolute pathnames
Date Sat, 27 Mar 2010 22:04:27 GMT

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

Shai Erera updated LUCENE-2353:
-------------------------------

    Attachment: LUCENE-2353.patch

The fix is only relevant to get(String, String) and not to all other get(String, <type>)
variants.

Benchmark test passed but after I svn up (to include the latest parallel test thing) the test
just sits idle (after finishing), waiting for something. If I run the tests in eclipse they
pass. So I'm guessing it's a problem w/ my env. or build.xml?

I also tried 'ant clean test' from within benchmark, but it didn't help. I then tried 'ant
clean' from root, and 'ant test' from benchmark, but the test just keeps waiting on WriteLineDocTaskTest,
on this line:
    [junit] ------------> config properties:
    [junit] directory = RAMDirectory
    [junit] doc.maker = org.apache.lucene.benchmark.byTask.tasks.WriteLineDocTaskTest$JustDateDocMaker
    [junit] line.file.out = D:\dev\lucene\lucene-trunk\build\contrib\benchmark\test\W\one-line
    [junit] -------------------------------

I think this can go in (if it passes on someone else's machine, while I figure out what's
wrong in my env. separately.

> Config incorrectly handles Windows absolute pathnames
> -----------------------------------------------------
>
>                 Key: LUCENE-2353
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2353
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/benchmark
>            Reporter: Shai Erera
>             Fix For: 3.1
>
>         Attachments: LUCENE-2353.patch
>
>
> I have no idea how no one ran into this so far, but I tried to execute an .alg file which
used ReutersContentSource and referenced both docs.dir and work.dir as Windows absolute pathnames
(e.g. d:\something). Surprisingly, the run reported an error of missing content under benchmark\work\something.
> I've traced the problem back to Config, where get(String, String) includes the following
code:
> {code}
>     if (sval.indexOf(":") < 0) {
>       return sval;
>     }
>     // first time this prop is extracted by round
>     int k = sval.indexOf(":");
>     String colName = sval.substring(0, k);
>     sval = sval.substring(k + 1);
>     ...
> {code}
> It detects ":" in the value and so it thinks it's a per-round property, thus stripping
"d:" from the value ... fix is very simple:
> {code}
>     if (sval.indexOf(":") < 0) {
>       return sval;
>     } else if (sval.indexOf(":\\") >= 0) {
>       // this previously messed up absolute path names on Windows. Assuming
>       // there is no real value that starts with \\
>       return sval;
>     }
>     // first time this prop is extracted by round
>     int k = sval.indexOf(":");
>     String colName = sval.substring(0, k);
>     sval = sval.substring(k + 1);
> {code}
> I'll post a patch w/ the above fix + test shortly.

-- 
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


Mime
View raw message