final String fieldName = currentGetFieldIns.getName(cpg);
final String signature = currentGetFieldIns.getFieldType(cpg).
toString() + " " + fieldName;
final Type joinPointType = TransformationUtil.MEMBER_FIELD_SET_JOIN_POINT_TYPE;
FieldMetaData fieldMetaData =
BcelMetaDataMaker.createFieldMetaData(currentGetFieldIns, cpg);
String uuid = setFieldFilter(definition, classMetaData, fieldMetaData);
// do we have to set a joinpoint ?
if (uuid != null) {
final String fieldClassName = currentGetFieldIns.getClassName(cpg);
if (fieldClassName.equals(cg.getClassName())) {
isMethodAdvised = true;
insertPreAdvice(
il, ih, cg, fieldName,
factory, joinPointType);
insertPostAdvice(
il, ih.getNext().getNext(), cg,
fieldName, factory, joinPointType);
// store the join point field data
JoinPointFieldData data = new JoinPointFieldData(
fieldName, signature, joinPointType, uuid);
if (!setFieldJoinPoints.contains(data)) {
setFieldJoinPoints.add(data);
}
// add one step more to the InstructionList (GETFIELD(current) INVOKEINTERFACE with jp)
ih = ih.getNext();
ins = ih.getInstruction();
}
}
}
}
}
}
}
// handle the getField instructions
// (if we have set a getfield for collection modification jp the ins has been altered)
if (ins instanceof GETFIELD) {
final FieldInstruction gfIns = (FieldInstruction)ins;
String fieldName = gfIns.getName(cpg);
String signature = gfIns.getFieldType(cpg).toString() + " " + fieldName;
Type joinPointType = TransformationUtil.MEMBER_FIELD_GET_JOIN_POINT_TYPE;
FieldMetaData fieldMetaData = BcelMetaDataMaker.createFieldMetaData(gfIns, cpg);
String uuid = getFieldFilter(definition, classMetaData, fieldMetaData);
if (uuid != null) {
final String fieldClassName = gfIns.getClassName(cpg);
if (fieldClassName.equals(cg.getClassName())) {
isMethodAdvised = true;
insertPreAdvice(
il, ih, cg, fieldName,
factory, joinPointType);
insertPostAdvice(
il, ih.getNext(), cg,
fieldName, factory, joinPointType);
// store the join point field data
JoinPointFieldData data = new JoinPointFieldData(
fieldName, signature, joinPointType, uuid);
if (!getFieldJoinPoints.contains(data)) {
getFieldJoinPoints.add(data);
}
}
}
}
// handle the setField instructions
else if (ins instanceof PUTFIELD) {
final FieldInstruction pfIns = (FieldInstruction)ins;
String fieldName = pfIns.getName(cpg);
String signature = pfIns.getFieldType(cpg).toString() + " " + fieldName;
Type joinPointType = TransformationUtil.MEMBER_FIELD_SET_JOIN_POINT_TYPE;
FieldMetaData fieldMetaData =
BcelMetaDataMaker.createFieldMetaData(pfIns, cpg);
String uuid = setFieldFilter(definition, classMetaData, fieldMetaData);
if (uuid != null) {