The release notes of eclipse3.1 did mention at the time (June 2005) a change in the heuristics for content type matching.
It was related on bug 90218, part of bug 82986 (enhancements to matching in 3.1), which references bug 86862 ("need API for related custom objects lookup")
That API didn't make it, but the code is available for you to reuse.
public Object[] findRelatedObjects(IContentType type, String fileName, IRelatedRegistry registry) {
List allRelated = new ArrayList();
// first add any objects directly related to the content type
Object[] related = registry.getRelatedObjects(type);
for (int i = 0; i < related.length; i++) {
allRelated.add(related[i]);
}
// backward compatibility requested - add any objects related to the file name
if (fileName != null) {
related = registry.getRelatedObjects(fileName);
for (int i = 0; i < related.length; i++) {
if (!allRelated.contains(related[i])) {
// we don't want to return duplicates
allRelated.add(related[i]);
}
}
}
// now add any indirectly related objects, walking up the content type hierarchy
while ((type = type.getBaseType()) != null) {
related = registry.getRelatedObjects(type);
for (int i = 0; i < related.length; i++) {
if (!allRelated.contains(related[i])) {
// we don't want to return duplicates
allRelated.add(related[i]);
}
}
}
return allRelated.toArray();
}