private void check(){
  if (descs.length == 0) {
    throw new IllegalArgumentException("must have at least one descriptor");
  }
  for (int i=0; i < descs.length; i++) {
    MethodDesc desc=descs[i];
    String dname=desc.name;
    if (dname == null) {
      if (i < descs.length - 1) {
        throw new IllegalArgumentException("default descriptor must be last");
      }
    }
 else     if (dname.charAt(0) == '*') {
      int dlen=dname.length() + 1;
      for (int j=0; j < i; j++) {
        MethodDesc prev=descs[j];
        String pname=prev.name;
        if (pname.charAt(0) == '*' && pname.regionMatches(1,dname,dlen - pname.length(),pname.length() - 1)) {
          check(prev,desc);
        }
      }
    }
 else     if (dname.charAt(dname.length() - 1) == '*') {
      for (int j=0; j < i; j++) {
        MethodDesc prev=descs[j];
        String pname=prev.name;
        int plen=pname.length() - 1;
        if (pname.charAt(plen) == '*' && pname.regionMatches(0,dname,0,plen)) {
          check(prev,desc);
        }
      }
    }
 else {
      for (int j=0; j < i; j++) {
        MethodDesc prev=descs[j];
        String pname=prev.name;
        int plen=pname.length() - 1;
        if (pname.charAt(0) == '*') {
          if (dname.regionMatches(dname.length() - plen,pname,1,plen)) {
            check(prev,desc);
          }
        }
 else         if (pname.charAt(plen) == '*') {
          if (dname.regionMatches(0,pname,0,plen)) {
            check(prev,desc);
          }
        }
 else {
          if (pname.equals(dname)) {
            check(prev,desc);
          }
        }
      }
    }
  }
}

private void check ( ) { if ( descs . length == 0 ) { throw new IllegalArgumentException ( "must have at least one descriptor" ) ; } for ( int i = 0 ; i < descs . length ; i ++ ) { MethodDesc desc = descs [ i ] ; String dname = desc . name ; if ( dname == null ) { if ( i < descs . length - 1 ) { throw new IllegalArgumentException ( "default descriptor must be last" ) ; } } else if ( dname . charAt ( 0 ) == '*' ) { int dlen = dname . length ( ) + 1 ; for ( int j = 0 ; j < i ; j ++ ) { MethodDesc prev = descs [ j ] ; String pname = prev . name ; if ( pname . charAt ( 0 ) == '*' && pname . regionMatches ( 1 , dname , dlen - pname . length ( ) , pname . length ( ) - 1 ) ) { check ( prev , desc ) ; } } } else if ( dname . charAt ( dname . length ( ) - 1 ) == '*' ) { for ( int j = 0 ; j < i ; j ++ ) { MethodDesc prev = descs [ j ] ; String pname = prev . name ; int plen = pname . length ( ) - 1 ; if ( pname . charAt ( plen ) == '*' && pname . regionMatches ( 0 , dname , 0 , plen ) ) { check ( prev , desc ) ; } } } else { for ( int j = 0 ; j < i ; j ++ ) { MethodDesc prev = descs [ j ] ; String pname = prev . name ; int plen = pname . length ( ) - 1 ; if ( pname . charAt ( 0 ) == '*' ) { if ( dname . regionMatches ( dname . length ( ) - plen , pname , 1 , plen ) ) { check ( prev , desc ) ; } } else if ( pname . charAt ( plen ) == '*' ) { if ( dname . regionMatches ( 0 , pname , 0 , plen ) ) { check ( prev , desc ) ; } } else { if ( pname . equals ( dname ) ) { check ( prev , desc ) ; } } } } } }
throws illegalargumentexception if the descriptors array is empty , or if any descriptor is preceded by another descriptor that matches at least the same methods . throws nullpointerexception if the array or any element is null .
