### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/ClasspathEntry.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java,v retrieving revision 1.108 diff -u -r1.108 ClasspathEntry.java --- model/org/eclipse/jdt/internal/core/ClasspathEntry.java 28 Oct 2008 20:14:57 -0000 1.108 +++ model/org/eclipse/jdt/internal/core/ClasspathEntry.java 28 Oct 2008 21:22:48 -0000 @@ -888,10 +888,14 @@ boolean success = analyzer.analyzeManifestContents(reader); List calledFileNames = analyzer.getCalledFileNames(); if (!success || analyzer.getClasspathSectionsCount() == 1 && calledFileNames == null) { - Util.log(IStatus.WARNING, "Invalid Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ + if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { + Util.verbose("Invalid Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ + } return; } else if (analyzer.getClasspathSectionsCount() > 1) { - Util.log(IStatus.WARNING, "Multiple Class-Path headers in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ + if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { + Util.verbose("Multiple Class-Path headers in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ + } return; } if (calledFileNames != null) { @@ -900,7 +904,9 @@ while (calledFilesIterator.hasNext()) { String calledFileName = (String) calledFilesIterator.next(); if (!directoryPath.isValidPath(calledFileName)) { - Util.log(IStatus.WARNING, "Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ + if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { + Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ + } } else { IPath calledJar = directoryPath.append(new Path(calledFileName)); resolvedChainedLibraries(calledJar, visited, result); @@ -911,8 +917,16 @@ } } catch (CoreException e) { // not a zip file + if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { + Util.verbose("Could not read Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ + e.printStackTrace(); + } } catch (IOException e) { - Util.log(e, "Could not read Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ + // not a zip file + if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { + Util.verbose("Could not read Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ + e.printStackTrace(); + } } finally { manager.closeZipFile(zip); if (reader != null) { #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/ClasspathTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java,v retrieving revision 1.192 diff -u -r1.192 ClasspathTests.java --- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 28 Oct 2008 20:13:20 -0000 1.192 +++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 28 Oct 2008 21:22:55 -0000 @@ -3394,7 +3394,33 @@ deleteProject("P"); deleteExternalResource("lib1.jar"); } -}/* +} +/* + * Ensures that an invalid Class-Path: clause of a jar doesn't generate messages in the .log + * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=252264 ) + */ +public void testExtraLibraries16() throws Exception { + try { + startLogListening(); + Util.createJar( + new String[0], + new String[] { + "META-INF/MANIFEST.MF", + "Manifest-Version: 1.0\r\n" + + "Class-Path: \n", + }, + getExternalResourcePath("lib1.jar"), + JavaCore.VERSION_1_4); + IJavaProject p = createJavaProject("P", new String[0], new String[] {getExternalResourcePath("lib1.jar")}, ""); + p.getResolvedClasspath(true); + assertLogEquals(""); + } finally { + stopLogListening(); + deleteProject("P"); + deleteExternalResource("lib1.jar"); + } +} +/* * Ensures that a marker is removed if adding an internal jar that is on the classpath in another project * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=213723 ) */