Summary: | [Search] wrong reference match to private method of supertype | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | martin.winter |
Version: | 3.0 | ||
Target Milestone: | 3.1 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Markus Keller
2004-07-26 11:01:46 EDT
Markus, Currently, there's no way to avoid this inaccurate result as search patterns do not have any information about visibility of its java element. If names match (ie. strings are equals), we report the match and - as demonstrated - sometimes it can be wrong... So, change this would imply new API for SearchPattern. Note that in your test case, search find result only because Second.privateMethod() is NOT private! If it was, no result would be found to your search... Philippe, do you think this new API may be investigated for 3.1? Finally API change is not necessary to solve this peculiar issue... Fixed. Search does not find any match now as expected. [jdt-core-internal] See patch file for changes. Test cases added in JavaSearchTests Verified for 3.1M3 with build I20041102 *** Bug 81783 has been marked as a duplicate of this bug. *** Reopen bug as fix was time consuming and must be removed. To get focus method visibility we're obliged to verify method while parsing compilation units and this slow search by approximatively 5%. This is not acceptable for such a specific test case... So, finally, it seems that a new API was necessary in this case => defer post 3.1 There would be a solution using IMethod.getFlags() So there won't be any API changes needed...(again) Fixed using Flags.isPrivate(int) API method. [jdt-core-internal] Test case JavaSearchBugsTest#testBug70827() was re-enabled. Verified in I20050330-0500 |