public WOComponent findBugs(String string) {
NSArray bugs = Bug.clazz.findBugs(session().defaultEditingContext(), string);
WOComponent result;
if (bugs != null && bugs.count() == 1) {
InspectPageInterface ipi = D2W.factory().inspectPageForEntityNamed("Bug", session());
ipi.setObject((EOEnterpriseObject) bugs.objectAtIndex(0));
ipi.setNextPage(currentPage());
result = (WOComponent) ipi;
} else {
EOArrayDataSource ds = Bug.clazz.newArrayDataSource(session().defaultEditingContext());
ds.setArray(bugs);
ListPageInterface lpi = D2W.factory().listPageForEntityNamed("Bug", session());