if(element instanceof IResource) {
return (IResource) element;
}</BUG>
if(element instanceof IJavaElement) {
return ((IJavaElement) element).getResource();
<BUG>}
if(element instanceof IAdaptable) {
return (IResource) ((IAdaptable) element).getAdapter(IResource.class);</BUG>
}
<BUG>return null;</BUG>
}
<BUG>}</BUG>

if(adapter instanceof IPackageFragment){
return new WorkItem((IPackageFragment) element);
}
}
return null;
}
@javax.annotation.CheckForNull
public static IResource getResource(Object element) {
if(element instanceof IJavaElement) {
return ((IJavaElement) element).getResource();
