Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319854 - [search] wrong condition for warning about references to inlined constant
Summary: [search] wrong condition for warning about references to inlined constant
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 12044
Blocks:
  Show dependency tree
 
Reported: 2010-07-14 09:38 EDT by Markus Keller CLA
Modified: 2010-07-14 09:39 EDT (History)
0 users

See Also:


Attachments
Fix (3.86 KB, patch)
2010-07-14 09:38 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.