use of org.apache.bcel.classfile.Synthetic in project jop by jop-devel.
the class MemberInfo method setSynthetic.
////////////////////////////////////////////////////////////////////////////
// Attribute access and helpers for custom attributes
////////////////////////////////////////////////////////////////////////////
public void setSynthetic(boolean flag) {
// from major version 49 on, ACC_SYNTHETIC is supported
Synthetic s = findSynthetic();
if (getClassInfo().getMajor() < 49) {
if (flag) {
if (s == null) {
ConstantPoolGen cpg = getClassInfo().getConstantPoolGen();
int index = cpg.addUtf8("Synthetic");
addAttribute(new Synthetic(index, 0, new byte[0], cpg.getConstantPool()));
}
} else {
if (s != null) {
removeAttribute(s);
}
}
} else {
accessFlags.isSynthetic(flag);
if (!flag && s != null) {
removeAttribute(s);
}
}
}
Aggregations