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

(-)model/org/eclipse/jdt/internal/core/JavaProject.java (+18 lines)
Lines 2116-2121 Link Here
2116
					// container was bound
2116
					// container was bound
2117
					for (int j = 0, containerLength = containerEntries.length; j < containerLength; j++){
2117
					for (int j = 0, containerLength = containerEntries.length; j < containerLength; j++){
2118
						IClasspathEntry resolvedEntry = containerEntries[j];
2118
						IClasspathEntry resolvedEntry = containerEntries[j];
2119
						if (resolvedEntry == null) {
2120
							if (JavaModelManager.CP_RESOLVE_VERBOSE) {
2121
								JavaModelManager.getJavaModelManager().verbose_missbehaving_container(this, rawEntry.getPath(), containerEntries);
2122
							}
2123
							return false;
2124
						}
2119
						if (isOnClasspathEntry(elementPath, isFolderPath, isPackageFragmentRoot, resolvedEntry))
2125
						if (isOnClasspathEntry(elementPath, isFolderPath, isPackageFragmentRoot, resolvedEntry))
2120
							return true;
2126
							return true;
2121
					}					
2127
					}					
Lines 2504-2509 Link Here
2504
					// container was bound
2510
					// container was bound
2505
					for (int j = 0, containerLength = containerEntries.length; j < containerLength; j++){
2511
					for (int j = 0, containerLength = containerEntries.length; j < containerLength; j++){
2506
						ClasspathEntry cEntry = (ClasspathEntry) containerEntries[j];
2512
						ClasspathEntry cEntry = (ClasspathEntry) containerEntries[j];
2513
						if (cEntry == null) {
2514
							if (JavaModelManager.CP_RESOLVE_VERBOSE) {
2515
								JavaModelManager.getJavaModelManager().verbose_missbehaving_container(this, rawEntry.getPath(), containerEntries);
2516
							}
2517
							break;
2518
						}
2507
						// if container is exported or restricted, then its nested entries must in turn be exported  (21749) and/or propagate restrictions
2519
						// if container is exported or restricted, then its nested entries must in turn be exported  (21749) and/or propagate restrictions
2508
						cEntry = cEntry.combineWith((ClasspathEntry) rawEntry);
2520
						cEntry = cEntry.combineWith((ClasspathEntry) rawEntry);
2509
						resolvedEntries.add(cEntry);
2521
						resolvedEntries.add(cEntry);
Lines 2583-2588 Link Here
2583
						// container was bound
2595
						// container was bound
2584
						for (int j = 0, containerLength = containerEntries.length; j < containerLength; j++){
2596
						for (int j = 0, containerLength = containerEntries.length; j < containerLength; j++){
2585
							ClasspathEntry cEntry = (ClasspathEntry) containerEntries[j];
2597
							ClasspathEntry cEntry = (ClasspathEntry) containerEntries[j];
2598
							if (cEntry == null) {
2599
								if (JavaModelManager.CP_RESOLVE_VERBOSE) {
2600
									JavaModelManager.getJavaModelManager().verbose_missbehaving_container(this, rawEntry.getPath(), containerEntries);
2601
								}
2602
								break;
2603
							}
2586
							// if container is exported or restricted, then its nested entries must in turn be exported  (21749) and/or propagate restrictions
2604
							// if container is exported or restricted, then its nested entries must in turn be exported  (21749) and/or propagate restrictions
2587
							cEntry = cEntry.combineWith((ClasspathEntry) rawEntry);
2605
							cEntry = cEntry.combineWith((ClasspathEntry) rawEntry);
2588
							if (rawReverseMap != null) {
2606
							if (rawReverseMap != null) {
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-1 / +29 lines)
Lines 549-554 Link Here
549
			return false;
549
			return false;
550
		}
550
		}
551
		for (int i = 0, length = newEntries.length; i < length; i++) {
551
		for (int i = 0, length = newEntries.length; i < length; i++) {
552
			if (newEntries[i] == null) {
553
				if (CP_RESOLVE_VERBOSE)
554
					verbose_missbehaving_container(project, containerPath, newEntries);
555
				return false;
556
			}
552
			if (!newEntries[i].equals(oldEntries[i])) {
557
			if (!newEntries[i].equals(oldEntries[i])) {
553
				if (CP_RESOLVE_VERBOSE)
558
				if (CP_RESOLVE_VERBOSE)
554
					verbose_missbehaving_container(containerPath, projects, respectiveContainers, container, newEntries, oldEntries);
559
					verbose_missbehaving_container(containerPath, projects, respectiveContainers, container, newEntries, oldEntries);
Lines 625-630 Link Here
625
			"\n	}"); //$NON-NLS-1$
630
			"\n	}"); //$NON-NLS-1$
626
	}
631
	}
627
	
632
	
633
	void verbose_missbehaving_container(IJavaProject project, IPath containerPath, IClasspathEntry[] classpathEntries) {
634
		Util.verbose(
635
			"CPContainer GET - missbehaving container (returning null classpath entry)\n" + //$NON-NLS-1$
636
			"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
637
			"	container path: " + containerPath + '\n' + //$NON-NLS-1$
638
			"	classpath entries: {\n" + //$NON-NLS-1$
639
			org.eclipse.jdt.internal.compiler.util.Util.toString(
640
				classpathEntries, 
641
				new org.eclipse.jdt.internal.compiler.util.Util.Displayable(){ 
642
					public String displayString(Object o) { 
643
						StringBuffer buffer = new StringBuffer("		"); //$NON-NLS-1$
644
						if (o == null) {
645
							buffer.append("<null>"); //$NON-NLS-1$
646
							return buffer.toString();
647
						}
648
						buffer.append(o);
649
						return buffer.toString();
650
					}
651
				}) +
652
			"\n	}" //$NON-NLS-1$
653
		);
654
	}
655
628
	private void containerRemoveInitializationInProgress(IJavaProject project, IPath containerPath) {
656
	private void containerRemoveInitializationInProgress(IJavaProject project, IPath containerPath) {
629
		Map initializations = (Map)this.containerInitializationInProgress.get();
657
		Map initializations = (Map)this.containerInitializationInProgress.get();
630
		if (initializations == null)
658
		if (initializations == null)
Lines 2228-2234 Link Here
2228
			buffer.append("	container: "+container.getDescription()+" {\n"); //$NON-NLS-2$//$NON-NLS-1$
2256
			buffer.append("	container: "+container.getDescription()+" {\n"); //$NON-NLS-2$//$NON-NLS-1$
2229
			IClasspathEntry[] entries = container.getClasspathEntries();
2257
			IClasspathEntry[] entries = container.getClasspathEntries();
2230
			if (entries != null){
2258
			if (entries != null){
2231
				for (int i = 0; i < entries.length; i++){
2259
				for (int i = 0; i < entries.length; i++) {
2232
					buffer.append("		" + entries[i] + '\n'); //$NON-NLS-1$
2260
					buffer.append("		" + entries[i] + '\n'); //$NON-NLS-1$
2233
				}
2261
				}
2234
			}
2262
			}
(-)model/org/eclipse/jdt/internal/core/JavaElement.java (-1 / +7 lines)
Lines 659-665 Link Here
659
		if (container != null) {
659
		if (container != null) {
660
			IClasspathEntry[] entries= container.getClasspathEntries();
660
			IClasspathEntry[] entries= container.getClasspathEntries();
661
			for (int i= 0; i < entries.length; i++) {
661
			for (int i= 0; i < entries.length; i++) {
662
				IClasspathEntry curr= entries[i];
662
				IClasspathEntry curr = entries[i];
663
				if (curr == null) {
664
					if (JavaModelManager.CP_RESOLVE_VERBOSE) {
665
						JavaModelManager.getJavaModelManager().verbose_missbehaving_container(jproject, containerPath, entries);
666
					}
667
					break;
668
				}
663
				IClasspathEntry resolved= JavaCore.getResolvedClasspathEntry(curr);
669
				IClasspathEntry resolved= JavaCore.getResolvedClasspathEntry(curr);
664
				if (resolved != null && libPath.equals(resolved.getPath())) {
670
				if (resolved != null && libPath.equals(resolved.getPath())) {
665
					return curr; // return the real entry
671
					return curr; // return the real entry

Return to bug 180169