View | Details | Raw Unified | Return to bug 306519 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/core/JavaCore.java (-4 / +6 lines)
Lines 4602-4616 Link Here
4602
	 * entries, they are processed recursively and added to the list. For entry kinds other 
4602
	 * entries, they are processed recursively and added to the list. For entry kinds other 
4603
	 * than {@link IClasspathEntry#CPE_LIBRARY}, this method returns an empty array.
4603
	 * than {@link IClasspathEntry#CPE_LIBRARY}, this method returns an empty array.
4604
	 * <p> 
4604
	 * <p> 
4605
	 * If a referenced entry has already been stored 
4605
	 * When a non-null project is passed, any additional attributes that may have been stored 
4606
	 * in the given project's .classpath, the stored attributes are populated in the corresponding
4606
	 * previously in the project's .classpath files are retrived and populated in the 
4607
	 * referenced entry. For more details on storing referenced entries see
4607
	 * corresponding referenced entry. If the project is <code>null</code>, the raw referenced
4608
	 * entries are returned without any persisted attributes. 
4608
	 * see {@link IJavaProject#setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath, 
4609
	 * see {@link IJavaProject#setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath, 
4609
	 * IProgressMonitor)}. 
4610
	 * IProgressMonitor)}. 
4610
	 * </p>
4611
	 * </p>
4611
	 * 
4612
	 * 
4612
	 * @param libraryEntry the library entry whose referenced entries are sought 
4613
	 * @param libraryEntry the library entry whose referenced entries are sought 
4613
	 * @param project project where the persisted referenced entries to be retrieved from
4614
	 * @param project project where the persisted referenced entries to be retrieved from. If <code>null</code>
4615
	 * 			persisted attributes are not attempted to be retrived.
4614
	 * @return an array of classpath entries that are referenced directly or indirectly by the given entry. 
4616
	 * @return an array of classpath entries that are referenced directly or indirectly by the given entry. 
4615
	 * 			If not applicable, returns an empty array.
4617
	 * 			If not applicable, returns an empty array.
4616
	 * @since 3.6
4618
	 * @since 3.6
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-1 / +4 lines)
Lines 1850-1857 Link Here
1850
	public IClasspathEntry[] getReferencedClasspathEntries(IClasspathEntry libraryEntry, IJavaProject project) {
1850
	public IClasspathEntry[] getReferencedClasspathEntries(IClasspathEntry libraryEntry, IJavaProject project) {
1851
		
1851
		
1852
		IClasspathEntry[] referencedEntries = ((ClasspathEntry)libraryEntry).resolvedChainedLibraries();
1852
		IClasspathEntry[] referencedEntries = ((ClasspathEntry)libraryEntry).resolvedChainedLibraries();
1853
		PerProjectInfo perProjectInfo = getPerProjectInfo(project.getProject(), false);
1854
		
1853
		
1854
		if (project == null)
1855
			return referencedEntries;
1856
		
1857
		PerProjectInfo perProjectInfo = getPerProjectInfo(project.getProject(), false);
1855
		if(perProjectInfo == null) 
1858
		if(perProjectInfo == null) 
1856
			return referencedEntries;
1859
			return referencedEntries;
1857
		
1860
		
(-)src/org/eclipse/jdt/core/tests/model/ClasspathTests.java (-1 / +7 lines)
Lines 6157-6167 Link Here
6157
6157
6158
		// Test referenced entries for a particular entry appear in the right order and the referencingEntry
6158
		// Test referenced entries for a particular entry appear in the right order and the referencingEntry
6159
		// attribute has the correct value
6159
		// attribute has the correct value
6160
		IClasspathEntry[] chains = JavaCore.getReferencedClasspathEntries(rawClasspath[2], p);
6160
		IClasspathEntry[] chains = JavaCore.getReferencedClasspathEntries(rawClasspath[2], null);
6161
		assertClasspathEquals(chains, 
6161
		assertClasspathEquals(chains, 
6162
				"/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" + 
6162
				"/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" + 
6163
				"/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
6163
				"/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
6164
6164
6165
		chains = JavaCore.getReferencedClasspathEntries(rawClasspath[2], p);
6166
		assertClasspathEquals(chains, 
6167
				"/P/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:true]\n" + 
6168
				"/P/lib3.jar[CPE_LIBRARY][K_BINARY][isExported:true]");
6169
6170
		
6165
		assertSame("Referencing Entry", rawClasspath[2], chains[0].getReferencingEntry());
6171
		assertSame("Referencing Entry", rawClasspath[2], chains[0].getReferencingEntry());
6166
		assertSame("Referencing Entry", rawClasspath[2], chains[1].getReferencingEntry());
6172
		assertSame("Referencing Entry", rawClasspath[2], chains[1].getReferencingEntry());
6167
		
6173
		

Return to bug 306519