This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Applying "redundant type arguments in new expression (use diamond operator instead)" hint leads to compiler error | ||
---|---|---|---|
Product: | java | Reporter: | _ gtzabari <gtzabari> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dbalek, jlahoda |
Priority: | P2 | ||
Version: | 8.1 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
_ gtzabari
2014-10-24 03:13:52 UTC
Any update on this issue ? Clearly this is a problem and it's priority needs to be bumped up for analysis. Thanks In the current dev version, the issue is even more peculiar: the internal compiler (derived from JDK9 compiler) correctly infers the type arguments, while _commandline_ compiler (incl. Ant build) The internal compiler is more permissive even though the project is set up to build with JDK8. Lahvaci please advise if there's a way how could I detect the situation and raise a warning for the user. Svata, Are you sure that Lahvaci is CCed on this issue? (Doesn't look like it, judging by the CC list) I've suppressed the hint in jet-main#a4c89f2af4df However the opposite (diamond operator in the source, which would lead to compile error) is not and will probably never be fixed. Reason: The compiler in earlier JDKs use different implementation for diamond inference, that is difficult to recreate in nbjavac library (which is based on JDK9 with better capabilities). I was not able to reliably / effectively and *precisely* identify the bad cases. The fix mentioned above is rough in the sense it may suppress some valid hints - and the algorithm cannot be used to generate errors since it could introduce false positives. Sorry. Integrated into 'main-silver', will be available in build *201611110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/a4c89f2af4df User: Svata Dedic <sdedic@netbeans.org> Log: #248162: suppressed hint for JDK < 9, if using diamond operator might lead to compile error |