Bug 17930 - Moving secondary types is fooling the java incremental builder
Summary: Moving secondary types is fooling the java incremental builder
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-27 10:56 EDT by Philipe Mulet CLA
Modified: 2002-06-03 14:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2002-05-27 10:56:20 EDT
Build 20020527

When moving a secondary type from one unit to another one, since fix for bug 
17807, secondary types are no longer removed early.

This now causes in turn issues due to duplicate type unexpected errors.

Following script should work:

	public void testMoveSecondaryType() {
		IPath projectPath = env.addProject("Project");
		env.addExternalJar(projectPath, env.getMinimalJarPath());

		// remove old package fragment root so that names don't collide
		env.removePackageFragmentRoot(projectPath, "");
		
		IPath root = env.addPackageFragmentRoot(projectPath, "src");
		env.setOutputFolder(projectPath, "bin");

		IPath pathToAA = env.addClass(root, "p", "AA",
			"package p;	\n"+
			"public class AA {	\n"+
			"}	\n"+
			"class AZ {	\n" +
			"}	\n");

		IPath pathToAB = env.addClass(root, "p", "AB",
			"package p;	\n"+
			"public class AB extends AZ {	\n"+
			"}	\n");

		IPath pathToZZ = env.addClass(root, "p", "ZZ",
			"package p;	\n"+
			"public class ZZ {	\n"+
			"}	\n");

		fullBuild(projectPath);
		expectingNoProblems();
				
		/* Move AZ from AA to ZZ */
		IPath pathToAZ = env.addClass(root, "p", "AA",
			"package p;	\n"+
			"public class AA {	\n"+
			"}	\n"+
			"class AZ {	\n" +
			"}	\n");

		pathToZZ = env.addClass(root, "p", "ZZ",
			"package p;	\n"+
			"public class ZZ {	\n"+
			"}	\n"+
			"class AZ {	\n" +
			"}	\n");
			
		incrementalBuild(projectPath);
		expectingNoProblems();
	}
Comment 1 Kent Johnson CLA 2002-05-27 14:10:01 EDT
This testcase is busted... there is no problem. It should be:

		/* Move AZ from AA to ZZ */
		IPath pathToAZ = env.addClass(root, "p", "AA",
			"package p;	\n"+
			"public class AA {	\n"+
			"}	\n");

		pathToZZ = env.addClass(root, "p", "ZZ",
			"package p;	\n"+
			"public class ZZ {	\n"+
			"}	\n"+
			"class AZ {	\n" +
			"}	\n");
Comment 2 Olivier Thomann CLA 2002-06-03 14:23:27 EDT
Don't know how to verify this.
Comment 3 Kent Johnson CLA 2002-06-03 14:39:04 EDT
It was a bug in the testcase.