if (rawType instanceof JvmDeclaredType) {
Iterables.addAll(result, ((JvmDeclaredType) rawType).findAllFeaturesByName(name));
}</BUG>
}
return result;
<BUG>}
public Iterable<JvmFeature> getAllFeatures(JvmTypeReference typeReference, TypeArgumentContext context,
Iterable<JvmTypeReference> hierarchy) {
Set<JvmFeature> result = Sets.newLinkedHashSet();
for(JvmTypeReference reference: hierarchy) {
JvmType rawType = typeReferences.getRawType(reference);

if (rawType instanceof JvmDeclaredType) {
Iterables.addAll(result, ((JvmDeclaredType) rawType).getAllFeatures());</BUG>
}

if (rawType instanceof JvmDeclaredType) {
collectFeatures(name, rawType, result);
} else if (rawType == null) { // TODO remove special treatment of multi types and other specialized type reference implementations
for(JvmTypeReference reference: hierarchy) {
JvmType referenceRawType = typeReferences.getRawType(reference);
collectFeatures(name, referenceRawType, result);
}
return result;
