naming/src/main/java/org/wildfly/naming/java/permission/JndiPermission.java
private boolean impliesPath0(final String yourName) {
        // segment-by-segment comparison
        final String myName = getName();
        final Iterator<String> myIter = JndiPermissionNameParser.nameIterator(myName);
        final Iterator<String> yourIter = JndiPermissionNameParser.nameIterator(yourName);
        // even if it's just "", there is always a first element
        assert myIter.hasNext() && yourIter.hasNext();
        String myNext;
        String yourNext;
        for (;;) {
            myNext = myIter.next();
            yourNext = yourIter.next();
            if (myNext.equals("-")) {
                // "-" implies everything including ""
                return true;
            }
            if (! myNext.equals("*") && ! myNext.equals(yourNext)) {
                // "foo/bar" does not imply "foo/baz"
                return false;
            }
            if (myIter.hasNext()) {
                if (! yourIter.hasNext()) {
                    // "foo/bar" does not imply "foo"
                    return false;
                }
            } else {
                // if neither has next, "foo/bar" implies "foo/bar", else "foo" does not imply "foo/bar"
                return ! yourIter.hasNext();
            }
        }
    }
private boolean impliesPath0(final String yourName) {
        // segment-by-segment comparison
        final String myName = getName();
        final Iterator<String> myIter = JndiPermissionNameParser.nameIterator(myName);
        final Iterator<String> yourIter = JndiPermissionNameParser.nameIterator(yourName);
        // even if it's just "", there is always a first element
        assert myIter.hasNext() && yourIter.hasNext();
        String myNext;
        String yourNext;
        for (;;) {
            myNext = myIter.next();
            yourNext = yourIter.next();
            if (myNext.equals("-")) {
                // "-" implies everything including ""
                return true;
            }
            if (! myNext.equals("*") && ! myNext.equals(yourNext)) {
                // "foo/bar" does not imply "foo/baz"
                return false;
            }
            if (myIter.hasNext()) {
                if (! yourIter.hasNext()) {
                    // "foo/bar" does not imply "foo"
                    return false;
                }
            } else {
                // if neither has next, "foo/bar" implies "foo/bar", else "foo" does not imply "foo/bar"
                return ! yourIter.hasNext();
            }
        }
    }
private boolean impliesPath0 ( final String yourName ) { // segment-by-segment comparison final String myName = getName ( ) ; final Iterator < String > myIter = JndiPermissionNameParser . nameIterator ( myName ) ; final Iterator < String > yourIter = JndiPermissionNameParser . nameIterator ( yourName ) ; // even if it's just "", there is always a first element assert myIter . hasNext ( ) && yourIter . hasNext ( ) ; String myNext ; String yourNext ; for ( ; ; ) { myNext = myIter . next ( ) ; yourNext = yourIter . next ( ) ; if ( myNext . equals ( "-" ) ) { // "-" implies everything including "" return true ; } if ( ! myNext . equals ( "*" ) && ! myNext . equals ( yourNext ) ) { // "foo/bar" does not imply "foo/baz" return false ; } if ( myIter . hasNext ( ) ) { if ( ! yourIter . hasNext ( ) ) { // "foo/bar" does not imply "foo" return false ; } } else { // if neither has next, "foo/bar" implies "foo/bar", else "foo" does not imply "foo/bar" return ! yourIter . hasNext ( ) ; } } }
private
private