src/main/java/com/buschmais/jqassistant/plugin/common/api/scanner/AbstractFileResolver.java
private <D extends FileDescriptor> D migrateOrCast(Descriptor descriptor, Class<D> type, ScannerContext context) {
        return type.isAssignableFrom(descriptor.getClass()) ? type.cast(descriptor) : context.getStore().addDescriptorType(descriptor, type);
    }
private <D extends FileDescriptor> D migrateOrCast(Descriptor descriptor, Class<D> type, ScannerContext context) {
        return type.isAssignableFrom(descriptor.getClass()) ? type.cast(descriptor) : context.getStore().addDescriptorType(descriptor, type);
    }
Ensures if the given {@link FileDescriptor} implements the requested type by
migrating or just casting it.

@param descriptor
The {@link FileDescriptor}.
@param type
The requested type.
@param context
The {@link ScannerContext}.
@param <D>
The requested type.
@return The {@link FileDescriptor} that implements the requested type.