lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dawid Weiss <dawid.we...@gmail.com>
Subject How to crash your jvm. :)
Date Wed, 04 Jul 2012 12:22:44 GMT
I've been working on randomizing file.encoding for forked tests
JVMs... the second local run revealed a bug in the standard library,
try (linux/ unix systems, Java 1.7):

java -Dfile.encoding=UTF-16 ...

where TestBlah is:

public class TestBlah {
  @Test
  public void testDummy() throws IOException {
    TimeZone.getDefault();
  }
}

The problem boils down to the unfortunate getBytes()....

    UnixFileSystem(UnixFileSystemProvider provider, String dir) {
        this.provider = provider;
        this.defaultDirectory = UnixPath.normalizeAndCheck(dir).getBytes();
        if (this.defaultDirectory[0] != '/') {
            throw new RuntimeException("default directory must be absolute");
        }

Dawid

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


Mime
View raw message