* @version 1.0
* @since 2015-12-01
*/
-public class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opcodes {
+public final class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opcodes {
/**
* ClassRuntimeInstrumenterMaster class properties
* ClassRuntimeInstrumenterMaster class constants
*/
private static final int INT_NUM_CLASS_TYPE = 3;
- private static final String STR_IOT_ANNOTATION_SIGNATURE = "Liotchecker/qual/config;";
+ //private static final String STR_IOT_ANNOTATION_SIGNATURE = "Liotchecker/qual/config;";
+ private static final String STR_IOT_ANNOTATION_SIGNATURE = "Liotcode/annotation/config;";
private static final String STR_IOT_SET_SIGNATURE = "Liotruntime/slave/IoTSet;";
private static final String STR_IOT_RELATION_SIGNATURE = "Liotruntime/slave/IoTRelation;";
private static final String STR_IOT_CONSTRAINT_SIGNATURE = "Liotcode/annotation/constraint;";
super.visit(version, access, name, signature, superName, interfaces);
}
- /**
- * Visit class annotation
- */
- @Override
- public AnnotationVisitor visitAnnotation(String desc,
- boolean visible) {
-
- return super.visitAnnotation(desc, visible);
- }
-
/**
* Make a visit to a field.
*/
* 5) Initialize the field of the instrumented class objects with actual field objects
* 6) Run the init() function of the instrumented class
*
- * @param typeRef int
- * @param typePath TypePath
* @param desc String
* @param visible boolean
* @return AnnotationVisitor
* This method visits annotation that is meta-annotated as TYPE_USE, so we can instrument @config here
*/
@Override
- public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath,
- String desc, boolean visible) {
+ public AnnotationVisitor visitAnnotation(String desc,
+ boolean visible) {
- //RuntimeOutput.print("ClassRuntimeInstrumenterMaster@AnnotationTypeVisitor: " + desc, bVerbose);
+ RuntimeOutput.print("ClassRuntimeInstrumenterMaster@AnnotationVisitor: " + desc, bVerbose);
// Check annotation description @config
if(desc.equals(STR_IOT_ANNOTATION_SIGNATURE)) {
throw new Error("ClassRuntimeInstrumenterMaster@AnnotationTypeVisitor: " + strFieldDesc + " not recognized!");
}
}
- return super.visitTypeAnnotation(typeRef, typePath, desc, visible);
+ return super.visitAnnotation(desc, visible);
}
}
}
} catch (IOException ex) {
- System.out.println("ClassRuntimeInstrumenterMaster@RunInstrumentation: IOException: "
- + ex.getMessage());
+ System.out.println("ClassRuntimeInstrumenterMaster@RunInstrumentation: IOException: " + ex.getMessage());
ex.printStackTrace();
}
}