[FIXED] Compilation Error in Version 2.9.0 of org.lwjgl.LWJGLUtil.java

Started by mbmast, September 04, 2013, 22:53:09

Previous topic - Next topic

mbmast

The following code generates an unresolved variable error:

private static String getPathFromClassLoader(final String libname, final ClassLoader classloader) {
  try {
    log("getPathFromClassLoader: searching for: " + libname);
    Class<?> c = classloader.getClass();
    while (c != null) {
      final Class<?> clazz = c;
      try {
        return AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
          public String run() throws Exception {
            Method findLibrary = clazz.getDeclaredMethod("findLibrary", String.class);
	    findLibrary.setAccessible(true);
	    String path = (String)findLibrary.invoke(classloader, libname);
	    return path;
	  }
	});
      } catch (PrivilegedActionException e) {
        log("Failed to locate findLibrary method: " + e.getCause());
	c = c.getSuperclass();
      }
    }
  } catch (Exception e) {
    log("Failure locating " + e + " using classloader:" + c);
  }
  return null;
}


The variable c in the last catch block is undefined.  There is a variable c defined above, but it is scoped to the outer try block and not visible within the catch block.  Without changing the source code, this will never compile.  How does code that cannot compile get into a release distribution?

kappa

doh, wrongly assumed a tiny tweak patch like that submitted on github could be merged safely, anyway fixed, sorry for the inconvenience.

thx.