-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
Hi,
With an object with the constructor type Myobject(Object ... params), with Java if you do new Myobject( null ) a null is passed to the constructor parameter and you have a null array and obviously without elements.
But with Bsh 3.0.0. latest version, with an object with the constructor type Myobject(Object ... params), if you do new Myobject( null ) a Myobject object is created with params type array of one element that is null.
Source:
package nova.test.bsh;
import bsh.EvalError;
import bsh.Interpreter;
public class TestBshArray {
public static void main(String[] args) {
TestBshArray tb = new TestBshArray();
tb.test();
}
public void test() {
Interpreter interpreter22 = new Interpreter();
Test test = new Test(null);
/*
* Output = null:null
*
*/
String str00 =
"import nova.test.bsh.Test;\n" +
"Test test = new Test(null);\n";
try {
interpreter22.eval( str00 );
}
catch (EvalError e2) {
e2.printStackTrace();
}
/*
* Output = [Ljava.lang.Object;@4cc0edeb:1
*
*/
}
}
public class Test {
Object[] objects;
public Test( Object ...objects ) {
this.objects = objects;
System.out.println( objects + ":" + (( objects != null )? objects.length : "null" ) );
}
}.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels