wilote01 / simple

Automatically exported from code.google.com/p/simple
0 stars 0 forks source link

Wrong separator used for JarEntry.getName() #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
On Windows platform (and probably always) JarEntry.getName() uses '/' as
separator, not File.separatorChar '\'. So, the following code fails when
trying to convert path to class name:

com.google.devtools.simple.compiler.RuntimeLoader:537:

while (jarEntries.hasMoreElements()) {
  JarEntry entry = jarEntries.nextElement();
  String name = entry.getName();
  if (name.endsWith(CLASSFILE_EXTENSION)) {
    analyzeClassFile(name.substring(0,
        name.length() -
CLASSFILE_EXTENSION.length()).replace(File.separatorChar, '.'));
  }
}

And Simple compiler doesn't work on Windows.

Original issue reported on code.google.com by demakov@gmail.com on 29 Jul 2009 at 6:38

GoogleCodeExporter commented 8 years ago
Fix submitted and binary download updated. Thanks for figuring this out!

Original comment by simpleco...@gmail.com on 29 Jul 2009 at 8:13