From 70cb74b4d65851ef69240d35b58d9f8d20a73ed1 Mon Sep 17 00:00:00 2001 From: "Benjamin P. Jung" Date: Thu, 27 Aug 2015 15:50:46 +0200 Subject: [PATCH 1/7] Migrate CVS project to Git --- .cvsignore => .gitignore | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename .cvsignore => .gitignore (65%) diff --git a/.cvsignore b/.gitignore similarity index 65% rename from .cvsignore rename to .gitignore index 908e4e3e..d7642856 100644 --- a/.cvsignore +++ b/.gitignore @@ -1,8 +1,8 @@ -bin -target -build -lib -jit +bin/ +target/ +build/ +lib/ +jit/ *.ser *.gz *.jar -- 2.49.1 From 4d4a040a6bb7704682b24cac51dde75d072b4e13 Mon Sep 17 00:00:00 2001 From: "Benjamin P. Jung" Date: Fri, 26 Jan 2018 22:44:04 +0100 Subject: [PATCH 2/7] Rename README.html to README.md and add notice. To make sure that everyone knows immediately how this repository happend to be created, I felt that it might be a good idea to add a short notice about the project's heritage. --- README.html => README.md | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) rename README.html => README.md (98%) diff --git a/README.html b/README.md similarity index 98% rename from README.html rename to README.md index cd0f790a..f289746f 100644 --- a/README.html +++ b/README.md @@ -1,21 +1,18 @@ - - +# This is a fork! +
+This repository has been forked from the original CVS sources of Luaj. +The commit history has been converted to make sure that the original work of +James Roseborough and Ian Farmer is not lost. +Unfortunately, I was not able to contact either James or Ian to hand over +ownership of the Github organization/repo as I have originally intended to. +The community however seems interested enough to continue work on the original +sources and therefore I have decided to make sure that any useful pull requests +that may add some value to the original code base shall be merged in from now +on.
+-- Benjamin P. Jung, Jan. 26th 2018 +
- -Getting Started with LuaJ - - - - - - -
-

- - -Getting Started with LuaJ - -

+

Getting Started with LuaJ

James Roseborough, Ian Farmer, Version 3.0.1

