Bug 365143 - A static import used only in an annotation gives a warning
Summary: A static import used only in an annotation gives a warning
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 3.8 M5   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2011-11-29 17:44 EST by Benjamin Weber CLA
Modified: 2012-01-23 10:09 EST (History)
2 users (show)

See Also:


Attachments

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