diff --git a/README.html b/README.html index 380e4793..dcfc9564 100644 --- a/README.html +++ b/README.html @@ -921,6 +921,8 @@ Files are no longer hosted at LuaForge.
* This contains all library functions listed as "basic functions" in the lua documentation for JME. * The functions dofile and loadfile use the - * {@link #FINDER} instance to find resource files. + * {@link #finder} instance to find resource files. * Since JME has no file system by default, {@link BaseLib} implements * {@link ResourceFinder} using {@link Class#getResource(String)}, * which is the closest equivalent on JME. @@ -69,7 +69,7 @@ import org.luaj.vm2.Varargs; * This is a direct port of the corresponding library in C. * @see JseBaseLib * @see ResourceFinder - * @see #FINDER + * @see #finder * @see LibFunction * @see JsePlatform * @see JmePlatform @@ -81,7 +81,7 @@ public class BaseLib extends TwoArgFunction implements ResourceFinder { public LuaValue call(LuaValue modname, LuaValue env) { globals = env.checkglobals(); - globals.FINDER = this; + globals.finder = this; globals.baselib = this; env.set( "_G", env ); env.set( "_VERSION", Lua._VERSION ); @@ -424,7 +424,7 @@ public class BaseLib extends TwoArgFunction implements ResourceFinder { * @return Varargs containing chunk, or NIL,error-text on error */ public Varargs loadFile(String filename, String mode, LuaValue env) { - InputStream is = globals.FINDER.findResource(filename); + InputStream is = globals.finder.findResource(filename); if ( is == null ) return varargsOf(NIL, valueOf("cannot open "+filename+": No such file or directory")); try { diff --git a/src/core/org/luaj/vm2/lib/PackageLib.java b/src/core/org/luaj/vm2/lib/PackageLib.java index 8a003dc5..c635ea23 100644 --- a/src/core/org/luaj/vm2/lib/PackageLib.java +++ b/src/core/org/luaj/vm2/lib/PackageLib.java @@ -299,7 +299,7 @@ public class PackageLib extends TwoArgFunction { } // try opening the file - InputStream is = globals.FINDER.findResource(filename); + InputStream is = globals.finder.findResource(filename); if (is != null) { try { is.close(); } catch ( java.io.IOException ioe ) {} return valueOf(filename); diff --git a/src/core/org/luaj/vm2/lib/ResourceFinder.java b/src/core/org/luaj/vm2/lib/ResourceFinder.java index 218fa8e4..4774a6db 100644 --- a/src/core/org/luaj/vm2/lib/ResourceFinder.java +++ b/src/core/org/luaj/vm2/lib/ResourceFinder.java @@ -31,13 +31,13 @@ import java.io.InputStream; * for both the Jme and Jse platforms. *
* The Jme version of base lib {@link BaseLib} - * implements {@link BaseLib#FINDER} via {@link Class#getResourceAsStream(String)}, + * implements {@link Globals#finder} via {@link Class#getResourceAsStream(String)}, * while the Jse version {@link JseBaseLib} implements it using {@link java.io.File#File(String)}. *
* The io library does not use this API for file manipulation. *
* @see BaseLib - * @see BaseLib#FINDER + * @see Globals#finder * @see JseBaseLib * @see JmePlatform * @see JsePlatform diff --git a/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java b/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java index d67150bb..1ff970ce 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java +++ b/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java @@ -33,11 +33,11 @@ import org.luaj.vm2.lib.ResourceFinder; /** * Subclass of {@link BaseLib} and {@link LibFunction} which implements the lua basic library functions - * and provides a directory based {@link ResourceFinder} as the {@link #FINDER}. + * and provides a directory based {@link ResourceFinder} as the {@link #finder}. *
* Since JME has no file system by default, {@link BaseLib} implements * {@link ResourceFinder} using {@link Class#getResource(String)}. - * The {@link JseBaseLib} implements {@link FINDER} by scanning the current directory + * The {@link JseBaseLib} implements {@link finder} by scanning the current directory * first, then falling back to {@link Class#getResource(String)} if that fails. * Otherwise, the behavior is the same as that of {@link BaseLib}. *
@@ -62,7 +62,7 @@ import org.luaj.vm2.lib.ResourceFinder; * @see Globals * @see BaseLib * @see ResourceFinder - * @see {@link Globals.FINDER} + * @see {@link Globals.finder} * @see LibFunction * @see JsePlatform * @see org.luaj.vm2.lib.jme.JmePlatform diff --git a/test/java/org/luaj/luajc/TestLuaJC.java b/test/java/org/luaj/luajc/TestLuaJC.java index 91be4a76..061d110f 100644 --- a/test/java/org/luaj/luajc/TestLuaJC.java +++ b/test/java/org/luaj/luajc/TestLuaJC.java @@ -35,7 +35,7 @@ import org.luaj.vm2.lib.jse.JsePlatform; import org.luaj.vm2.luajc.LuaJC; public class TestLuaJC { - // This file will be loaded using the FINDER as a resource, provided it is in the + // This file will be loaded using the finder as a resource, provided it is in the // build path. This allows the debugger to find the file when stepping into the function. public static String filename = "perf/nsieve.lua"; @@ -79,7 +79,7 @@ public class TestLuaJC { // create the chunk String destdir = "."; - InputStream is = globals.FINDER.findResource(filename); + InputStream is = globals.finder.findResource(filename); Hashtable t = LuaJC.instance.compileAll(is, filename, filename, globals, true); // write out the chunk diff --git a/test/junit/org/luaj/vm2/ScriptDrivenTest.java b/test/junit/org/luaj/vm2/ScriptDrivenTest.java index 10828595..98ec7d18 100644 --- a/test/junit/org/luaj/vm2/ScriptDrivenTest.java +++ b/test/junit/org/luaj/vm2/ScriptDrivenTest.java @@ -76,7 +76,7 @@ public class ScriptDrivenTest extends TestCase implements ResourceFinder { protected void setUp() throws Exception { super.setUp(); initGlobals(); - globals.FINDER = this; + globals.finder = this; } // ResourceFinder implementation.