Community
Participate
Working Groups
Build ID: Build id: M20090211-1700 Steps To Reproduce: Consider the following: package homenetwork.bkr.training; import java.awt.Color; import javax.swing.*; /*see http://java.sun.com/javase/6/docs/api/javax/swing/InputMap.html */ @SuppressWarnings("serial") public class ActionFrame extends JFrame { public ActionFrame() { setTitle("ActionTest"); setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); JPanel buttonPanel = new JPanel(); //define actions Action yellowAction = new ColorAction("Yellow", new ImageIcon("C:\\pictures\\yellow-ball.gif", Color.YELLOW); Action blueAction = new ColorAction("Blue", new ImageIcon("C:\\pictures\\blue-ball.jpg", Color.BLUE); Action redAction = new ColorAction("Red", new ImageIcon("C:\\pictures\\red-ball.jpg", Color.RED); //Add buttons for these actions buttonPanel.add(new JButton(yellowAction)); buttonPanel.add(new JButton(blueAction)); buttonPanel.add(new JButton(redAction)); //Add panel to frame add(buttonPanel); //Associate the Y, B and R keys with names InputMap //An error is displayed: InputMap cannot be resolved. Why? } public static final int DEFAULT_WIDTH = 300; public static final int DEFAULT_HEIGHT = 200; } More information: NOTE 1: Microsoft Windows [Version 6.0.6001] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Users\Administrator>java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
If you don't write correct Java, I don't really know what you are expecting from the IDE. If your line only contains "InputMap", the most accurate guess that JDT can do is "oh, one token which is not a Java keyword, Jon must probably mean that 'InputMap' is a variable, but not declared yet"... It would certainly help if you told us what *you* would expect from the IDE? Perhaps only a "syntax error, insert ; to complete the statement", and no error related to unresolved variable until the line is actually complete?
If you say so.
Please describe what you expect the IDE to do in your case.
Well I would like the IDE just to surround the statement with try/catch block and do nothing else.
Closing as INVALID. The error is reported by the reconciler because the statement is not complete yet. No plan to change this.
Verified for 3.6M1