Git Product home page Git Product logo

j-j-jvm's Issues

Clone fails with java.lang.IllegalAccessException

Hi, nice work with your interpreter! I was having problems with some code that clones an array so I added something to your test like this:

--- a/jdwp/java/src/test/java/com/igormaznitsa/jjjvm/JJJVMInterpreterTest.java
+++ b/jdwp/java/src/test/java/com/igormaznitsa/jjjvm/JJJVMInterpreterTest.java
@@ -2583,6 +2583,7 @@ public class JJJVMInterpreterTest extends TestHelper implements JSEProviderImpl.
                                 + " int index = 0;"
                                 + " for(int x=0; x<array.length; x++){"
                                 + "  int [] fill = array[x];"
+                                + "  int [] bill = (int [])fill.clone();"
                                 + "  for(int y=0; y< fill.length; y++){"
                                 + "    fill[y] = index++;"
                                 + "  }"

but that causes failures:

10:02:11.986 [main] ERROR com.igormaznitsa.jjjvm.JJJVMInterpreter - caught
java.lang.IllegalAccessException: Class com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl can not access a member of class java.lang.Object with modifiers "protected native"
	at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) ~[?:1.8.0-internal]
	at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296) ~[?:1.8.0-internal]
	at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288) ~[?:1.8.0-internal]
	at java.lang.reflect.Method.invoke(Method.java:491) ~[?:1.8.0-internal]
	at com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl.invoke(JSEProviderImpl.java:217) ~[classes/:?]
	at com.igormaznitsa.jjjvm.JJJVMInterpreter._invoke(JJJVMInterpreter.java:1516) [classes/:?]
	at com.igormaznitsa.jjjvm.JJJVMInterpreter.invoke(JJJVMInterpreter.java:81) [classes/:?]
	at com.igormaznitsa.jjjvm.utils.TestHelper.executeTestMethod(TestHelper.java:188) [test-classes/:?]
	at com.igormaznitsa.jjjvm.JJJVMInterpreterTest.testIntegration_FillMultidimensionalArray_Int(JJJVMInterpreterTest.java:2594) [test-classes/:?]

and

testIntegration_FillMultidimensionalArray_Int(com.igormaznitsa.jjjvm.JJJVMInterpreterTest)  Time elapsed: 0.905 sec  <<< ERROR!
java.lang.IllegalAccessException: Class com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl can not access a member of class java.lang.Object with modifiers "protected native"
	at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
	at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
	at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
	at java.lang.reflect.Method.invoke(Method.java:491)
	at com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl.invoke(JSEProviderImpl.java:217)
	at com.igormaznitsa.jjjvm.JJJVMInterpreter._invoke(JJJVMInterpreter.java:1516)
	at com.igormaznitsa.jjjvm.JJJVMInterpreter.invoke(JJJVMInterpreter.java:81)
	at com.igormaznitsa.jjjvm.utils.TestHelper.executeTestMethod(TestHelper.java:188)
	at com.igormaznitsa.jjjvm.JJJVMInterpreterTest.testIntegration_FillMultidimensionalArray_Int(JJJVMInterpreterTest.java:2594)

How easy do you think that is to fix?

Iterable does not work

Hi,
Excellent project. Unfortunately, following code fails on the cycle:

List<String> list = Collections.EMPTY_LIST;
for (String element: list) {
}

Output:
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer

at com.igormaznitsa.jjjvm.JJJVMInterpreter._invoke(JJJVMInterpreter.java:1063)
at com.igormaznitsa.jjjvm.JJJVMInterpreter.invoke(JJJVMInterpreter.java:77)
at com.igormaznitsa.jjjvm.impl.JJJVMClassMethodImpl.invoke(JJJVMClassMethodImpl.java:111)

iterable.zip

Could you please have a look?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.