Community
Participate
Working Groups
In Java 9+ generic type arguments for anonymous types are finally redundant. Yes! But there should be an exception to be configured in Eclipse to ignore exactly this to avoid warnings when code needs to be compatible with Java 1.8 and 9+. Example: ############################### MyClass<String> c = new MyClass<String>() {}; ############################### The second <String> is necessary in Java 1.7/1.8, and redundant in 9+, which it really is.
Don't we have the "Redundant type arguments ..." option for this?
(In reply to Jay Arthanareeswaran from comment #1) > Don't we have the "Redundant type arguments ..." option for this? I guess that Marvin doesn't want to ignore all such warnings, only those that are newly raised at 9+. OTOH, fiddling with the special case of anonymous diamond seems like scratching at the surface. If code should really be compatible with different versions, the only reliable strategy will be to perform two builds, one at each compliance level. Ah, and then this warning should perhaps be considered only at the lower compliance level. Am I missing something?
(In reply to Stephan Herrmann from comment #2) > (In reply to Jay Arthanareeswaran from comment #1) > > Don't we have the "Redundant type arguments ..." option for this? > > I guess that Marvin doesn't want to ignore all such warnings, only those > that are newly raised at 9+. Exactly. > OTOH, fiddling with the special case of anonymous diamond seems like > scratching at the surface. If code should really be compatible with > different versions, the only reliable strategy will be to perform two > builds, one at each compliance level. Ah, and then this warning should > perhaps be considered only at the lower compliance level. Am I missing > something? I agree, this might be of low priority. Still this can be of some importance. I don't know, if it is too exotic to have a workspace, where some projects are already ported to Java 9+ and some can't (yet). In this case I have to live with some exceptions for a time.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.