Bug 365143

Summary: A static import used only in an annotation gives a warning
Product: [Eclipse Project] JDT Reporter: Benjamin Weber <eclipse>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED WORKSFORME QA Contact:
Severity: minor    
Priority: P3 CC: jarthana, srikanth_sankaran
Version: 3.8Keywords: needinfo
Target Milestone: 3.8 M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Benjamin Weber CLA 2011-11-29 17:44:26 EST
Build Identifier: 201109131000

A static import used only in an annotation gives a warning - and the quick fix offers to remove it, which breaks compilation.

http://files.benjiweber.co.uk/b/thanks_eclipse.png

Here is the text version for convenience:

package scratchpad;

import javax.xml.bind.annotation.XmlType;

import static scratchpad.Foo.BAR; 

@XmlType(name=BAR)
public class Foo {
	protected static final String BAR = "bar";
}


Reproducible: Always

Steps to Reproduce:
1. Create a package "scratchpad"
2. Create a new class called Foo in said package
3. Copy and paste above code into class Foo
4. Observe warning on the static import, as per screenshot
Comment 1 Srikanth Sankaran CLA 2011-11-29 19:56:55 EST
I'll follow up.
Comment 2 Srikanth Sankaran CLA 2011-12-14 03:55:56 EST
I am not able to reproduce this using bare bones 3.8 M4 Build id: I20111027-1800.
Can you check with this version above which is the latest as of now? 

Anything else you can think off which I could be missing in my set up ? 

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=261323 which was
an identical case which also went unreproducible from our end.

What is the full build identifier ? Can you try with minimal eclipse SDK ? 

Jay, can you try and see if you can reproduce this ?
Comment 3 Jay Arthanareeswaran CLA 2011-12-14 04:43:18 EST
(In reply to comment #2)
> Jay, can you try and see if you can reproduce this ?

No, I tried with 4.2 M4 and I can't reproduce this.
Comment 4 Srikanth Sankaran CLA 2012-01-03 03:36:24 EST
(In reply to comment #2)

> What is the full build identifier ? Can you try with minimal eclipse SDK ? 

Any updates on this ?
Comment 5 Srikanth Sankaran CLA 2012-01-11 19:52:52 EST
There is nothing that can be done from our side.
If you can check against bare bones eclipse SDK
on a clean work space with out of the box settings,
please reopen.
Comment 6 Jay Arthanareeswaran CLA 2012-01-23 10:09:27 EST
Verified for 3.8M5 using I20120122-2000