* @return return null if type is not known or bytecode is not written or cannot be
* found
*/
private DecompiledClass decompileBytecode(IJavaElement childEl) {
// check here for inner classes too
IJavaElement type = JdtUtils.getEnclosingType(childEl);
if (type == null) {
type = javaInput;
}
if (type == null) {
return null;
}
InputStream is = JdtUtils.createInputStream(type);
if (is == null) {
return null;
}
DecompiledClass decompiledClass = null;
int available = 0;
try {
ClassLoader cl = null;
if (modes.get(BCOConstants.F_SHOW_ANALYZER)) {
cl = JdtUtils.getClassLoader(type);
}
String fieldName = null;
String methodName = null;
/*
* find out, which name we should use for selected element
*/
if (modes.get(BCOConstants.F_SHOW_ONLY_SELECTED_ELEMENT)
&& childEl != null) {
if (childEl.getElementType() == IJavaElement.FIELD) {
fieldName = childEl.getElementName();
} else {
methodName = JdtUtils.getMethodSignature(childEl);
}
}
available = is.available();
decompiledClass = DecompilerClassVisitor.getDecompiledClass(
is, fieldName, methodName, modes, cl);
} catch (Exception e) {
try {
// check if compilation unit is ok - then this is the user problem
if (type.isStructureKnown()) {
BytecodeOutlinePlugin.error("Cannot decompile: " + type, e);
} else {
BytecodeOutlinePlugin.log(e, IStatus.ERROR);
}
} catch (JavaModelException e1) {