if (!capacity.isInstance(skill)) {
throw new InvalidParameterException(
"the skill must implement the given capacity " //$NON-NLS-1$
+ capacity.getName());
}
<BUG>final Skill oldS = this.skills.put(capacity, skill);
skill.registerUse();
if (oldS != null && oldS != skill) {

oldS.unregisterUse();

}</BUG>
}

if (!capacity.isInstance(skill)) {
throw new InvalidParameterException(
"the skill must implement the given capacity " //$NON-NLS-1$
+ capacity.getName());
