Community
Participate
Working Groups
I am new to Eclipse and in my learning exercises I have run across a bug that I then found online at http://www.coderanch.com/t/106236/IDEs-Version-Control-other-tools/Cannot-remove-breakpoint-Eclipse. It involves being unable to toggle a breakpoint on a line of code. The code is an example from an online tutorial and I've included it below. If I try to toggle a breakpoint on line 48 I get the breakpoint set. If I then try to toggle it again to remove it, I get a second breakpoint. I am able to disable it and to skip it but the only way I can remove it is to use the Run menu and remove all breakpoints. I am using Eclipse 3.4.1. Hopefully this is enough information to reproduce and resolve this issue. Thanks. Jon package Anon; import java.awt.*; import java.awt.event.*; public class InnerClasses08 { public static void main(String[] args){ new GUI(); }//end main }//end class InnerClasses08 //=============================================// class GUI extends Frame{ /** * */ private static final long serialVersionUID = 3990842979081966365L; public GUI(){//constructor setLayout(new FlowLayout()); setSize(250,75); setTitle("Copyright 2003 R.G.Baldwin"); //Local class w/mouse events enabled. The new // class extends Button, and uses low-level // event handling to handle mouse clicked // events on the button. class BaldButton extends Button{ /** * */ private static final long serialVersionUID = -2469128161023919728L; BaldButton(String text){//constructor enableEvents(AWTEvent.MOUSE_EVENT_MASK); setLabel(text); //Display the name of the class file System.out.println("Local class name: " + getClass().getName()); }//end constructor //This is the event handling method. public void processMouseEvent( MouseEvent e){ if (e.getID() == MouseEvent.MOUSE_CLICKED){ System.out.println("buttonA clicked"); }//end if //The following is required of overridden // processMouseEvent method. super.processMouseEvent(e); }//end processMouseEvent }//end class BaldButton //Add button to Frame add(new BaldButton("A")); //This code defines an anonymous Inner Class // w/mouse events enabled. The new class // extends Button. This class uses low-level // event handling to handle mouse clicked // events on the button. This is an // anonymous alternative to the local class // defined above. add(new Button("B") {//Begin class definition /** * */ private static final long serialVersionUID = -9126989704966253101L; {//Instance initializer enableEvents( AWTEvent.MOUSE_EVENT_MASK); System.out.println( "Anonymous class B name: " + getClass().getName()); }//end instance initializer //Override the inherited // processMouseEvent method. public void processMouseEvent( MouseEvent e){ if (e.getID() == MouseEvent.MOUSE_CLICKED){ System.out.println( "buttonB clicked"); }//end if //Required of overridden // processMouseEvent method. super.processMouseEvent(e); }//end processMouseEvent }//end class definition );//end add method call Button buttonC = new Button("C"); //Anonymous inner class that implements // MouseListener interface buttonC.addMouseListener(new MouseListener() {//begin class definition //Instance initializer {System.out.println( "Anonymous class C name: " + getClass().getName());} public void mouseClicked(MouseEvent e){ System.out.println("buttonC clicked"); }//end mouseClicked //All interface methods must be defined public void mousePressed(MouseEvent e){} public void mouseReleased(MouseEvent e){} public void mouseEntered(MouseEvent e){} public void mouseExited(MouseEvent e){} }//end class definition );//end addMouseListener call add(buttonC);//add button to frame //Use an anonymous class to register a window // listener on the Frame. This class extends // WindowAdapter addWindowListener(new WindowAdapter() {//begin class definition //Instance initializer {System.out.println( "Anonymous window listener class " + "name: " + getClass().getName());} public void windowClosing(WindowEvent e){ System.out.println( "Close button clicked"); System.exit(0); }//end windowClosing }//end class definition );//end addWindowListener setVisible(true); }//end constructor }//end GUI class //=============================================//
The bug was sent to g-Eclipse, but this seems to be a JDT problem. As I don't have Vista, I can't do anything but assigning it to jdt-debug-inbox@eclipse.org Harald
Which is line 48? the formatting caused by copy/paste has split lines. Perhaps attach the file rather than paste it.
Created attachment 125000 [details] java file as attachment I can reproduce the problem as described below. Follow up from Jon: "The line is "System.out.println("buttonA clicked")' The peculiar thing is the the problem appears to be apparent only once you start debugging. For example, if I set the breakpoint prior to debugging, I can successfully toggle it. Once I hit the breakpoint, if I attempt to toggle it, it simply adds another breakpoint."
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.