Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 106303

Summary: method breakpoint hit problem
Product: [Eclipse Project] JDT Reporter: Przemyslaw Doe <Przemek_d>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: bmiller
Version: 3.1   
Target Milestone: 3.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Przemyslaw Doe CLA 2005-08-07 08:48:25 EDT
Method breakpoints are not hit if the method contains an interface parameter
declared in the same class as the method.
For example:
1 public class BreakpointTest {
2	public interface I {
3		public void m();
4	}
5	public static void sysOut(I i){
6		System.out.println("1");
7	}
8	public void sysO(I i){
9		System.out.println("2");
10	}
11	public static void main(String[] args) {
12		BreakpointTest.sysOut(null);
13		new BreakpointTest().sysO(null);
13	}
15 }

When I set a method breakpoint (from the eclipse gui) at line 5 and/or 6 and run
this programm in debug mode, the breakpoints will not be hit and the programm
will not suspend.

Is it possible to set method breakpoints programatically so that they will be
hit in such a case?
Comment 1 Darin Wright CLA 2005-08-08 09:01:45 EDT
Doesn't work this code either, with a method breakpoit on "sysO".

import java.util.List;

public class BreakpointTest {
		 
		 public static void sysOut(List i){
		 		 System.out.println("1");
		 }
		 public void sysO(List i){ // METHOD BREAKAPOINT
		 		 System.out.println("2");
		 }
		 public static void main(String[] args) {
		 		 BreakpointTest.sysOut(null);
		 		 new BreakpointTest().sysO(null);
		 }
}
Comment 2 Darin Wright CLA 2005-08-08 09:29:00 EDT
The problem I had with "List" was that I changed the method signature via 
typing, which did not update the method breakpoint's siganture - which is a 
dup of bug 102548.
Comment 3 Darin Wright CLA 2005-08-08 09:38:59 EDT
The problem is method signature. The JDI client storest the signature for the 
method as "(LBreakpointTest$I;)V", and the breakpoint has it set 
as "(L/BreakpointTest/I;)V".

We also have a problem for method breakpoints in methods where the argument 
type is declared in the default package - we have a leading "/" that should 
not be present.
Comment 4 Kevin Barnes CLA 2006-03-09 14:30:31 EST
This is working in HEAD. We've fixed other similar bugs recently (bug 94212, bug 130145).