Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326286 - ClassNotFoundException using "Step Into" debugging JUnit test
Summary: ClassNotFoundException using "Step Into" debugging JUnit test
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-27 06:35 EDT by Stefan Moebius CLA
Modified: 2010-09-27 09:30 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Moebius CLA 2010-09-27 06:35:58 EDT
Build Identifier: 20100917-0705

The debugger cannot find some classes when using "Step Into". Using "Step Over"/"Continue" works fine. This is reproducible on Eclipse 3.4 and 3.6.1 (Helios Service Release 1, Build 20100917-0705).

Reproducible: Always

Steps to Reproduce:
1. Create a new class with the following content:

import org.junit.Test;

public class Bar {

	public static class Selftest {

		@Test
		public void test() {
			System.out.println(this.getClass());
			Foo foo = createFoo();
			System.out.println(foo.getClass());
		}
	}

	public static Foo createFoo() {
		Foo foo = new Foo();
		System.out.println(foo.getClass());
		return foo;
	}

	private static class Foo {

		Foo() {
			System.out.println(this.getClass());
		}
	}
}

2. Place a breakpoint on the line "Foo foo = new Foo();"
3. Debug Selftest as a JUnit test.
4. Use "Step Into" after hitting the breakpoint.

Expected result:
Step into Foo.Foo().

Actual result:
ClassNotFoundException

Workaround exists by putting a breakpoint inside the constructor.
Comment 1 Darin Wright CLA 2010-09-27 09:30:00 EDT
It does work... it just takes a while to get there. You need to step out/in several times until you enter the constructor. I assume the classloader makes several attempts to find the class Foo.