-- 2.49.1 From 3b71b31c363793626cfbde38de311769041c43cf Mon Sep 17 00:00:00 2001 From: Enyby Date: Mon, 2 Jul 2018 01:54:24 +0300 Subject: [PATCH 3/7] Fix for proper print OP_SETLIST additional opcode #7 --- src/core/org/luaj/vm2/Print.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/org/luaj/vm2/Print.java b/src/core/org/luaj/vm2/Print.java index 5c8b55dd..3c9c570b 100644 --- a/src/core/org/luaj/vm2/Print.java +++ b/src/core/org/luaj/vm2/Print.java @@ -152,7 +152,7 @@ public class Print extends Lua { int[] code = f.code; int pc, n = code.length; for (pc = 0; pc < n; pc++) { - printOpCode(f, pc); + pc = printOpCode(f, pc); ps.println(); } } @@ -161,9 +161,10 @@ public class Print extends Lua { * Print an opcode in a prototype * @param f the {@link Prototype} * @param pc the program counter to look up and print + * @return pc same as above or changed */ - public static void printOpCode(Prototype f, int pc) { - printOpCode(ps,f,pc); + public static int printOpCode(Prototype f, int pc) { + return printOpCode(ps,f,pc); } /** @@ -171,8 +172,9 @@ public class Print extends Lua { * @param ps the {@link PrintStream} to print to * @param f the {@link Prototype} * @param pc the program counter to look up and print + * @return pc same as above or changed */ - public static void printOpCode(PrintStream ps, Prototype f, int pc) { + public static int printOpCode(PrintStream ps, Prototype f, int pc) { int[] code = f.code; int i = code[pc]; int o = GET_OPCODE(i); @@ -282,7 +284,7 @@ public class Print extends Lua { break; case OP_SETLIST: if (c == 0) - ps.print(" ; " + ((int) code[++pc])); + ps.print(" ; " + ((int) code[++pc]) + " (stored in the next OP)"); else ps.print(" ; " + ((int) c)); break; @@ -292,6 +294,7 @@ public class Print extends Lua { default: break; } + return pc; } private static int getline(Prototype f, int pc) { -- 2.49.1 From ca0b5acb18fbbab23d7b82c17dedf3f50b821ca4 Mon Sep 17 00:00:00 2001 From: Enyby Date: Mon, 2 Jul 2018 04:29:52 +0300 Subject: [PATCH 4/7] Print any code Print any code even if it is obfuscated with not valid op codes and other garbage. Also it can print any custom modification of byte code instead of fall with Exception. --- src/core/org/luaj/vm2/Print.java | 208 +++++++++++++++++-------------- 1 file changed, 116 insertions(+), 92 deletions(-) diff --git a/src/core/org/luaj/vm2/Print.java b/src/core/org/luaj/vm2/Print.java index 3c9c570b..8b0bd572 100644 --- a/src/core/org/luaj/vm2/Print.java +++ b/src/core/org/luaj/vm2/Print.java @@ -128,6 +128,10 @@ public class Print extends Lua { } static void printValue( PrintStream ps, LuaValue v ) { + if (v == null) { + ps.print("null"); + return; + } switch ( v.type() ) { case LuaValue.TSTRING: printString( ps, (LuaString) v ); break; default: ps.print( v.tojstring() ); @@ -136,7 +140,7 @@ public class Print extends Lua { } static void printConstant(PrintStream ps, Prototype f, int i) { - printValue( ps, f.k[i] ); + printValue( ps, i < f.k.length ? f.k[i] : LuaValue.valueOf("UNKNOWN_CONST_" + i) ); } static void printUpvalue(PrintStream ps, Upvaldesc u) { @@ -189,80 +193,67 @@ public class Print extends Lua { ps.print("[" + line + "] "); else ps.print("[-] "); - ps.print(OPNAMES[o] + " "); - switch (getOpMode(o)) { - case iABC: - ps.print( a ); - if (getBMode(o) != OpArgN) - ps.print(" "+(ISK(b) ? (-1 - INDEXK(b)) : b)); - if (getCMode(o) != OpArgN) - ps.print(" "+(ISK(c) ? (-1 - INDEXK(c)) : c)); - break; - case iABx: - if (getBMode(o) == OpArgK) { - ps.print(a + " " + (-1 - bx)); - } else { - ps.print(a + " " + (bx)); + if (o >= OPNAMES.length - 1) { + ps.print("UNKNOWN_OP_" + o + " "); + } else { + ps.print(OPNAMES[o] + " "); + switch (getOpMode(o)) { + case iABC: + ps.print( a ); + if (getBMode(o) != OpArgN) + ps.print(" "+(ISK(b) ? (-1 - INDEXK(b)) : b)); + if (getCMode(o) != OpArgN) + ps.print(" "+(ISK(c) ? (-1 - INDEXK(c)) : c)); + break; + case iABx: + if (getBMode(o) == OpArgK) { + ps.print(a + " " + (-1 - bx)); + } else { + ps.print(a + " " + (bx)); + } + break; + case iAsBx: + if (o == OP_JMP) + ps.print( sbx ); + else + ps.print(a + " " + sbx); + break; } - break; - case iAsBx: - if (o == OP_JMP) - ps.print( sbx ); - else - ps.print(a + " " + sbx); - break; - } - switch (o) { - case OP_LOADK: - ps.print(" ; "); - printConstant(ps, f, bx); - break; - case OP_GETUPVAL: - case OP_SETUPVAL: - ps.print(" ; "); - printUpvalue(ps, f.upvalues[b]); - break; - case OP_GETTABUP: - ps.print(" ; "); - printUpvalue(ps, f.upvalues[b]); - ps.print(" "); - if (ISK(c)) - printConstant(ps, f, INDEXK(c)); - else - ps.print("-"); - break; - case OP_SETTABUP: - ps.print(" ; "); - printUpvalue(ps, f.upvalues[a]); - ps.print(" "); - if (ISK(b)) - printConstant(ps, f, INDEXK(b)); - else - ps.print("-"); - ps.print(" "); - if (ISK(c)) - printConstant(ps, f, INDEXK(c)); - else - ps.print("-"); - break; - case OP_GETTABLE: - case OP_SELF: - if (ISK(c)) { + switch (o) { + case OP_LOADK: ps.print(" ; "); - printConstant(ps, f, INDEXK(c)); - } - break; - case OP_SETTABLE: - case OP_ADD: - case OP_SUB: - case OP_MUL: - case OP_DIV: - case OP_POW: - case OP_EQ: - case OP_LT: - case OP_LE: - if (ISK(b) || ISK(c)) { + printConstant(ps, f, bx); + break; + case OP_GETUPVAL: + case OP_SETUPVAL: ps.print(" ; "); + if (b < f.upvalues.length) { + printUpvalue(ps, f.upvalues[b]); + } else { + ps.print("UNKNOWN_UPVALUE_" + b); + } + break; + case OP_GETTABUP: + ps.print(" ; "); + if (b < f.upvalues.length) { + printUpvalue(ps, f.upvalues[b]); + } else { + ps.print("UNKNOWN_UPVALUE_" + b); + } + ps.print(" "); + if (ISK(c)) + printConstant(ps, f, INDEXK(c)); + else + ps.print("-"); + break; + case OP_SETTABUP: + ps.print(" ; "); + if (a < f.upvalues.length) { + printUpvalue(ps, f.upvalues[a]); + } else { + ps.print("UNKNOWN_UPVALUE_" + a); + } + ps.print(" "); if (ISK(b)) printConstant(ps, f, INDEXK(b)); else @@ -272,27 +263,60 @@ public class Print extends Lua { printConstant(ps, f, INDEXK(c)); else ps.print("-"); + break; + case OP_GETTABLE: + case OP_SELF: + if (ISK(c)) { + ps.print(" ; "); + printConstant(ps, f, INDEXK(c)); + } + break; + case OP_SETTABLE: + case OP_ADD: + case OP_SUB: + case OP_MUL: + case OP_DIV: + case OP_POW: + case OP_EQ: + case OP_LT: + case OP_LE: + if (ISK(b) || ISK(c)) { + ps.print(" ; "); + if (ISK(b)) + printConstant(ps, f, INDEXK(b)); + else + ps.print("-"); + ps.print(" "); + if (ISK(c)) + printConstant(ps, f, INDEXK(c)); + else + ps.print("-"); + } + break; + case OP_JMP: + case OP_FORLOOP: + case OP_FORPREP: + ps.print(" ; to " + (sbx + pc + 2)); + break; + case OP_CLOSURE: + if (bx < f.p.length) { + ps.print(" ; " + f.p[bx].getClass().getName()); + } else { + ps.print(" ; UNKNOWN_PROTYPE_" + bx); + } + break; + case OP_SETLIST: + if (c == 0) + ps.print(" ; " + ((int) code[++pc]) + " (stored in the next OP)"); + else + ps.print(" ; " + ((int) c)); + break; + case OP_VARARG: + ps.print( " ; is_vararg="+ f.is_vararg ); + break; + default: + break; } - break; - case OP_JMP: - case OP_FORLOOP: - case OP_FORPREP: - ps.print(" ; to " + (sbx + pc + 2)); - break; - case OP_CLOSURE: - ps.print(" ; " + f.p[bx].getClass().getName()); - break; - case OP_SETLIST: - if (c == 0) - ps.print(" ; " + ((int) code[++pc]) + " (stored in the next OP)"); - else - ps.print(" ; " + ((int) c)); - break; - case OP_VARARG: - ps.print( " ; is_vararg="+ f.is_vararg ); - break; - default: - break; } return pc; } -- 2.49.1 From 828e4be019a60ff19e2ec5a6554c5524b8042867 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Thu, 13 Sep 2018 11:53:00 +0200 Subject: [PATCH 5/7] Fix JsePlatform.luaMain() to provide an "arg" table in the chunk's environment. --- README.html | 42 ++++++++++--------- src/core/org/luaj/vm2/LuaClosure.java | 7 +++- src/jse/org/luaj/vm2/lib/jse/JsePlatform.java | 10 +++-- test/junit/org/luaj/vm2/AllTests.java | 2 + .../org/luaj/vm2/lib/jse/JsePlatformTest.java | 21 ++++++++++ version.properties | 2 +- 6 files changed, 59 insertions(+), 25 deletions(-) create mode 100644 test/junit/org/luaj/vm2/lib/jse/JsePlatformTest.java diff --git a/README.html b/README.html index cd0f790a..f8b9a896 100644 --- a/README.html +++ b/README.html @@ -16,7 +16,7 @@ Getting Started with LuaJ -James Roseborough, Ian Farmer, Version 3.0.1 +James Roseborough, Ian Farmer, Version 3.0.2

