View | Details | Raw Unified | Return to bug 65748 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/TypeHierarchyNotificationTests.java (+39 lines)
Lines 578-583 Link Here
578
		h.removeTypeHierarchyChangedListener(this);
578
		h.removeTypeHierarchyChangedListener(this);
579
	}
579
	}
580
}
580
}
581
/*
582
 * Ensures that changing the modifiers of the focus type in a working copy reports a hierarchy change on save.
583
 * (regression test for bug 
584
 */
585
public void testChangeFocusModifier() throws CoreException {
586
	ITypeHierarchy h = null;
587
	ICompilationUnit workingCopy = null;
588
	try {
589
		createJavaProject("P1");
590
		createFolder("/P1/p");
591
		createFile(
592
			"/P1/p/X.java",
593
			"package p1;\n" +
594
			"public class X {\n" +
595
			"}"
596
		);
597
		workingCopy = getCompilationUnit("/P1/p/X.java");
598
		workingCopy.becomeWorkingCopy(null/*no pb requestor*/, null/*no progress*/);
599
		h = workingCopy.getType("X").newTypeHierarchy(null);
600
		h.addTypeHierarchyChangedListener(this);
601
		
602
		workingCopy.getBuffer().setContents(
603
			"package p1;\n" +
604
			"class X {\n" +
605
			"}"
606
		);
607
		workingCopy.reconcile(ICompilationUnit.NO_AST, false/*mp pb detection*/, null/*no workingcopy owner*/, null/*no prgress*/);
608
		workingCopy.commitWorkingCopy(false/*don't force*/, null/*no progress*/);
609
		
610
		assertOneChange(h);
611
	} finally {
612
		if (h != null)
613
			h.removeTypeHierarchyChangedListener(this);
614
		if (workingCopy != null)
615
			workingCopy.discardWorkingCopy();
616
		deleteProjects(new String[] {"P1", "P2"});
617
	}
618
}
619
581
/**
620
/**
582
 * Ensures that a TypeHierarchyNotification is made invalid when the project is closed.
621
 * Ensures that a TypeHierarchyNotification is made invalid when the project is closed.
583
 */
622
 */

Return to bug 65748