Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319854

Summary: [search] wrong condition for warning about references to inlined constant
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 12044    
Bug Blocks:    
Attachments:
Description Flags
Fix none

Description Markus Keller CLA 2010-07-14 09:38:39 EDT
Created attachment 174289 [details]
Fix

I20100713-0800 (old problem)

The condition in SearchUtil.warnIfBinaryConstant(IJavaElement, Shell) is wrong. It tests whether the field is declared in a binary type, but that doesn't matter for this problem. What matters is whether a *reference* is in a binary type (since only those references are not being found due to bug 12044).

I first thought we could improve the test by using
"IField.getConstant() != null", but that Java model method doesn't work reliably since it doesn't resolve the initializer (bug 202293). So we have to keep the warning for all static final fields of a "dangerous" type.
Comment 1 Markus Keller CLA 2010-07-14 09:39:07 EDT
Fixed in HEAD.