Copyright © 2009-2014 Luaj.org. @@ -120,7 +120,7 @@ in comparison with the standard C distribution. 16.794 11.274 Java - java -cp luaj-jse-3.0.1.jar;bcel-5.2.jar lua -b fannkuch.lua 10 + java -cp luaj-jse-3.0.2.jar;bcel-5.2.jar lua -b fannkuch.lua 10 @@ -130,7 +130,7 @@ in comparison with the standard C distribution. 36.894 15.163 - java -cp luaj-jse-3.0.1.jar lua -n fannkuch.lua 10 + java -cp luaj-jse-3.0.2.jar lua -n fannkuch.lua 10 lua 5.1.4 @@ -186,7 +186,7 @@ It is also faster than Java-lua implementations Jill, Kahlua, and Mochalua for a From the main distribution directory line type:

-	java -cp lib/luaj-jse-3.0.1.jar lua examples/lua/hello.lua
+	java -cp lib/luaj-jse-3.0.2.jar lua examples/lua/hello.lua
 

@@ -198,7 +198,7 @@ You should see the following output: To see how luaj can be used to acccess most Java API's including swing, try:

-	java -cp lib/luaj-jse-3.0.1.jar lua examples/lua/swingapp.lua
+	java -cp lib/luaj-jse-3.0.2.jar lua examples/lua/swingapp.lua
 

@@ -213,8 +213,8 @@ Links to sources:

 From the main distribution directory line type:
 
 
-	java -cp lib/luaj-jse-3.0.1.jar luac examples/lua/hello.lua
-	java -cp lib/luaj-jse-3.0.1.jar lua luac.out
+	java -cp lib/luaj-jse-3.0.2.jar luac examples/lua/hello.lua
+	java -cp lib/luaj-jse-3.0.2.jar lua luac.out
 

@@ -228,8 +228,8 @@ Luaj can compile lua sources or binaries directly to java bytecode if the bcel l

 	ant bcel-lib
-	java -cp "lib/luaj-jse-3.0.1.jar;lib/bcel-5.2.jar" luajc -s examples/lua -d . hello.lua
-	java -cp "lib/luaj-jse-3.0.1.jar;." lua -l hello
+	java -cp "lib/luaj-jse-3.0.2.jar;lib/bcel-5.2.jar" luajc -s examples/lua -d . hello.lua
+	java -cp "lib/luaj-jse-3.0.2.jar;." lua -l hello
 

@@ -240,7 +240,7 @@ but the compiled classes must be in the class path at runtime, unless runtime ji

Lua scripts can also be run directly in this mode without precompiling using the lua command with the -b option and providing the bcel library in the class path:

