This fixes a bug where a "Not a Proxy Instance"
exception (also IllegalArgumentException) is thrown
when hashCode is invoked in a yangtools generated
builder.
Change-Id: Iddc7ca6e4785e5ce11e41900a438dbb49baeaf6d
Signed-off-by: Thomas Bachman <tbachman@yahoo.com>
int result = 1;
for (final Method m : context.getHashCodeAndEqualsMethods()) {
final Object value = getBindingData(m);
- result += prime * result + ((value == null) ? 0 : value.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
}
if (Augmentation.class.isAssignableFrom(context.getBindingClass())) {
- result += prime * result + (getAugmentations(this).hashCode());
+ result = prime * result + (getAugmentations(this).hashCode());
}
cachedHashcode = result;
return result;