axis-java-dev mailing list archives

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

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?


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

    this.serClass = serClass;

View raw message