Bug 85945 Test failure in N-build in JavaElementLabelsTest.testTypeLabelAnonymousInAnonymous
N20050221-0010 I corrected the bug in JavaElementLabels 1.4 -> 1.5. Please verify the fix. Content not as expected: is org.test.new Object() {...}.xoo().new Serializable() {...} Differs at pos 9: .test.^new Ob expected: org.test.Outer.foo(...).new Object() {...}.xoo().new Serializable() {...} expected:<...Outer.foo(...)....> but was:<......> junit.framework.ComparisonFailure: Content not as expected: is org.test.new Object() {...}.xoo().new Serializable() {...} Differs at pos 9: .test.^new Ob expected: org.test.Outer.foo(...).new Object() {...}.xoo().new Serializable() {...} expected:<...Outer.foo(...)....> but was:<......> at org.eclipse.jdt.testplugin.StringAsserts.assertEqualString(StringAsserts.java:72) at org.eclipse.jdt.ui.tests.core.CoreTests.assertEqualString(CoreTests.java:55) at org.eclipse.jdt.ui.tests.core.JavaElementLabelsTest.testTypeLabelAnonymousInAnonymous(JavaElementLabelsTest.java:223) ...
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java
}
	
	private static String getPkgNamePatternForPackagesView() {
		IPreferenceStore store= PreferenceConstants.getPreferenceStore();
		if (!store.getBoolean(PreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES))
			return ""; 
		return store.getString(PreferenceConstants.APPEARANCE_PKG_NAME_PATTERN_FOR_PKG_VIEW);
	}
	
	/**
	 * Returns the label of a classpath container
	 * @param containerPath The path of the container.
	 * @param project The project the contaienr is resolved in.
	 * @return Returns the label of the classpath container
	 * @throws JavaModelException Thrown when the resolving of the container failed.
	 */
	public static String getContainerEntryLabel(IPath containerPath, IJavaProject project) throws JavaModelException {
		IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, project);
		if (container != null) {
			return container.getDescription();
		}
		ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
		if (initializer != null) {
			return initializer.getDescription(containerPath, project);
		}
		return containerPath.toString();
	}
	
}