final Bundle[] bundles = context.getBundleContext().getBundles();
if (bundles != null) {
for (final Bundle bundle : bundles) {
final String bsn = bundle.getSymbolicName();
if (bsn != null && bsn.startsWith(originalUserInput)) {
completions.add(new Completion(bsn));
}
}
}
}
if (obr) {
final Repository[] repositories = repositoryAdmin
.listRepositories();
if (repositories != null) {
for (final Repository repository : repositories) {
final Resource[] resources = repository.getResources();
if (resources != null) {
for (final Resource resource : resources) {
if (resource.getSymbolicName().startsWith(
originalUserInput)) {
completions.add(new Completion(resource
.getSymbolicName()));
}
}
}
}