Community
Participate
Working Groups
20071203 It would be good to clarify what IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE exactly means, maybe in DOM AST terms. Is it class instance creations and array creations? So maybe using the word 'creations' would be better to use?
Here's the new proposal: /** * Return only type references used in class instance creation. * <p> * When this flag is set, only {@link TypeReferenceMatch} matches will be * returned. *</p><p> * Example: *<pre> * public class Test { * Test() {} * static Test bar() { * return new <i>Test</i>(); * } * } *</pre> * Searching references to the type <code>Test</code> using this flag in the * above snippet will match only the reference in italic. * </p><p> * Note that array creations are not returned when using this flag. * </p> * @since 3.4 * @category limitTo */ int CLASS_INSTANCE_CREATION_TYPE_REFERENCE = 0x2000;
Note that while testing a little bit more this flag, I discovered a problem with parameterized constructor call. Use following test case public class Test { Test() {} <U> Test(U u) {} static Test foo() { return new <String> Test(""); } static Test bar() { return new Test(); } } and search for all references ("*" string pattern) using this CLASS_INSTANCE_CREATION_TYPE_REFERENCE flag does not return the reference in parameterized constructor call: new <String> Test("") I'll fix this issue while releasing changes for this bug...
proposal in comment 1 sounds good.
Released for 3.4M4 in HEAD stream.
Verified for 3.4M4 using build I20071210-1800.