I am trying to set up an IntelliJ workspace for development in an eclipse project. One of the things I came across is rather confusing:
Error:(24, 8) java: SomeClass.java:24: getHeader(java.lang.String) in org.springframework.mock.web.MockHttpServletResponse cannot implement getHeader(java.lang.String) in javax.servlet.http.HttpServletResponse; attempting to use incompatible return type
found : java.lang.Object
required: java.lang.String
The problem is the following class definition:
public class SomeClass extends MockHttpServletResponse {
The problem is that MockHttpServletResponse implements Collection<String> getHeaders(String)both public List getHeaders(String name). Here I see that the implementation method uses raw List, where the parent requests the generic Collectiontyped with String. Except that it is potentially unsafe for types, why did IntelliJ flag this as a compatibility error instead of a warning?
I have no way to modify any of these libraries. I'm just trying to get the job done in IntellJ 14, which already works without complaints in Eclipse 4.3+.
EDIT:
IntelliJ 15.0, Java 1.7 1.6. IntelliJ, Eclipse. , Ant IntelliJ, IDE.
public class ExecutableServletResponse extends MockHttpServletResponse {
...
, "":
Error:(24, 8) java: getHeader(java.lang.String) in org.springframework.mock.web.MockHttpServletResponse cannot implement getHeader(java.lang.String) in javax.servlet.http.HttpServletResponse
return type java.lang.Object is not compatible with java.lang.String
SDK 1.7 (, 1.7.0_79). - 7. SDK .
eclipse, , , , webapp .
, FWIW:
