This content has been marked as final.
Show 8 replies
-
1. Re: Bug in compiler with null
chiba Feb 27, 2004 10:11 AM (in response to bill.burke)I will check this.
-
2. Re: Bug in compiler with null
chiba Feb 28, 2004 9:35 AM (in response to bill.burke)I have just fixed this bug and commited
the source.
Thanks. -
3. Re: Bug in compiler with null
bill.burke Feb 29, 2004 12:21 AM (in response to bill.burke)what was the problem? Just curious.
Thanks -
4. Re: Bug in compiler with null
chiba Feb 29, 2004 9:37 AM (in response to bill.burke)The bug was in the code for comparing
argument types and parameter types.
If the parameter type(?) is null type, then
the code misinterpreted the descriptor of
the argument types. -
5. Re: Bug in compiler with null
bill.burke Mar 6, 2004 8:23 AM (in response to bill.burke)The bug is still there. I took out my typecasting and just pass in null and it fails to generate code.
-
6. Re: Bug in compiler with null
chiba Mar 7, 2004 7:58 AM (in response to bill.burke)Really? What is the signature of foo.someMethod?
-
7. Re: Bug in compiler with null
bill.burke Mar 7, 2004 10:52 AM (in response to bill.burke)public Object invokeNew(Object[] args, int idx) throws Throwable
-
8. Re: Bug in compiler with null
chiba Mar 9, 2004 10:40 AM (in response to bill.burke)The following test code works fine on my machine. :<
ClassPool pool = ClassPool.getDefault(null); CtClass cc = sloader.makeClass("test2.NullArgTest"); CtMethod m1 = CtNewMethod.make( "public Object foo(Object[] obj, int idx) throws Throwable {" + " return null; }", cc); cc.addMethod(m1); CtMethod m2 = CtNewMethod.make( "public void bar() { this.foo(null, 0); }", cc); cc.addMethod(m2); CtMethod m3 = CtNewMethod.make( "public void bar2() { this.foo((Object[])null, 0); }", cc); cc.addMethod(m3); cc.writeFile();