ComponentFactory componentFactory = ContainerDelegate.getInstance().getFactoryLocator().getComponentFactory();
Component classComponent = componentFactory.getComponentByComponentType("ApexClass");
String classExt = classComponent == null ? ".cls" : classComponent.getFileExtension();</BUG>
Component trgComponent = componentFactory.getComponentByComponentType("ApexTrigger");
<BUG>String trgExt = trgComponent == null ? ".trigger" : trgComponent.getFileExtension();
for (Iterator<IResource> iterator = projectResources.iterator(); iterator.hasNext();) {
IResource res = iterator.next();
if (!res.getFileExtension().equals(classExt) && !res.getFileExtension().equals(trgExt)) {
iterator.remove();</BUG>
}

ComponentFactory componentFactory = ContainerDelegate.getInstance().getFactoryLocator().getComponentFactory();
Component component = componentFactory.getComponentByComponentType(type);
String extension = component.getFileExtension();
return projectResources.stream()
.filter(r -> r.getFileExtension().equals(extension))
.collect(Collectors.toList());
