View | Details | Raw Unified | Return to bug 139279
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java (+29 lines)
Lines 14-19 Link Here
14
import java.io.IOException;
14
import java.io.IOException;
15
import java.util.HashMap;
15
import java.util.HashMap;
16
16
17
import org.eclipse.core.resources.IncrementalProjectBuilder;
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.OperationCanceledException;
19
import org.eclipse.core.runtime.OperationCanceledException;
19
import org.eclipse.core.runtime.Path;
20
import org.eclipse.core.runtime.Path;
Lines 401-406 Link Here
401
	}
402
	}
402
}
403
}
403
/*
404
/*
405
 * Ensures that the hierarchy lookup mechanism get the right binary if it is missplaced.
406
 * (regression test for bug 139279 Fup of bug 134110, got CCE changing an external jar contents and refreshing the project)
407
 */
408
public void testBinaryInWrongPackage() throws CoreException {
409
	try {
410
		createJavaProject("P", new String[] {"src"}, new String[] {"JCL_LIB", "lib"}, "bin");
411
		createFolder("/P/src/p");
412
		createFile(
413
			"/P/src/p/X.java",
414
			"pakage p;\n" +
415
			"public class X {\n" +
416
			"}"
417
		);
418
		getProject("P").build(IncrementalProjectBuilder.FULL_BUILD, null);
419
		waitForAutoBuild();
420
		getFile("/P/bin/p/X.class").copy(new Path("/P/lib/X.class"), false, null);
421
		ITypeHierarchy hierarchy = getClassFile("P", "/P/lib", "", "X.class").getType().newSupertypeHierarchy(null);
422
		assertHierarchyEquals(
423
			"Focus: X [in X.class [in <default> [in lib [in P]]]]\n" + 
424
			"Super types:\n" + 
425
			"Sub types:\n" + 
426
			"Root classes:\n",
427
			hierarchy);
428
	} finally {
429
		deleteProject("P");
430
	}
431
}
432
/*
404
 * Ensures that a hierarchy with a binary subclass that is also referenced can be computed
433
 * Ensures that a hierarchy with a binary subclass that is also referenced can be computed
405
 * (regression test for bug 48459 NPE in Type hierarchy)
434
 * (regression test for bug 48459 NPE in Type hierarchy)
406
 */
435
 */
(-)model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.java (-1 / +1 lines)
Lines 243-249 Link Here
243
			false/* do NOT wait for indexes */,
243
			false/* do NOT wait for indexes */,
244
			false/*don't check restrictions*/,
244
			false/*don't check restrictions*/,
245
			null);
245
			null);
246
		return answer == null ? null : answer.type;
246
		return answer == null || answer.type == null || !answer.type.isBinary() ? null : answer.type;
247
		
247
		
248
	}
248
	}
249
	protected void worked(IProgressMonitor monitor, int work) {
249
	protected void worked(IProgressMonitor monitor, int work) {

Return to bug 139279