|
10 | 10 | import nl.rug.jbi.jsm.core.pipeline.PipelineFrame; |
11 | 11 | import nl.rug.jbi.jsm.metrics.ClassSourceProducer; |
12 | 12 | import nl.rug.jbi.jsm.util.Pair; |
13 | | -import org.apache.bcel.classfile.JavaClass; |
14 | 13 | import org.apache.bcel.util.Repository; |
15 | 14 | import org.apache.logging.log4j.LogManager; |
16 | 15 | import org.apache.logging.log4j.Logger; |
@@ -125,15 +124,22 @@ public void run() { |
125 | 124 |
|
126 | 125 | //Create the base set of modifiers for the first frame, based on the classes that need to be inspected. |
127 | 126 | for (final Map.Entry<String, EventBus> entry : this.stateContainers.entrySet()) { |
128 | | - try { |
129 | | - final JavaClass jc = repo.loadClass(entry.getKey()); |
130 | | - taskQueue.add(new Pair<EventBus, Runnable>( |
131 | | - entry.getValue(), |
132 | | - cvFactory.createClassVisitor(jc, entry.getValue()) |
133 | | - )); |
134 | | - } catch (ClassNotFoundException e) { |
135 | | - logger.error("Failed to load '{}', it will not be evaluated.", e); |
136 | | - } |
| 127 | + final String className = entry.getKey(); |
| 128 | + final EventBus eBus = entry.getValue(); |
| 129 | + |
| 130 | + taskQueue.add(new Pair<EventBus, Runnable>( |
| 131 | + eBus, |
| 132 | + new Runnable() { |
| 133 | + @Override |
| 134 | + public void run() { |
| 135 | + try { |
| 136 | + cvFactory.createClassVisitor(repo.loadClass(className), eBus).run(); |
| 137 | + } catch (ClassNotFoundException e) { |
| 138 | + logger.error("Failed to load '{}', it will not be evaluated.", e); |
| 139 | + } |
| 140 | + } |
| 141 | + } |
| 142 | + )); |
137 | 143 | } |
138 | 144 |
|
139 | 145 | while (currentFrame != null) { |
|
0 commit comments