opendap/src/main/java/opendap/dap/Util.java
static void uniqueNames(Vector v, String varName,
                            String typeName) throws BadSemanticsException {
        String[] names = sortedNames(v);
        // DEBUG: print out names
        //for(int i=0; i<names.length; i++) {
        //  LogStream.err.println("names[" + i + "] = " + names[i]);
        //}
        // look for any instance of consecutive names that are ==
        for (int i = 1; i < names.length; i++) {
            if (names[i - 1].equals(names[i])) {
                throw new BadSemanticsException("The variable `" + names[i] +
                        "' is used more than once in " + typeName + " `" +
                        varName + "'");
            }
        }
    }
static void uniqueNames(Vector v, String varName,
                            String typeName) throws BadSemanticsException {
        String[] names = sortedNames(v);
        // DEBUG: print out names
        //for(int i=0; i<names.length; i++) {
        //  LogStream.err.println("names[" + i + "] = " + names[i]);
        //}
        // look for any instance of consecutive names that are ==
        for (int i = 1; i < names.length; i++) {
            if (names[i - 1].equals(names[i])) {
                throw new BadSemanticsException("The variable `" + names[i] +
                        "' is used more than once in " + typeName + " `" +
                        varName + "'");
            }
        }
    }
static void uniqueNames ( Vector v , String varName , String typeName ) throws BadSemanticsException { String [ ] names = sortedNames ( v ) ; // DEBUG: print out names //for(int i=0; i<names.length; i++) { //  LogStream.err.println("names[" + i + "] = " + names[i]); //} // look for any instance of consecutive names that are == for ( int i = 1 ; i < names . length ; i ++ ) { if ( names [ i - 1 ] . equals ( names [ i ] ) ) { throw new BadSemanticsException ( "The variable `" + names [ i ] + "' is used more than once in " + typeName + " `" + varName + "'" ) ; } } }
Compares elements in a <code>Vector</code> of <code>BaseType</code>s and
throw a <code>BadSemanticsException</code> if there are any
duplicate elements.

@param v        The <code>Vector</code> to check
@param varName  the name of the variable which called us
@param typeName the type name of the variable which called us
@throws BadSemanticsException     if there are duplicate elements
@throws IndexOutOfBoundsException if size doesn't match the number
of elements in the <code>Enumeration</code>
Compares elements in a <code > Vector< / code > of <code > BaseType< / code > s and throw a <code > BadSemanticsException< / code > if there are any duplicate elements .