Bug 35396

Summary: Compiler error in RC2
Product: [Eclipse Project] JDT Reporter: Randy Hudson <hudsonr>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: critical    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Randy Hudson CLA 2003-03-20 14:56:44 EST
The following code compiles cleanly in RC2, but should fail:

static {
	Display display = Display.getCurrent();
	PaletteData pData = new PaletteData(0xFF, 0xFF00, 0xFF0000);
	RGB rgb = ColorConstants.button.getRGB();
	int fillColor = pData.getPixel(rgb);
	ImageData iData = new ImageData(1, 1, 24, pData);
	iData.setPixel(0, 0, fillColor);
	iData.setAlpha(0, 0, 200);
	TRANSPARENCY = new Image(display, iData);
}

private static final Image TRANSPARENCY;

This is a regression (or maybe some preference I don't know about).  Eclipse 
2.0.2 recognizes the error correctly.
Comment 1 Randy Hudson CLA 2003-03-20 15:02:43 EST
The compilation error, according to however releng is building GEF, is:
1. ERROR 
in /builds/gefbuilder/eclipse/plugins/org.eclipse.gef/src/org/eclipse/gef/intern
al/ui/palette/editparts/PaletteScrollBar.java (at line 52)
	TRANSPARENCY = new Image(display, iData);
	^^^^^^^^^^^^
Cannot reference a field before it is defined
Comment 2 Philipe Mulet CLA 2003-03-20 15:09:50 EST
We fixed the compiler since 2.0 to match the spec. Please see bug 26604.
Comment 3 Philipe Mulet CLA 2003-03-20 15:15:41 EST
Closing