Is it an eclipse or maven-compiler-plugin bug, the generics Class cast issue?

后端 未结 3 682
执念已碎
执念已碎 2020-12-12 00:18

I have a code like this:

protected  T doSomething(String someParam, Class clazz) {
...
}

which I use in a TestCase class:

3条回答
  •  生来不讨喜
    2020-12-12 01:13

    This is a known bug in Eclipse: 333011: [compiler][1.5] Eclipse compiles codes which javac rejects: incompatible types . Feel free to vote for the bug and add your use case to it.


    There are situations when javac and Eclipse disagree, and you should report them as bugs. It is preferred to have a standalone test case of as few Java files as possible which can be copy/pasted in Eclipse and compiled using javac from the command line without any dependencies.

提交回复
热议问题