Exemple #1
0
 /**
  * Checks if specified query was rewritten for index access, and checks the query result.
  *
  * @param query query to be tested
  * @param result result or {@code null} for no comparison
  */
 private static void check(final String query, final String result) {
   check(
       query,
       result,
       "exists(/descendant-or-self::*"
           + "[self::"
           + Util.className(ValueAccess.class)
           + "|self::"
           + Util.className(FTIndexAccess.class)
           + "])");
 }
Exemple #2
0
 /**
  * Returns the color for the specified string or {@code null}.
  *
  * @param string string string
  * @return color
  */
 static String color(final byte[] string) {
   for (final Object[] color : COLORS) {
     final int cl = color.length;
     for (int c = 1; c < cl; c++) {
       final Object o = color[c];
       final byte[] col =
           o instanceof byte[]
               ? (byte[]) o
               : Token.token(o instanceof Class ? Util.className((Class<?>) o) : o.toString());
       if (Token.eq(col, string)) return color[0].toString();
     }
   }
   return null;
 }