edu.rice.cs.cunit.threadCheck.predicates
Class NotReflectionThreadCheckPredicates

java.lang.Object
  extended by edu.rice.cs.cunit.threadCheck.predicates.NotReflectionThreadCheckPredicates

public class NotReflectionThreadCheckPredicates
extends java.lang.Object

Class containing several common predicates for the @Not* annotations that use reflection.

Author:
Mathias Ricken

Constructor Summary
NotReflectionThreadCheckPredicates()
           
 
Method Summary
static boolean checkGroup(java.lang.Object thisObject, java.lang.Class fieldClass, java.lang.String fieldName)
          Return false if the current thread's group name is equal to the string in the specified field.
static boolean checkGroupByName(java.lang.Object thisObject, java.lang.String fieldClassName, java.lang.String fieldName)
          Return true if the current thread's group name is equal to the string in the specified field.
static boolean checkName(java.lang.Object thisObject, java.lang.Class fieldClass, java.lang.String fieldName)
          Return false if the current thread's name is equal to the string in the specified field.
static boolean checkNameByName(java.lang.Object thisObject, java.lang.String fieldClassName, java.lang.String fieldName)
          Return true if the current thread's name is equal to the string in the specified field.
static boolean checkSynchronizedField(java.lang.Object thisObject, java.lang.Class fieldClass, java.lang.String fieldName)
          Return false if the current thread owns the monitor of the specified field.
static boolean checkSynchronizedFieldByAnyThread(java.lang.Object thisObject, java.lang.Class fieldClass, java.lang.String fieldName)
          Return false if any thread owns the monitor of the specified field.
static boolean checkSynchronizedFieldByAnyThreadByName(java.lang.Object thisObject, java.lang.String fieldClassName, java.lang.String fieldName)
          Return false if any thread owns the monitor of the specified field.
static boolean checkSynchronizedFieldByName(java.lang.Object thisObject, java.lang.String fieldClassName, java.lang.String fieldName)
          Return false if the current thread owns the monitor of the specified field.
static boolean checkThread(java.lang.Object thisObject, java.lang.Class fieldClass, java.lang.String fieldName)
          Return false if the current thread is equal to the thread in the specified field.
static boolean checkThreadByName(java.lang.Object thisObject, java.lang.String fieldClassName, java.lang.String fieldName)
          Return false if the current thread is equal to the thread in the specified field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotReflectionThreadCheckPredicates

public NotReflectionThreadCheckPredicates()
Method Detail

checkThread

public static boolean checkThread(java.lang.Object thisObject,
                                  java.lang.Class fieldClass,
                                  java.lang.String fieldName)
Return false if the current thread is equal to the thread in the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClass - the class the field is in
fieldName - the name of the field
Returns:
false if the current thread is equal to the thread in the specified field

checkName

public static boolean checkName(java.lang.Object thisObject,
                                java.lang.Class fieldClass,
                                java.lang.String fieldName)
Return false if the current thread's name is equal to the string in the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClass - the class the field is in
fieldName - the name of the field
Returns:
false if the current thread's name is equal to the string in the specified field

checkGroup

public static boolean checkGroup(java.lang.Object thisObject,
                                 java.lang.Class fieldClass,
                                 java.lang.String fieldName)
Return false if the current thread's group name is equal to the string in the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClass - the class the field is in
fieldName - the name of the field
Returns:
false if the current thread's group name is equal to the string in the specified field

checkThreadByName

public static boolean checkThreadByName(java.lang.Object thisObject,
                                        java.lang.String fieldClassName,
                                        java.lang.String fieldName)
Return false if the current thread is equal to the thread in the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClassName - the name of the class the field is in
fieldName - the name of the field
Returns:
false if the current thread is equal to the thread in the specified field

checkNameByName

public static boolean checkNameByName(java.lang.Object thisObject,
                                      java.lang.String fieldClassName,
                                      java.lang.String fieldName)
Return true if the current thread's name is equal to the string in the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClassName - the name of the class the field is in
fieldName - the name of the field
Returns:
true if the current thread's name is equal to the string in the specified field

checkGroupByName

public static boolean checkGroupByName(java.lang.Object thisObject,
                                       java.lang.String fieldClassName,
                                       java.lang.String fieldName)
Return true if the current thread's group name is equal to the string in the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClassName - the name of the class the field is in
fieldName - the name of the field
Returns:
true if the current thread's group name is equal to the string in the specified field

checkSynchronizedField

public static boolean checkSynchronizedField(java.lang.Object thisObject,
                                             java.lang.Class fieldClass,
                                             java.lang.String fieldName)
Return false if the current thread owns the monitor of the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClass - the class the field is in
fieldName - the name of the field
Returns:
false if the current thread owns the monitor of the specified field

checkSynchronizedFieldByName

public static boolean checkSynchronizedFieldByName(java.lang.Object thisObject,
                                                   java.lang.String fieldClassName,
                                                   java.lang.String fieldName)
Return false if the current thread owns the monitor of the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClassName - the name of the class the field is in
fieldName - the name of the field
Returns:
false if the current thread owns the monitor of the specified field

checkSynchronizedFieldByAnyThread

public static boolean checkSynchronizedFieldByAnyThread(java.lang.Object thisObject,
                                                        java.lang.Class fieldClass,
                                                        java.lang.String fieldName)
Return false if any thread owns the monitor of the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClass - the class the field is in
fieldName - the name of the field
Returns:
false if the any thread owns the monitor of the specified field

checkSynchronizedFieldByAnyThreadByName

public static boolean checkSynchronizedFieldByAnyThreadByName(java.lang.Object thisObject,
                                                              java.lang.String fieldClassName,
                                                              java.lang.String fieldName)
Return false if any thread owns the monitor of the specified field.

Parameters:
thisObject - "this" at the time of the check, or null if not available; ignored by this method
fieldClassName - the name of the class the field is in
fieldName - the name of the field
Returns:
false if any thread owns the monitor of the specified field