-	java -cp "lib/luaj-jse-3.0.1.jar;lib/bcel-5.2.jar" lua -b examples/lua/hello.lua
+	java -cp "lib/luaj-jse-3.0.2.jar;lib/bcel-5.2.jar" lua -b examples/lua/hello.lua
 
@@ -284,7 +284,7 @@ A simple example may be found in

-You must include the library lib/luaj-jse-3.0.1.jar in your class path. +You must include the library lib/luaj-jse-3.0.2.jar in your class path.

Run a script in a MIDlet

@@ -311,7 +311,7 @@ A simple example may be found in

-You must include the library lib/luaj-jme-3.0.1.jar in your midlet jar. +You must include the library lib/luaj-jme-3.0.2.jar in your midlet jar.

An ant script to build and run the midlet is in @@ -341,7 +341,7 @@ You can also look up the engine by language "lua" or mimetypes "text/lua" or "ap All standard aspects of script engines including compiled statements are supported.

-You must include the library lib/luaj-jse-3.0.1.jar in your class path. +You must include the library lib/luaj-jse-3.0.2.jar in your class path.

A working example may be found in @@ -352,8 +352,8 @@ A working example may be found in To compile and run it using Java 1.6 or higher:

-	javac -cp lib/luaj-jse-3.0.1.jar examples/jse/ScriptEngineSample.java
-	java -cp "lib/luaj-jse-3.0.1.jar;examples/jse" ScriptEngineSample
+	javac -cp lib/luaj-jse-3.0.2.jar examples/jse/ScriptEngineSample.java
+	java -cp "lib/luaj-jse-3.0.2.jar;examples/jse" ScriptEngineSample
 

Excluding the lua bytecode compiler

@@ -593,7 +593,7 @@ The following lua script will open a swing frame on Java SE: See a longer sample in examples/lua/swingapp.lua for details, including a simple animation loop, rendering graphics, mouse and key handling, and image loading. Or try running it using:
-	java -cp lib/luaj-jse-3.0.1.jar lua examples/lua/swingapp.lua
+	java -cp lib/luaj-jse-3.0.2.jar lua examples/lua/swingapp.lua
 

