Add warning when a SamplerCreator is already registered for a content type and removed

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1418308 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Philippe Mouawad 2012-12-07 13:37:50 +00:00
parent 7f8007e453
commit 7ff8bfec9d
1 changed files with 5 additions and 1 deletions

View File

@ -69,7 +69,11 @@ public class SamplerCreatorFactory {
if(log.isDebugEnabled()) {
log.debug("Registering samplerCreator "+commandClass.getName()+" for content type:"+contentType);
}
samplerCreatorMap.put(contentType, creator);
SamplerCreator oldSamplerCreator = samplerCreatorMap.put(contentType, creator);
if(oldSamplerCreator!=null) {
log.warn("A sampler creator was already registered for:"+contentType+", class:"+oldSamplerCreator.getClass()
+ ", it will be replaced");
}
}
}
} catch (Exception e) {