/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
* Ananlyzes Java Class files
* Created on September 23, 2005
*
* @author Chandan
* @author Lubos Kosco , January 2010 , updated bcel, comment on thread safety
*/
/** Creates a new instance of JavaClassAnalyzer
* @param factory The factory that creates JavaClassAnalyzers
*/
super(factory);
}
private JavaClass c;
/**
* {@inheritDoc}
*/
c = classparser.parse();
}
}
/**
* Gt the generated cross file content.
* @return {@code null} as long as no analyze has been run, the result of
* the analayzing phase otherwise.
*/
return xref;
}
private int[] v;
/**
* {@inheritDoc}
*/
}
}
/**
* Get a HTML anchor for the given path.
* @param path path in question.
* @return a string like <a href="$prefix?path=$path">$path</a>
*/
}
/**
* Get a HTML anchor for the given symbol.
* @param def symbol in question.
* @return a string like <a href="$prefix?defs=$def">$def</a>
*/
}
/**
* Get a HTML anchor for the given symbol.
* @param def symbol in question.
* @return a string like <a class="d" name="$def"
* href="$prefix?defs=$def">$def</a>
*/
}
// TODO this class needs to be thread safe to avoid bug 13364, which was
// fixed by just updating bcel to 5.2
String t;
cp = c.getConstantPool();
}
v[c.getClassNameIndex()] = 1;
v[c.getSuperclassNameIndex()] = 1;
for (int i : c.getInterfaceIndices()) {
v[i] = 1;
}
}
}
for (Attribute a : c.getAttributes()) {
{
printLocal(out, l);
}
}
}
v[a.getNameIndex()] = 1;
break;
}
}
}
// @TODO show Attributes
}
}
if (spi > 0) {
}
}
}
for (Attribute a : m.getAttributes()) {
for (int i : ((ExceptionTable) a).getExceptionIndexTable()) {
v[i] = 1;
}
}
}
}
}
}
}
for (LocalVariable l : ls) {
printLocal(out, l);
}
}
}
}
if (v[i] != 1) {
}
}
}
}
/**
* Write a cross referenced HTML file.
* @param out Writer to write HTML cross-reference
*/
}
}
v[l.getIndex()] = 1;
v[l.getNameIndex()] = 1;
v[l.getSignatureIndex()] = 1;
String t;
}
}
/**
* Convert a BCEL constant to a proper string.
* @param c constant to convert.
* @return the converted string
* @throws ClassFormatException
*/
int i, j;
switch (tag) {
case Constants.CONSTANT_Class:
i = ((ConstantClass) c).getNameIndex();
v[i] = 1;
break;
case Constants.CONSTANT_String:
i = ((ConstantString) c).getStringIndex();
v[i] = 1;
break;
case Constants.CONSTANT_Utf8:
break;
case Constants.CONSTANT_Double:
break;
case Constants.CONSTANT_Float:
break;
case Constants.CONSTANT_Long:
break;
case Constants.CONSTANT_Integer:
break;
i = ((ConstantNameAndType) c).getNameIndex();
v[i] = 1;
j = ((ConstantNameAndType) c).getSignatureIndex();
v[j] = 1;
} else {
}
//str = constantToString(cp.getConstant(i)) +' ' + sig;
break;
case Constants.CONSTANT_Methodref:
case Constants.CONSTANT_Fieldref:
i = ((ConstantCP) c).getClassIndex();
v[i] = 1;
j = ((ConstantCP) c).getNameAndTypeIndex();
v[j] = 1;
break;
default: // Never reached
}
return str;
}
}