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.
Fix import hint is not provided for static method if the expression is used at the right side of assignment. Steps to reproduce: 1) have a code: valueOf(12); -> hint is provided, suggesting several java.lang.String.valueOf(...) methods 2) change to code to String valueOf = valueOf(12); -> no hint is provided It must be some name conflict since for String x = valueOf(12); it works fine Product Version: NetBeans Dev JDK9 branch (Build 201506120405) Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev-jdk9-branch Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev-jdk9-branch
JDK9 specific, works OK (CC offers many valueOfs for case (2)) in trunk.
My bad, I've made a typo when testing, so I wasn't testing `valueOf' variable. Sorry. The code contained check for same-named elements in the current scope; however, for a method call, it also considered same-named field as a conflict - but fields, methods and classes have different namespaces. I relaxed the check a little. Fixed in jet-main#b4b1cc6ba717
Integrated into 'main-silver', will be available in build *201509300002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/b4b1cc6ba717 User: Svata Dedic <sdedic@netbeans.org> Log: #252953: allowed to import methods if field of same name is in scope. Fixed defect when using FQN for a method (whole signature was inserted, not just FQN)