Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

reflection: how to avoid warning while using invoke(obj, null)

843810Nov 5 2007 — edited Nov 8 2007
hi, i am having a problem in my code....
Class entity = obj.getClass();
Client client = (Client)entity.getMethod("getClient",null).invoke(obj, null);
and the warning i am facing is
 warning: non-varargs call of varargs method with inexact argument type for last parameter;
i couldnot get any solution for this problem... i also tried by removing 2nd parameter as

Class entity = obj.getClass();
Client client = (Client)entity.getMethod("getClient",null).invoke(obj, null);
the getClient is the method name that recieve no parameter and returns Client type Object

and the warning i am facing is
 warning: non-varargs call of varargs method with inexact argument type for last parameter;
but the warning is same.... i am using jdk 1.5,
i also tried it with jsk1.4 as well as jdk1.6 but no changes


any suggessions would be welcomed highly...

thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2007
Added on Nov 5 2007
5 comments
576 views