File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

incompatible types

 
sneha krishna
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does getCoveredQCTestCases() return?
 
Aj Maven
Greenhorn
Posts: 22
Eclipse IDE Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Method getCoveredQCTestCases() seems to return an object. Check its return type first. Anyways you can convert the object to string by calling toString(). But know what the method is returning first.
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not Object but something that's an Iterable<Object>, Iterable<?> or Iterable (raw type). That Iterable could be a Collection, List, Set, etc. My guess is that the method does not use generics yet.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic