Results 1 to 2 of 2

Thread: Giving Warning

  1. #1
    tanmoy.b81 is offline Member
    Join Date
    Jul 2008
    Rep Power

    Default Giving Warning


    I am writing an application where I have written a line of code which is giving warning. I am using JDK1.5.
    Code snippet is given below:-
    Java Code:
    FormFile ff = (FormFile)cf.getClass().getMethod("getFile"+i+(i!=0 ? ""+i : "),null).invoke(cf,null);
    And the warning is:-
    warning: non-varargs call of varargs method with inexact argument type for last parameter;

    Please help me out.
    Thanks in advance..........................

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power


    Casting the null to the required type might get rid of the warning.

    On an unrelated note, your code is so full of chained method calls as to be almost impossible to read. Breaking it into separate lines doesn't cost money, and often makes problems easier to diagnose.


Similar Threads

  1. WARNING NetBeans HTTP Monitor
    By bbq in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 09-19-2008, 06:02 PM
  2. Java Security Warning
    By Neil in forum New To Java
    Replies: 3
    Last Post: 09-01-2008, 04:15 PM
  3. Giving Change: A Rudimentary Program (Questions)
    By carlodelmundo in forum New To Java
    Replies: 8
    Last Post: 08-13-2008, 11:33 PM
  4. Status of tomcat is not giving "true"
    By keshari in forum Web Frameworks
    Replies: 1
    Last Post: 05-16-2008, 06:31 AM
  5. warning: page has expired
    By Peter in forum Web Frameworks
    Replies: 2
    Last Post: 07-04-2007, 07:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts