@Requires("isValidPattern(pattern)")
  public boolean isOverriden(String pattern) {
    String canon = pattern.replace('/', '.');
    boolean exact = !canon.endsWith(".*");
    if (exact) {
      return false;
    }
    canon = canon.substring(0, canon.length() - 2);

    String[] parts = canon.split("\\.");
    TernaryNode current = root;
    for (int i = 0; i < parts.length; ++i) {
      TernaryNode next = current.children.get(parts[i]);
      if (next == null) {
        return false;
      }
      current = next;
    }
    return !current.children.isEmpty();
  }
@ Requires ( "isValidPattern(pattern)" ) public boolean isOverriden ( String pattern ) { String canon = pattern . replace ( '/' , '.' ) ; boolean exact = ! canon . endsWith ( ".*" ) ; if ( exact ) { return false ; } canon = canon . substring ( 0 , canon . length ( ) - 2 ) ; String [ ] parts = canon . split ( "\\." ) ; TernaryNode current = root ; for ( int i = 0 ; i < parts . length ; ++ i ) { TernaryNode next = current . children . get ( parts [ i ] ) ; if ( next == null ) { return false ; } current = next ; } return ! current . children . isEmpty ( ) ; }
Returns {@code true} if {@code pattern} has another pattern
overriding it, that is if there exists some name that is matched
by {@code pattern} and is associated with a different rule than
the one associated with {@code pattern}.

<p>For example, following the calls {@code put("a.*", r1)} and
{@code put("a.b.*", r2)}, {@code isOverriden("a.*")} will return
{@code true} if {@code !r1.equals(r2)}.

<p>This method always returns {@code false} if {@code pattern} is
exact.