Community
Participate
Working Groups
I20030917 In the following example: package p; class A{ class Inner{ } } class B extends A.Inner{ B(){ new A().super(); } } Searching for the implicit constructor Inner using the string pattern "p.A.Inner.Inner()" will result in no match. How do we search for implicit constructors in this case.
Default constructors are not existing in source, thus you can neither find them in sources nor get access to these when navigating through the JavaModel. What kind of an element would you expect ? Since you cannot see it in the outliner anyway...
But you can reference them in source. So there should be a way to find all references of a default constructor even if it doesn't exist in source. IMO, the search result contains the enclosing element and the positions not the element itself, which is fine when searching for references.
References should work I agree, but declaration matches should not as they don't exist in the source.
Agree, that we can't expect to find declarations for default constructors.
Searching for ""p.A.Inner()" works.
See the spec on SearchEngine: * <li>search for case sensitive references to exact <code>Object()</code> constructor: * <code>createSearchPattern("java.lang.Object()", CONSTRUCTOR, REFERENCES, true);</code></li> Closing.
Thanks. Why is this inconsistent to methods: p.A.Inner.foo() is the pattern for method foo but p.A.Inner.Inner() isn't the pattern for default constructors.
Invoking a constructor doesn't require you to type new X.X() either...