// -1+1=0, so str.substring(0)
// == str
// Get the source file attribute
ArrayList classAttributes = classBands.getClassAttributes()[classNum];
SourceFileAttribute sourceFileAttribute = null;
for (int index = 0; index < classAttributes.size(); index++) {
if (((Attribute) classAttributes.get(index))
.isSourceFileAttribute()) {
sourceFileAttribute = ((SourceFileAttribute) classAttributes
.get(index));
}
}
if (sourceFileAttribute == null) {
// If we don't have a source file attribute yet, we need
// to infer it from the class.
AttributeLayout SOURCE_FILE = attrDefinitionBands
.getAttributeDefinitionMap().getAttributeLayout(
AttributeLayout.ATTRIBUTE_SOURCE_FILE,
AttributeLayout.CONTEXT_CLASS);
if (SOURCE_FILE.matches(classBands.getRawClassFlags()[classNum])) {
int firstDollar = SegmentUtils.indexOfFirstDollar(fullName);
String fileName = null;
if (firstDollar > -1 && (i <= firstDollar)) {
fileName = fullName.substring(i, firstDollar) + ".java";
} else {
fileName = fullName.substring(i) + ".java";
}
sourceFileAttribute = new SourceFileAttribute(cpBands
.cpUTF8Value(fileName, false));
classFile.attributes = new Attribute[] { (Attribute) cp
.add(sourceFileAttribute) };
} else {
classFile.attributes = new Attribute[] {};