예제 #1
0
파일: Debug.java 프로젝트: rjsingh/graal
 /**
  * Searches the current debug scope, bottom up, for a context object that is an instance of a
  * given type. The first such object found is returned.
  */
 @SuppressWarnings("unchecked")
 public static <T> T contextLookup(Class<T> clazz) {
   if (ENABLED) {
     for (Object o : context()) {
       if (clazz.isInstance(o)) {
         return ((T) o);
       }
     }
   }
   return null;
 }
예제 #2
0
파일: Debug.java 프로젝트: rjsingh/graal
 @SuppressWarnings("unchecked")
 public static <T> List<T> contextSnapshot(Class<T> clazz) {
   if (ENABLED) {
     List<T> result = new ArrayList<>();
     for (Object o : context()) {
       if (clazz.isInstance(o)) {
         result.add((T) o);
       }
     }
     return result;
   } else {
     return Collections.emptyList();
   }
 }