axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Pocock <matthew_poc...@yahoo.co.uk>
Subject checking params
Date Fri, 07 Nov 2003 11:59:54 GMT
Hi,

BaseSerializerFactory has a constructor that takes a class that will be 
used as the serializer class. It doesn't currently check that this class 
implements Serializer, which leads to the program falling over much 
later when the class is used. Could we add a check to the constructor to 
validate the argument? Does this need adding to BaseDeserializerFactory 
as well?

Matthew

public BaseSerializerFactory(Class serClass) {
    if(!Serializer.class.isAssignableFrom(serClass)) {
        throw new ClassCastException(serClass.getName() +
                " must implement " +
                Serializer.class.getName());
    }

    this.serClass = serClass;
}


Mime
View raw message