Skip to content

Commit

Permalink
Classpath calculation wrong for binary annotations
Browse files Browse the repository at this point in the history
During classId validation the classpath calculation was wrong for binary
annotations because they are no IMember.
  • Loading branch information
mvilliger committed Mar 17, 2017
1 parent 0137ea0 commit 813b600
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,27 +582,9 @@ public static boolean exists(IJavaElement element) {
* @return <code>true</code> if element was found in the classpath of project, <code>false</code> otherwise.
*/
public static boolean isOnClasspath(IJavaElement element, IJavaProject project) {
if (!exists(element)) {
if (!exists(element) || !exists(project)) {
return false;
}
if (!exists(project)) {
return false;
}

if (element instanceof IMember) {
IMember member = (IMember) element;
if (member.isBinary()) {
return project.isOnClasspath(member);
}
}

IJavaProject elemenProject = element.getJavaProject();
if (elemenProject != null) {
if (project.equals(elemenProject)) {
return true;
}
return project.isOnClasspath(elemenProject);
}
return project.isOnClasspath(element);
}

Expand Down

0 comments on commit 813b600

Please sign in to comment.