|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.cunit.instrumentors.threadCheck.AThreadCheckStrategy
public abstract class AThreadCheckStrategy
Abstract instrumentor with core routines.
Nested Class Summary | |
---|---|
static class |
AThreadCheckStrategy.SharedData
Data shared among all AAddThreadCheckStrategy instances. |
Field Summary | |
---|---|
(package private) AThreadCheckStrategy.SharedData |
_sharedData
Data shared among all AThreadCheckStrategy instances. |
static java.lang.String |
CLASS_PATH_PARAM_PREFIX
Prefix for the parameter that determines the paths to consider when searching. |
static java.lang.String |
CLASS_SIG_SEPARATOR_STRING
The separator string between class name and method signature. |
static java.lang.String |
DEFAULT_XML_CONC_DEF_PATH_PREFIX
Default XML path prefix before for concurrency definitions. |
static java.lang.String |
DEFAULT_XML_PATH_PREFIX
Default XML path prefix before the class name. |
static java.lang.String |
UPDATE_PARAM_ORDER_PREFIX
Prefix for the parameter that specifies whether the method attribute of a @PredicateLink annotation gets updated to include the order of the parameters. |
static java.lang.String |
XML_ANNOT_FORMAT_PARAM
The parameter that determines that the XML file will be written out using concurrency definitions, i.e. |
static java.lang.String |
XML_ANNOT_PARAM_PREFIX
Prefix for the parameter that determines the XML file that contains additional annotations. |
Constructor Summary | |
---|---|
AThreadCheckStrategy(java.util.List<java.lang.String> parameters,
AThreadCheckStrategy.SharedData shared)
Constructor for this strategy. |
Method Summary | |
---|---|
protected void |
checkCombineMembers(ClassFile annotCF,
boolean passMethods)
Check that the members of the annotation class file are all Thread Checker annotations or arrays thereof. |
protected void |
checkPredicateMembers(ClassFile annotCF,
boolean passMethods)
Check that the members of the annotation class do not contain annotations or arrays of annotations |
protected boolean |
checkPublicStaticIfNestedClass(ClassFile predicateCF,
ClassFile cf)
Check that the class file, should it be a nested class and not a top-level class, is public static, and the same applies to all its enclosing classes. |
void |
done()
Instrumentation of all classes is done. |
protected void |
extractAnnotationArray(AAnnotationsAttributeInfo.Annotation.AMemberValue mv,
java.util.HashSet<java.lang.String> threadNames,
java.util.HashSet<java.lang.Long> threadIds,
java.util.HashSet<java.lang.String> threadGroups,
Ref<OnlyRunBy.EVENT_THREAD> eventThread)
Extract the data in the annotation's string array and put it in the set of strings. |
protected void |
extractLists(java.lang.String typeName,
java.util.ArrayList<AAttributeInfo> attributesList,
java.util.HashSet<java.lang.String> threadNames,
java.util.HashSet<java.lang.Long> threadIds,
java.util.HashSet<java.lang.String> threadGroups,
Ref<OnlyRunBy.EVENT_THREAD> eventThread)
Extract the lists of thread names, ids and groups from a list of attributes. |
protected void |
extractLongArray(AAnnotationsAttributeInfo.Annotation.AMemberValue mv,
java.util.HashSet<java.lang.Long> set)
Extract the data in the annotation's long array and put it in the set of longs. |
protected void |
extractPredicateSet(java.util.ArrayList<AAttributeInfo> attributesList,
java.util.ArrayList<PredicateAnnotationRecord> predicateSet,
java.lang.String methodSig)
Extract the list of predicate annotation records. |
protected void |
extractStringArray(AAnnotationsAttributeInfo.Annotation.AMemberValue mv,
java.util.HashSet<java.lang.String> set)
Extract the data in the annotation's string array and put it in the set of strings. |
protected boolean |
getAnnotationClassFile(java.lang.String annotType,
Ref<ClassFileTools.ClassLocation> refCL,
Ref<AAnnotationsAttributeInfo.Annotation> predicateLink,
Ref<AAnnotationsAttributeInfo.Annotation> combineAnnot)
Return the annotations class file, or null if it is not a Thread Checker annotation. |
protected AAnnotationsAttributeInfo.Annotation |
getCombineMode(java.util.ArrayList<AAttributeInfo> attributesList)
Return the combine attribute, or null if not found |
protected PredicateAnnotationRecord |
getPredicateAnnotationRecord(AAnnotationsAttributeInfo.Annotation annot,
ClassFileTools.ClassLocation annotCL,
ClassFile predicateCF,
java.lang.String predicateMethod,
Combine.Mode combineMode,
boolean passArguments)
Return the method info for the predicate method, or null if not found. |
protected AAnnotationsAttributeInfo.Annotation |
getPredicateLink(java.util.ArrayList<AAttributeInfo> attributesList)
Return the predicate link, or null if not found |
protected void |
includePredicateMethodParameterOrder(java.lang.String predicateMethod,
java.util.ArrayList<java.lang.String> paramNames,
ClassFileTools.ClassLocation annotCL)
Update the method attribute in the @PredicateLink to include the parameter order. |
protected PredicateAnnotationRecord |
processAnnotation(AAnnotationsAttributeInfo.Annotation annot)
Process the specified annotation and return a PredicateAnnotationRecord if the annotation is a Thread Checker predicate annotation, or null otherwise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.rice.cs.cunit.instrumentors.IInstrumentationStrategy |
---|
instrument |
Field Detail |
---|
public static final java.lang.String CLASS_PATH_PARAM_PREFIX
public static final java.lang.String DEFAULT_XML_PATH_PREFIX
public static final java.lang.String DEFAULT_XML_CONC_DEF_PATH_PREFIX
public static final java.lang.String XML_ANNOT_PARAM_PREFIX
public static final java.lang.String XML_ANNOT_FORMAT_PARAM
public static final java.lang.String UPDATE_PARAM_ORDER_PREFIX
public static final java.lang.String CLASS_SIG_SEPARATOR_STRING
AThreadCheckStrategy.SharedData _sharedData
Constructor Detail |
---|
public AThreadCheckStrategy(java.util.List<java.lang.String> parameters, AThreadCheckStrategy.SharedData shared)
parameters
- parameters for the instrumentorsshared
- data shared among all AThreadCheckStrategy instancesMethod Detail |
---|
protected void extractLists(java.lang.String typeName, java.util.ArrayList<AAttributeInfo> attributesList, java.util.HashSet<java.lang.String> threadNames, java.util.HashSet<java.lang.Long> threadIds, java.util.HashSet<java.lang.String> threadGroups, Ref<OnlyRunBy.EVENT_THREAD> eventThread)
typeName
- name of the annotation typeattributesList
- list of attributesthreadNames
- the set of thread names to fillthreadIds
- the set of thread ids to fillthreadGroups
- the set of thread groups to filleventThread
- mutable flag for checking the event threadprotected void extractAnnotationArray(AAnnotationsAttributeInfo.Annotation.AMemberValue mv, java.util.HashSet<java.lang.String> threadNames, java.util.HashSet<java.lang.Long> threadIds, java.util.HashSet<java.lang.String> threadGroups, Ref<OnlyRunBy.EVENT_THREAD> eventThread)
mv
- member value, i.e. the string arraythreadNames
- the set of thread names to fillthreadIds
- the set of thread ids to fillthreadGroups
- the set of thread groups to filleventThread
- mutable flag for checking the event threadprotected void extractStringArray(AAnnotationsAttributeInfo.Annotation.AMemberValue mv, java.util.HashSet<java.lang.String> set)
mv
- member value, i.e. the string arrayset
- set to contain the stringsprotected void extractLongArray(AAnnotationsAttributeInfo.Annotation.AMemberValue mv, java.util.HashSet<java.lang.Long> set)
mv
- member value, i.e. the long arrayset
- set to contain the longsprotected void extractPredicateSet(java.util.ArrayList<AAttributeInfo> attributesList, java.util.ArrayList<PredicateAnnotationRecord> predicateSet, java.lang.String methodSig)
attributesList
- list of attributespredicateSet
- list of predicate annotation records to createmethodSig
- method signatureprotected AAnnotationsAttributeInfo.Annotation getPredicateLink(java.util.ArrayList<AAttributeInfo> attributesList)
attributesList
- list of attributes
protected AAnnotationsAttributeInfo.Annotation getCombineMode(java.util.ArrayList<AAttributeInfo> attributesList)
attributesList
- list of attributes
protected PredicateAnnotationRecord processAnnotation(AAnnotationsAttributeInfo.Annotation annot)
annot
- annotation to process
protected boolean getAnnotationClassFile(java.lang.String annotType, Ref<ClassFileTools.ClassLocation> refCL, Ref<AAnnotationsAttributeInfo.Annotation> predicateLink, Ref<AAnnotationsAttributeInfo.Annotation> combineAnnot)
annotType
- class name of the annotation, in the form "Ljava/lang/Object;"refCL
- reference to the class file; will get filled in by this methodpredicateLink
- reference to the predicate link; will get filled in by this methodcombineAnnot
- reference to the combine annotation; will get filled in by this method
protected PredicateAnnotationRecord getPredicateAnnotationRecord(AAnnotationsAttributeInfo.Annotation annot, ClassFileTools.ClassLocation annotCL, ClassFile predicateCF, java.lang.String predicateMethod, Combine.Mode combineMode, boolean passArguments)
annot
- the annotation linked to the predicateannotCL
- class file location for the annotation linked to the predicatepredicateCF
- class file for the class containing the predicate method, or null if not specifiedpredicateMethod
- name of the predicate methodcombineMode
- mode to combine results from several predicatespassArguments
- whether method arguments should be passed as well
protected boolean checkPublicStaticIfNestedClass(ClassFile predicateCF, ClassFile cf)
predicateCF
- original predicate class file for which this check is performed; does not change in recursioncf
- class file to check
BadPredicateAnnotationWarning
protected void checkCombineMembers(ClassFile annotCF, boolean passMethods)
annotCF
- annotation class fileprotected void checkPredicateMembers(ClassFile annotCF, boolean passMethods)
annotCF
- annotation class filepassMethods
- whether method arguments should be passed ass wellprotected void includePredicateMethodParameterOrder(java.lang.String predicateMethod, java.util.ArrayList<java.lang.String> paramNames, ClassFileTools.ClassLocation annotCL)
predicateMethod
- name of the predicate methodparamNames
- order of the parameters, ignoring the first "Object thisO" parameterannotCL
- class file location of the annotationpublic void done()
done
in interface IInstrumentationStrategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |