- Enumeration<URL> enumeration = bundle.findEntries("META-INF/yang", "*.yang", false);
- Builder<Registration<URL>> builder = ImmutableSet.<Registration<URL>> builder();
- while (enumeration != null && enumeration.hasMoreElements()) {
- Registration<URL> reg = contextResolver.registerSource(enumeration.nextElement());
- builder.add(reg);
+ final Enumeration<URL> enumeration = bundle.findEntries("META-INF/yang", "*.yang", false);
+ if (enumeration == null) {
+ return Collections.emptyList();
+ }
+
+ final List<Registration<URL>> urls = new ArrayList<>();
+ while (enumeration.hasMoreElements()) {
+ final URL u = enumeration.nextElement();
+ try {
+ urls.add(contextResolver.registerSource(u));
+ LOG.debug("Registered {}", u);
+ } catch (Exception e) {
+ LOG.warn("Failed to register {}, ignoring it", e);
+ }