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

(-)model/org/eclipse/jdt/internal/core/ClasspathEntry.java (-4 / +18 lines)
Lines 888-897 Link Here
888
					boolean success = analyzer.analyzeManifestContents(reader);
888
					boolean success = analyzer.analyzeManifestContents(reader);
889
					List calledFileNames = analyzer.getCalledFileNames();
889
					List calledFileNames = analyzer.getCalledFileNames();
890
					if (!success || analyzer.getClasspathSectionsCount() == 1 && calledFileNames == null) {
890
					if (!success || analyzer.getClasspathSectionsCount() == 1 && calledFileNames == null) {
891
						Util.log(IStatus.WARNING, "Invalid Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$
891
						if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) {
892
							Util.verbose("Invalid Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$
893
						}
892
						return;
894
						return;
893
					} else if (analyzer.getClasspathSectionsCount() > 1) {
895
					} else if (analyzer.getClasspathSectionsCount() > 1) {
894
						Util.log(IStatus.WARNING, "Multiple Class-Path headers in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$
896
						if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) {
897
							Util.verbose("Multiple Class-Path headers in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$
898
						}
895
						return;
899
						return;
896
					}
900
					}
897
					if (calledFileNames != null) {
901
					if (calledFileNames != null) {
Lines 900-906 Link Here
900
						while (calledFilesIterator.hasNext()) {
904
						while (calledFilesIterator.hasNext()) {
901
							String calledFileName = (String) calledFilesIterator.next();
905
							String calledFileName = (String) calledFilesIterator.next();
902
							if (!directoryPath.isValidPath(calledFileName)) {
906
							if (!directoryPath.isValidPath(calledFileName)) {
903
								Util.log(IStatus.WARNING, "Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$
907
								if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) {
908
									Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$
909
								}
904
							} else {
910
							} else {
905
								IPath calledJar = directoryPath.append(new Path(calledFileName));
911
								IPath calledJar = directoryPath.append(new Path(calledFileName));
906
								resolvedChainedLibraries(calledJar, visited, result);
912
								resolvedChainedLibraries(calledJar, visited, result);
Lines 911-918 Link Here
911
				}
917
				}
912
			} catch (CoreException e) {
918
			} catch (CoreException e) {
913
				// not a zip file
919
				// not a zip file
920
				if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) {
921
					Util.verbose("Could not read Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$
922
					e.printStackTrace();
923
				}
914
			} catch (IOException e) {
924
			} catch (IOException e) {
915
				Util.log(e, "Could not read Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$
925
				// not a zip file
926
				if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) {
927
					Util.verbose("Could not read Class-Path header in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$
928
					e.printStackTrace();
929
				}
916
			} finally {
930
			} finally {
917
				manager.closeZipFile(zip);
931
				manager.closeZipFile(zip);
918
				if (reader != null) {
932
				if (reader != null) {
(-)src/org/eclipse/jdt/core/tests/model/ClasspathTests.java (-1 / +27 lines)
Lines 3394-3400 Link Here
3394
		deleteProject("P");
3394
		deleteProject("P");
3395
		deleteExternalResource("lib1.jar");
3395
		deleteExternalResource("lib1.jar");
3396
	}
3396
	}
3397
}/*
3397
}
3398
/*
3399
 * Ensures that an invalid Class-Path: clause of a jar doesn't generate messages in the .log
3400
 * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=252264 )
3401
 */
3402
public void testExtraLibraries16() throws Exception {
3403
	try {
3404
		startLogListening();
3405
		Util.createJar(
3406
			new String[0],
3407
			new String[] {
3408
				"META-INF/MANIFEST.MF",
3409
				"Manifest-Version: 1.0\r\n" +
3410
				"Class-Path: \n",
3411
			},
3412
			getExternalResourcePath("lib1.jar"),
3413
			JavaCore.VERSION_1_4);
3414
		IJavaProject p = createJavaProject("P", new String[0], new String[] {getExternalResourcePath("lib1.jar")}, "");
3415
		p.getResolvedClasspath(true);
3416
		assertLogEquals("");
3417
	} finally {
3418
		stopLogListening();
3419
		deleteProject("P");
3420
		deleteExternalResource("lib1.jar");
3421
	}
3422
}
3423
/*
3398
 * Ensures that a marker is removed if adding an internal jar that is on the classpath in another project
3424
 * Ensures that a marker is removed if adding an internal jar that is on the classpath in another project
3399
 * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=213723 )
3425
 * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=213723 )
3400
 */
3426
 */

Return to bug 252264