summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
8b846e3)
but in a debug log, not the IllegalStateException, because it's huge.
JIRA: MDSAL-354
Change-Id: I65c236fc3b675e7cf231cc1d8cdc56fc36131281
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
checkState(localRuntimeContext != null, "BindingRuntimeContext is not available.");
module = localRuntimeContext.getSchemaContext().findModule(moduleName).orElse(null);
}
checkState(localRuntimeContext != null, "BindingRuntimeContext is not available.");
module = localRuntimeContext.getSchemaContext().findModule(moduleName).orElse(null);
}
- checkState(module != null, "Schema for %s is not available; expected module name: %s.", modeledClass,
- moduleName);
- return module;
+ if (module != null) {
+ return module;
+ }
+
+ LOG.debug("Schema for {} is not available; expected module name: {}; BindingRuntimeContext: {}",
+ modeledClass, moduleName, localRuntimeContext);
+ throw new IllegalStateException(String.format("Schema for %s is not available; expected module name: %s; "
+ + "full BindingRuntimeContext available in debug log", modeledClass, moduleName));
}
private void waitForSchema(final Collection<Class<?>> binding, final MissingSchemaException exception) {
}
private void waitForSchema(final Collection<Class<?>> binding, final MissingSchemaException exception) {
package org.opendaylight.mdsal.binding.generator.api;
import com.google.common.annotations.Beta;
package org.opendaylight.mdsal.binding.generator.api;
import com.google.common.annotations.Beta;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.ImmutableMap;
@Beta
@ThreadSafe
public final class BindingRuntimeTypes implements Immutable {
@Beta
@ThreadSafe
public final class BindingRuntimeTypes implements Immutable {
private final Map<Type, AugmentationSchemaNode> typeToAugmentation;
private final BiMap<Type, WithStatus> typeToSchema;
private final Multimap<Type, Type> choiceToCases;
private final Map<Type, AugmentationSchemaNode> typeToAugmentation;
private final BiMap<Type, WithStatus> typeToSchema;
private final Multimap<Type, Type> choiceToCases;
public Collection<Type> findCases(final Type choiceType) {
return choiceToCases.get(choiceType);
}
public Collection<Type> findCases(final Type choiceType) {
return choiceToCases.get(choiceType);
}
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("typeToAugmentation", typeToAugmentation)
+ .add("typeToSchema", typeToSchema)
+ .add("choiceToCases", choiceToCases)
+ .add("identities", identities)
+ .toString();
+ }
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
public Class<?> getIdentityClass(final QName input) {
return identityClasses.getUnchecked(input);
}
public Class<?> getIdentityClass(final QName input) {
return identityClasses.getUnchecked(input);
}
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("ClassLoadingStrategy", strategy)
+ .add("runtimeTypes", runtimeTypes)
+ .add("schemaContext", schemaContext).toString();
+ }