Beispiel #1
0
 @Override
 Expr opt(final QueryContext ctx, final VarScope scp) throws QueryException {
   if (sig == Function._UNIT_TEST_URIS || sig == Function._UNIT_TEST && expr.length == 0) {
     for (final StaticFunc fn : ctx.funcs.funcs()) {
       if (fn.compiled()) continue;
       final Ann ann = fn.ann;
       for (int i = ann.size(); --i >= 0; ) {
         if (Token.eq(ann.names[i].uri(), QueryText.UNITURI)) {
           fn.compile(ctx);
           break;
         }
       }
     }
   }
   return super.opt(ctx, scp);
 }
Beispiel #2
0
 /**
  * Compares two byte arrays for equality.
  *
  * @param data1 first array
  * @param data2 first array
  */
 private static void assertSame(final byte[] data1, final byte[] data2) {
   assertEquals("Different array size: ", data1.length, data2.length);
   assertTrue("Data arrays differ: ", Token.eq(data1, data2));
 }