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.
Product Version: NetBeans IDE Dev (Build 201211150001) Java: 1.7.0_09; Java HotSpot(TM) 64-Bit Server VM 23.5-b02 Runtime: Java(TM) SE Runtime Environment 1.7.0_09-b05 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev 1. Create an empty class that extends Jersey's WebResource. 2. Netbeans flags the following compiler error: no suitable constructor found for WebResource() constructor WebResource.WebResource(WebResource,UriBuilder) is not applicable (actual and formal argument lists differ in length) constructor WebResource.WebResource(ClientHandler,CopyOnWriteHashMap<String,Object>,URI) is not applicable (actual and formal argument lists differ in length) ---- (Alt-Enter shows hints) 3. I hit ALT+Enter but the only hint I am given is "create subclass" Expected behavior: Provide a hint to create the required constructor(s).
I'm not sure whether this is a bug or enhancement. Please judge for yourself.
Ah! It turns out this use-case has a twist. com.sun.jersey.api.client.WebResource only has two constructors. One is private. The other is package-private. In other words, users aren't meant to subclass it. So the expected behavior changes to: 1. Netbeans shouldn't provide a hint to create a subclass. 2. Improve error message to indicate a subclass cannot be created at all from the current package (or all at for some classes). The current message encourages the user to fix the constructor, which isn't actually possible.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss
Issue still exists in dev build 201607060002. Here is a simple testcase: ----- package parent; public class Parent { private Parent() { } Parent(String value) { } } ------ package child; import parent.Parent; public class Child extends Parent { } ------
I created a Pull Request to address the first part of Comment #2: https://github.com/apache/incubator-netbeans/pull/292 For the second part, this error message comes from javac. I agree with you that the error message is misleading, so I posted to the OpenJDK compiler-dev mailing list: http://mail.openjdk.java.net/pipermail/compiler-dev/2017-November/011352.html