Community
Participate
Working Groups
build 20020124 I get an internal error when I search for write access to the variable 'toggle' in the class below. I'm going to upload the workspace to walleye /va2000/INCOMING/forKnut in case you can't reproduce. The class is in project Playgound_Knut, kr.PR.FlashTest.java. import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; public class FlashTest { boolean toggle = false; public void create() { final Shell shell = new Shell(); Display display = shell.getDisplay(); final Canvas canvas = new Canvas(shell, SWT.NO_BACKGROUND); final Color background = new Color(display, 222, 222, 222); final Color color1 = new Color(display, 0, 0, 0); final Color color2 = new Color(display, 222, 0, 0); canvas.setSize(200, 200); canvas.addListener(SWT.Paint, new Listener() { public void handleEvent(Event e) { if (toggle) { // e.gc.setBackground(color1); e.gc.setForeground(color1); } else { // e.gc.setBackground(color2); e.gc.setForeground(color2); } e.gc.setBackground(background); e.gc.fillRectangle(e.getBounds()); for (int i = 0; i < canvas.getSize().y; i += 14) { e.gc.drawText("FlashTest Line FlashTest " + i, 0, i); } } }); canvas.addListener(SWT.KeyDown, new Listener() { public void handleEvent(Event e) { toggle = !toggle; canvas.redraw(); } }); shell.open(); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } } public static void main(String[] args) { FlashTest test = new FlashTest(); test.create(); } }
Created attachment 267 [details] org.eclipse.jdt.internal.compiler.problem.AbortCompilationUnit searching for write access to variable
The internal error only seems to happen if I search for write access in the hierarchy. It also occurs in other files but works when I search in the entire workspace (haven't tried a working set).
*** This bug has been marked as a duplicate of 8536 ***