Description

When generating source from a schema that has the type "xsd:base64Binary" the
equals method generated by the SourceGenerator generates a xxx.equals( yyy )
where xxx and yyy are of type byte[], from the "xsd:base64Binary" schema type.

This will always be false, it should be Arrays.equals( xxx, yyy ), or something
similar.

Ralf, a few weks ago, I removed isArray() and isCollection() methods from JType and introduced two sub-types of JType, namely JCollection and JArray. So let's please not re-introduce isArray() methods .. .

As you know the javasource class hierarchy is quite similare to the hierarchy of the classes of java language. The JType class representes Class of java language which offers the isArray() and isCollection() methods. If these methods would have be present in JType, nowone would have come to the idea to test for array by using type.toString().endsWith("[]") . Having said that it is reasonable to have the JCollection and JArray classes you introduced but in my opinon you should have implemented isArray() and isCollection() like:

public boolean isArray()

{
return (this instanceof JArray);
}

public boolean isCollection()

{
return (this instanceof JCollection);
}

This will allow to test with type.isArray() while decoupling for the underlaying implementation. As you can see at above comments and the current implementation it does not seam to be that obvious to test if JType represents an array by (type instanceof JArray).

Ralf Joachim
added a comment - 08/Oct/06 4:37 PM As you know the javasource class hierarchy is quite similare to the hierarchy of the classes of java language. The JType class representes Class of java language which offers the isArray() and isCollection() methods. If these methods would have be present in JType, nowone would have come to the idea to test for array by using type.toString().endsWith("[]") . Having said that it is reasonable to have the JCollection and JArray classes you introduced but in my opinon you should have implemented isArray() and isCollection() like:
public boolean isArray()
{
return (this instanceof JArray);
}
public boolean isCollection()
{
return (this instanceof JCollection);
}
This will allow to test with type.isArray() while decoupling for the underlaying implementation. As you can see at above comments and the current implementation it does not seam to be that obvious to test if JType represents an array by (type instanceof JArray).
Just my 0.02 cents.