Пример #1
0
 static ReferenceType getReferenceTypeFromToken(String idToken) {
   ReferenceType cls = null;
   if (Character.isDigit(idToken.charAt(0))) {
     cls = null;
   } else if (idToken.startsWith("*.")) {
     // This notation saves typing by letting the user omit leading
     // package names. The first
     // loaded class whose name matches this limited regular
     // expression is selected.
     idToken = idToken.substring(1);
     for (ReferenceType type : Env.vm().allClasses()) {
       if (type.name().endsWith(idToken)) {
         cls = type;
         break;
       }
     }
   } else {
     // It's a class name
     List<ReferenceType> classes = Env.vm().classesByName(idToken);
     if (classes.size() > 0) {
       // TO DO: handle multiples
       cls = classes.get(0);
     }
   }
   return cls;
 }
Пример #2
0
 static ThreadGroupReference group() {
   if (group == null) {
     // Current thread group defaults to the first top level
     // thread group.
     setThreadGroup((ThreadGroupReference) Env.vm().topLevelThreadGroups().get(0));
   }
   return group;
 }
Пример #3
0
 private static void initThreads() {
   if (!gotInitialThreads) {
     Iterator iter = Env.vm().allThreads().iterator();
     while (iter.hasNext()) {
       ThreadReference thread = (ThreadReference) iter.next();
       threads.add(new ThreadInfo(thread));
     }
     gotInitialThreads = true;
   }
 }