opendap/src/main/java/opendap/dap/DConstructor.java
public void printXML(PrintWriter pw, String pad, boolean constrained) {

        Enumeration e = getAttributeNames();
        Enumeration ve = getVariables();

        boolean hasAttributes = e.hasMoreElements();
        boolean hasVariables = ve.hasMoreElements();

        pw.print(pad + "<" + getTypeName());
        if (getEncodedName() != null) {
            pw.print(" name=\"" +
                    DDSXMLParser.normalizeToXML(getClearName()) + "\"");
        }


        if (hasAttributes || hasVariables) {

            pw.println(">");

            while (e.hasMoreElements()) {
                String aName = (String) e.nextElement();

                Attribute a = getAttribute(aName);
                if(a!=null)
                    a.printXML(pw, pad + "\t", constrained);

            }

            while (ve.hasMoreElements()) {
                BaseType bt = (BaseType) ve.nextElement();
                bt.printXML(pw, pad + "\t", constrained);
            }

            pw.println(pad + "</" + getTypeName() + ">");

        } else {

            pw.println("/>");

        }

    }
public void printXML(PrintWriter pw, String pad, boolean constrained) {

        Enumeration e = getAttributeNames();
        Enumeration ve = getVariables();

        boolean hasAttributes = e.hasMoreElements();
        boolean hasVariables = ve.hasMoreElements();

        pw.print(pad + "<" + getTypeName());
        if (getEncodedName() != null) {
            pw.print(" name=\"" +
                    DDSXMLParser.normalizeToXML(getClearName()) + "\"");
        }


        if (hasAttributes || hasVariables) {

            pw.println(">");

            while (e.hasMoreElements()) {
                String aName = (String) e.nextElement();

                Attribute a = getAttribute(aName);
                if(a!=null)
                    a.printXML(pw, pad + "\t", constrained);

            }

            while (ve.hasMoreElements()) {
                BaseType bt = (BaseType) ve.nextElement();
                bt.printXML(pw, pad + "\t", constrained);
            }

            pw.println(pad + "</" + getTypeName() + ">");

        } else {

            pw.println("/>");

        }

    }
Coverity[CALL_SUPER]