Summary: | [search] "And" Pattern fails with NullPointerException | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Gerry Kessler <gerry.kessler> | ||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||
Status: | CLOSED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P5 | ||||||
Version: | 3.2 | ||||||
Target Milestone: | 3.4 M1 | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Gerry Kessler
2006-05-16 13:51:55 EDT
Indeed, PatternLocator.patternLocator(SearchPattern) can return null. We should either handle the null case or return a non-null pattern. In the same way, the call to PatternLocator.patternLocator(SearchPattern pattern) in org.eclipse.jdt.internal.core.search.matching.OrLocator can also put null patterns in the patternLocators array. There is no null check when retrieving the pattern locators. Created attachment 73026 [details] Proposed patch Note that for AND patterns, Search Engine returns matches which will both be returned by each pattern of the AND. Unfortunately that means it does not return any match for the initial bug scenario given in comment 0 as results of requests "Implementors of I1" and "Implementors of I2" have no real common match. The goal of this patch is just to: 1) avoid the NPE 2) implement minimal behavior for the AND pattern allowing deeper implementation in case of a strong need appears in the future... Released for 3.4M1 in HEAD stream. Verified (from code of added tests) for 3.4M1 using build I20070802-0800. closing |