Warn about using only the first instrumenter

This commit is contained in:
Andrey Breslav
2013-05-13 17:42:56 +04:00
parent f2bf2317f8
commit de7fd88373
@@ -133,7 +133,11 @@ public class Preloader {
ServiceLoader<Instrumenter> loader = ServiceLoader.load(Instrumenter.class, withInstrumenter);
Iterator<Instrumenter> instrumenters = loader.iterator();
if (instrumenters.hasNext()) {
return instrumenters.next();
Instrumenter instrumenter = instrumenters.next();
if (instrumenters.hasNext()) {
System.err.println("PRELOADER WARNING: Only the first instrumenter is used: " + instrumenter.getClass());
}
return instrumenter;
}
else {
System.err.println("PRELOADER WARNING: No instrumenters found");