-
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.
-
Re: incompatible types!!
What does the method getCoveredQCTestCases() return?
-
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 :^):
-
Re: incompatible types!!
getCoveredTestCases() returns a list.
-
Re: incompatible types!!
Have it return a List<String>, not just a List.
-
Re: incompatible types!!
Yes.. It is solved.. Thanx a lot :)
-
Re: incompatible types!!