GT-2698 fix a bad test

Test was comparing classes backwards.
This commit is contained in:
dev747368 2019-04-23 14:16:26 -04:00
parent 1f36a7616c
commit 5764e7174e

View File

@ -730,14 +730,14 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
performAction(action);
}
Component getComponentOfType(Container container, Class<?> componentClass) {
<T extends Component> T getComponentOfType(Container container, Class<T> componentClass) {
Component[] comps = container.getComponents();
for (Component element : comps) {
if (element.getClass().isAssignableFrom(componentClass)) {
return element;
if (componentClass.isInstance(element)) {
return componentClass.cast(element);
}
else if (element instanceof Container) {
Component subComp = getComponentOfType((Container) element, componentClass);
T subComp = getComponentOfType((Container) element, componentClass);
if (subComp != null) {
return subComp;
}