diff --git a/README.md b/README.md index 9b6df64a..7c89c36a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ this fork is not recommended. You can try `ant all` or `ant jar-jme`, but there is no guarantee that it will even compile (though that may be fixed in a future version). +The `TODO` file can contain information about some known issues. This fork aims to fix some issues met with luaj 3.0.2, still present in [luaj/luaj](https://github.com/luaj/luaj) at diff --git a/TODO b/TODO new file mode 100644 index 00000000..d8ed0e6f --- /dev/null +++ b/TODO @@ -0,0 +1,20 @@ +The current version doesn't compile with: +ant jar-jme|all + +The Java compiler complains with an obscure error: + [javac] /Users/ducos/Projects/luaj/build/jme/src/org/luaj/vm2/LuaValue.java:532: error: cannot access StringBuilder + [javac] public String tojstring() { return typename() + ": " + Integer.toHexString(hashCode()); } + +This is because, in recent versions of Java, the concatenation of strings is automatically performed +with java.lang.StringBuilder + +Unfortunately, this class is not available in the JME environment. + +A workaround would be to replaced the + concatenation with the String.concat() method, like this: + +- public String tojstring() { return typename() + ": " + Integer.toHexString(hashCode()); } ++ public String tojstring() { return typename().concat(": ").concat(Integer.toHexString(hashCode())); } + +But it has to be done everywhere in the code. + +Maybe there is a more straightforward method, with a compiler's flag.