Results 1 to 8 of 8
  1. #1
    sneha343 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default incompatible types!!

    In my class, at the line

    for (String coveredTestCase : getCoveredQCTestCases()) {

    I am getting this error

    TestBase.java:122: error: incompatible types
    for (String coveredTestCase : getCoveredQCTestCases()) {

    required: String
    found: Object

    Please help me how to debug this error.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  3. #3
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    6

    Default Re: incompatible types!!

    Look at the method signature of getCoveredQCTestCases.The return value must be a Iterable<String> and not a Iterable<Object> !
    Or you have to change
    for (String coveredTestCase :
    into
    for (Object coveredTestCase :
    and mabye cast the coveredTestCase to a String

  4. #4
    sneha343 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default Re: incompatible types!!

    getCoveredTestCases() returns a list.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  6. #6
    sneha343 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default Re: incompatible types!!

    Yes.. It is solved.. Thanx a lot :)

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

Similar Threads

  1. incompatible types
    By effa in forum New To Java
    Replies: 16
    Last Post: 02-03-2011, 10:50 AM
  2. Incompatible types
    By bayan in forum New To Java
    Replies: 5
    Last Post: 11-04-2010, 09:43 AM
  3. incompatible types error
    By magic in forum New To Java
    Replies: 3
    Last Post: 06-02-2010, 05:58 PM
  4. Incompatible operand types int and double[][]
    By Haske2r in forum New To Java
    Replies: 2
    Last Post: 01-21-2010, 06:26 PM
  5. Incompatible types
    By coltragon in forum New To Java
    Replies: 5
    Last Post: 01-15-2010, 05:47 PM

Posting Permissions

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