Created
October 20, 2017 07:44
-
-
Save protogenes/93a5d76075b45ba5a946034820f03c76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data.class class [B | |
data [0, 1, 2, 3, 4, 5, 6, 7] | |
java data [[0], [1], [2], [3], [4], [5], [6], [7]] | |
Exception in thread "main" Assertion failed: | |
assert TestJava.call(data) == 1 | |
| | | | |
8 | false | |
[0, 1, 2, 3, 4, 5, 6, 7] | |
at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:404) | |
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:650) | |
at TestGroovy.main(TestGroovy.groovy:9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.transform.CompileStatic | |
@CompileStatic | |
class TestGroovy { | |
static void main(String... args) { | |
byte[] data = [0, 1, 2, 3, 4, 5, 6, 7] | |
System.out.println("data.class " + data.class) | |
System.out.println("data " + data) | |
assert TestJava.call(data) == 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class TestJava { | |
public static int call(byte[]... data) { | |
System.out.println("java data " + Arrays.deepToString(data)); | |
return data.length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment