}
ISourceLocator locator = launch.getSourceLocator();
if (locator == null) {
return null;
}
IJavaDebugTarget target = (IJavaDebugTarget) frame.getDebugTarget();
String def = target.getDefaultStratum();
target.setDefaultStratum("Java"); //$NON-NLS-1$
Object sourceElement = locator.getSourceElement(frame);
target.setDefaultStratum(def);
if (!(sourceElement instanceof IJavaElement)
&& sourceElement instanceof IAdaptable) {
sourceElement = ((IAdaptable) sourceElement)
.getAdapter(IJavaElement.class);
}