@@ -842,7 +842,7 @@ For JSE projects, add this dependency for the luaj-jse jar: <dependency> <groupId>org.luaj</groupId> <artifactId>luaj-jse</artifactId> - <version>3.0.1</version> + <version>3.0.2</version> </dependency> while for JME projects, use the luaj-jme jar: @@ -850,7 +850,7 @@ while for JME projects, use the luaj-jme jar: <dependency> <groupId>org.luaj</groupId> <artifactId>luaj-jme</artifactId> - <version>3.0.1</version> + <version>3.0.2</version> </dependency> @@ -880,7 +880,7 @@ Unit test scripts can be found in these locations test/lua/*.lua test/lua/errors/*.lua test/lua/perf/*.lua - test/lua/luaj3.0.1-tests.zip + test/lua/luaj3.0.2-tests.zip

Code coverage

@@ -1017,6 +1017,10 @@ and at http://luaj.sour
  • Move online docs to http://luaj.org/luaj/3.0/api/
  • Fix os.time() conversions for pm times.
  • +  3.0.2
      +
    • Fix JsePlatform.luaMain() to provide an "arg" table in the chunk's environment.
    • +
    • Let JsePlatform.luaMain() return values returned by the main chunk.
    • +
    diff --git a/src/core/org/luaj/vm2/LuaClosure.java b/src/core/org/luaj/vm2/LuaClosure.java index 4d176b5d..9f766924 100644 --- a/src/core/org/luaj/vm2/LuaClosure.java +++ b/src/core/org/luaj/vm2/LuaClosure.java @@ -97,14 +97,19 @@ public class LuaClosure extends LuaFunction { */ public LuaClosure(Prototype p, LuaValue env) { this.p = p; + this.initupvalue1(env); + globals = env instanceof Globals? (Globals) env: null; + } + + public void initupvalue1(LuaValue env) { if (p.upvalues == null || p.upvalues.length == 0) this.upValues = NOUPVALUES; else { this.upValues = new UpValue[p.upvalues.length]; this.upValues[0] = new UpValue(new LuaValue[] {env}, 0); } - globals = env instanceof Globals? (Globals) env: null; } + public boolean isclosure() { return true; diff --git a/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java b/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java index 196ea8ba..e3ad8477 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java +++ b/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java @@ -25,6 +25,7 @@ import org.luaj.vm2.Globals; import org.luaj.vm2.LoadState; import org.luaj.vm2.LuaThread; import org.luaj.vm2.LuaValue; +import org.luaj.vm2.Varargs; import org.luaj.vm2.compiler.LuaC; import org.luaj.vm2.lib.Bit32Lib; import org.luaj.vm2.lib.CoroutineLib; @@ -124,10 +125,11 @@ public class JsePlatform { /** Simple wrapper for invoking a lua function with command line arguments. - * The supplied function is first given a new Globals object, - * then the program is run with arguments. + * The supplied function is first given a new Globals object as its environment + * then the program is run with arguments. + * @return {@link Varargs} containing any values returned by mainChunk. */ - public static void luaMain(LuaValue mainChunk, String[] args) { + public static Varargs luaMain(LuaValue mainChunk, String[] args) { Globals g = standardGlobals(); int n = args.length; LuaValue[] vargs = new LuaValue[args.length]; @@ -137,6 +139,6 @@ public class JsePlatform { arg.set("n", n); g.set("arg", arg); mainChunk.initupvalue1(g); - mainChunk.invoke(LuaValue.varargsOf(vargs)); + return mainChunk.invoke(LuaValue.varargsOf(vargs)); } } diff --git a/test/junit/org/luaj/vm2/AllTests.java b/test/junit/org/luaj/vm2/AllTests.java index f7f60dd7..0062371f 100644 --- a/test/junit/org/luaj/vm2/AllTests.java +++ b/test/junit/org/luaj/vm2/AllTests.java @@ -32,6 +32,7 @@ import org.luaj.vm2.compiler.DumpLoadEndianIntTest; import org.luaj.vm2.compiler.LuaParserTests; import org.luaj.vm2.compiler.RegressionTests; import org.luaj.vm2.compiler.SimpleTests; +import org.luaj.vm2.lib.jse.JsePlatformTest; import org.luaj.vm2.lib.jse.LuaJavaCoercionTest; import org.luaj.vm2.lib.jse.LuajavaAccessibleMembersTest; import org.luaj.vm2.lib.jse.LuajavaClassMembersTest; @@ -85,6 +86,7 @@ public class AllTests { // library tests TestSuite lib = new TestSuite("Library Tests"); + lib.addTestSuite(JsePlatformTest.class); lib.addTestSuite(LuajavaAccessibleMembersTest.class); lib.addTestSuite(LuajavaClassMembersTest.class); lib.addTestSuite(LuaJavaCoercionTest.class); diff --git a/test/junit/org/luaj/vm2/lib/jse/JsePlatformTest.java b/test/junit/org/luaj/vm2/lib/jse/JsePlatformTest.java new file mode 100644 index 00000000..80f3e773 --- /dev/null +++ b/test/junit/org/luaj/vm2/lib/jse/JsePlatformTest.java @@ -0,0 +1,21 @@ +package org.luaj.vm2.lib.jse; + +import junit.framework.TestCase; + +import org.luaj.vm2.Globals; +import org.luaj.vm2.LuaValue; +import org.luaj.vm2.Varargs; + + +public class JsePlatformTest extends TestCase { + public void testLuaMainPassesArguments() { + Globals globals = JsePlatform.standardGlobals(); + LuaValue chunk = globals.load("return #arg, arg.n, arg[2], arg[1]"); + Varargs results = JsePlatform.luaMain(chunk, new String[] { "aaa", "bbb" }); + assertEquals(results.narg(), 4); + assertEquals(results.arg(1), LuaValue.valueOf(2)); + assertEquals(results.arg(2), LuaValue.valueOf(2)); + assertEquals(results.arg(3), LuaValue.valueOf("bbb")); + assertEquals(results.arg(4), LuaValue.valueOf("aaa")); + } +} diff --git a/version.properties b/version.properties index 0138b12c..fa48e2d2 100644 --- a/version.properties +++ b/version.properties @@ -1 +1 @@ -version: 3.0.1 \ No newline at end of file +version: 3.0.2 \ No newline at end of file -- 2.49.1 From 194b7763174dcdce0764bbaa99be20984dd654d3 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Thu, 13 Sep 2018 11:53:24 +0200 Subject: [PATCH 6/7] Add synchronization to CoerceJavaToLua.COERCIONS map. --- README.html | 1 + src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.html b/README.html index f8b9a896..15503b3d 100644 --- a/README.html +++ b/README.html @@ -1020,6 +1020,7 @@ and at http://luaj.sour   3.0.2
    • Fix JsePlatform.luaMain() to provide an "arg" table in the chunk's environment.
    • Let JsePlatform.luaMain() return values returned by the main chunk.
    • +
    • Add synchronization to CoerceJavaToLua.COERCIONS map.
    diff --git a/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java b/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java index 36c5d824..177f9acf 100644 --- a/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java +++ b/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java @@ -21,6 +21,7 @@ ******************************************************************************/ package org.luaj.vm2.lib.jse; +import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -133,7 +134,7 @@ public class CoerceJavaToLua { } - static final Map COERCIONS = new HashMap(); + static final Map COERCIONS = Collections.synchronizedMap(new HashMap()); static { Coercion boolCoercion = new BoolCoercion() ; -- 2.49.1 From 3d22990e3c1cd4911d9ad569ee6a9e0417b49f87 Mon Sep 17 00:00:00 2001 From: "Benjamin P. Jung" Date: Thu, 13 Sep 2018 11:56:02 +0200 Subject: [PATCH 7/7] Migrate CVS project to Git * Delete .svnignore and move stuff to .gitignore * Add note to README to show that this is an inofficial fork as of now. * Change file suffix of README file from .html to .md for better Github integration and readability --- .cvsignore => .gitignore | 10 +++++----- README.html | 30 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 20 deletions(-) rename .cvsignore => .gitignore (65%) diff --git a/.cvsignore b/.gitignore similarity index 65% rename from .cvsignore rename to .gitignore index 908e4e3e..d7642856 100644 --- a/.cvsignore +++ b/.gitignore @@ -1,8 +1,8 @@ -bin -target -build -lib -jit +bin/ +target/ +build/ +lib/ +jit/ *.ser *.gz *.jar diff --git a/README.html b/README.html index 15503b3d..c3caa4c1 100644 --- a/README.html +++ b/README.html @@ -1,21 +1,21 @@ - - +# This is a fork! +
    +This repository has been forked from the original CVS sources of Luaj. +The commit history has been converted to make sure that the original work of +James Roseborough and Ian Farmer is not lost. +Unfortunately, I was not able to contact either James or Ian to hand over +ownership of the Github organization/repo as I have originally intended to. +The community however seems interested enough to continue work on the original +sources and therefore I have decided to make sure that any useful pull requests +that may add some value to the original code base shall be merged in from now +on.
    +-- Benjamin P. Jung, Jan. 26th 2018 +
    - -Getting Started with LuaJ - - - +

    Getting Started with LuaJ

    - -
    -

    - - -Getting Started with LuaJ - -

    +

    Getting Started with LuaJ

    James Roseborough, Ian Farmer, Version 3.0.2

    -- 2.49.1