Esempio n. 1
0
 private static void tryCatch(Buffer b, Class<?> ex, Runnable thunk) {
   boolean caught = false;
   try {
     thunk.run();
   } catch (Throwable x) {
     if (ex.isAssignableFrom(x.getClass())) {
       caught = true;
     } else {
       fail(x.getMessage() + " not expected");
     }
   }
   if (!caught) fail(ex.getName() + " not thrown", b);
 }
Esempio n. 2
0
 /** Does the <code>DataFlavor</code> represent a <code>java.io.InputStream</code>? */
 public boolean isRepresentationClassInputStream() {
   return ioInputStreamClass.isAssignableFrom(representationClass);
 }