Lines 649-690
Link Here
|
649 |
} |
649 |
} |
650 |
|
650 |
|
651 |
if (root.getKind() == IPackageFragmentRoot.K_BINARY) { |
651 |
if (root.getKind() == IPackageFragmentRoot.K_BINARY) { |
652 |
IClasspathEntry entry= root.getRawClasspathEntry(); |
652 |
IClasspathEntry entry= null; |
|
|
653 |
try { |
654 |
entry= root.getResolvedClasspathEntry(); |
655 |
URL url = getLibraryJavadocLocation(entry); |
656 |
if (url != null) { |
657 |
return url; |
658 |
} |
659 |
} |
660 |
catch(JavaModelException jme) { |
661 |
// Proceed with raw classpath |
662 |
} |
663 |
|
664 |
entry= root.getRawClasspathEntry(); |
653 |
if (entry == null) { |
665 |
if (entry == null) { |
654 |
return null; |
666 |
return null; |
655 |
} |
667 |
} |
656 |
if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { |
|
|
657 |
entry= getRealClasspathEntry(root.getJavaProject(), entry.getPath(), root.getPath()); |
658 |
if (entry == null) { |
659 |
return null; |
660 |
} |
661 |
} |
662 |
return getLibraryJavadocLocation(entry); |
668 |
return getLibraryJavadocLocation(entry); |
663 |
} |
669 |
} |
664 |
return null; |
670 |
return null; |
665 |
} |
671 |
} |
666 |
|
672 |
|
667 |
private static IClasspathEntry getRealClasspathEntry(IJavaProject jproject, IPath containerPath, IPath libPath) throws JavaModelException { |
|
|
668 |
IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject); |
669 |
if (container != null) { |
670 |
IClasspathEntry[] entries= container.getClasspathEntries(); |
671 |
for (int i= 0; i < entries.length; i++) { |
672 |
IClasspathEntry curr = entries[i]; |
673 |
if (curr == null) { |
674 |
if (JavaModelManager.CP_RESOLVE_VERBOSE || JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) { |
675 |
JavaModelManager.getJavaModelManager().verbose_missbehaving_container(jproject, containerPath, entries); |
676 |
} |
677 |
break; |
678 |
} |
679 |
IClasspathEntry resolved= JavaCore.getResolvedClasspathEntry(curr); |
680 |
if (resolved != null && libPath.equals(resolved.getPath())) { |
681 |
return curr; // return the real entry |
682 |
} |
683 |
} |
684 |
} |
685 |
return null; // not found |
686 |
} |
687 |
|
688 |
protected static URL getLibraryJavadocLocation(IClasspathEntry entry) throws JavaModelException { |
673 |
protected static URL getLibraryJavadocLocation(IClasspathEntry entry) throws JavaModelException { |
689 |
switch(entry.getEntryKind()) { |
674 |
switch(entry.getEntryKind()) { |
690 |
case IClasspathEntry.CPE_LIBRARY : |
675 |
case IClasspathEntry.CPE_LIBRARY : |