JDK-7012406 : JSR 292: target typing cast and parenthesis
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: unknown
  • Submitted: 2011-01-14
  • Updated: 2011-01-14
  • Resolved: 2011-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Relates :  
Description
One potential bug:  The switch statement in Infer.java mentions tags TYPECAST and EXEC.

It should probably mention PARENS also, if only to assert that env. expressions of that sort don't appear.  Otherwise we could get confusion some day about the meaning of this code:

	String s = (String)( mh.invokeExact() );

It should be the same as this code:

	String s = (String) mh.invokeExact();

But the switch statement might make it act like this:

	String s = (Object)( mh.invokeExact() );

Comments
EVALUATION We should skip parenthesis when inferring target type in polymorphic signature calls.
14-01-2011