Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
seems that for List<A> List and A are mixed in generics.
PS: would be also great to provide a JohnzonParameteriedType. Can be:
public class JohnzonParameteriedType implements ParameterizedType { private final Type rawType; private final Type[] types; public OwbParametrizedTypeImpl(Type raw, Type... types) { rawType = raw; this.types = types; } @Override public Type[] getActualTypeArguments() { return types.clone(); } @Override public Type getOwnerType() { return null; } @Override public Type getRawType() { return rawType; } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return Arrays.hashCode(types) ^ (rawType == null ? 0 : rawType.hashCode()); } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj instanceof ParameterizedType) { ParameterizedType that = (ParameterizedType) obj; Type thatOwnerType = that.getOwnerType(); Type thatRawType = that.getRawType(); return (owner == null ? thatOwnerType == null : owner.equals(thatOwnerType)) && (rawType == null ? thatRawType == null : rawType.equals(thatRawType)) && Arrays.equals(types, that.getActualTypeArguments()); } else { return false; } } public String toString() { StringBuilder buffer = new StringBuilder(); buffer.append(((Class<?>) rawType).getSimpleName()); Type[] actualTypes = getActualTypeArguments(); if(actualTypes.length > 0) { buffer.append("<"); int length = actualTypes.length; for(int i=0;i<length;i++) { buffer.append(actualTypes[i].toString()); if(i != actualTypes.length-1) { buffer.append(","); } } buffer.append(">"); } return buffer.toString(); } }