Question

I remember to have read about a new feature of JDK7 (now also supported by the Netbeans editor, yet only in current trunk builds).

This tiny feature wouldn't produce a warning anymore when instanceof SomeClass<?> is written without the type variable.

  • How is this feature it called?

  • Do someone know any reference, where it is described?

  • Most important: are there other changes in JDK7 related to type variables?

Was it helpful?

Solution

I believe you are speaking of the Simplified Varargs Method Invocation proposal from Bob Lee. It was a coin proposal and is now included in JSR 334 for Java 7 (JSR 336).

The only other change I know of is the Improved Type Inference for Generic Instance Creation (diamond) change.

OTHER TIPS

The use of <> is called the "Improved Type Inference for Generic Instance Creation" or "diamond" pattern, and it is part of Project Coin.

Although your issue (instanceof SomeClass<>) sounds slightly different.

Maybe it is related to project coin and its improved type inference when dealing with generics, take a look here. It doesn't seem the exact feature thou, just something related.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top