sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/PluginInitialiser.java
equal
deleted
inserted
replaced
113 |
113 |
114 if (pluginInstanceReferences != null) |
114 if (pluginInstanceReferences != null) |
115 { |
115 { |
116 // make sure the cast is valid |
116 // make sure the cast is valid |
117 try { |
117 try { |
118 tmp = pluginInstanceReferences.get(new Integer(id)); |
118 tmp = pluginInstanceReferences.get(Integer.valueOf(id)); |
119 } catch (ClassCastException e1) { |
119 } catch (ClassCastException e1) { |
120 e1.printStackTrace(); |
120 e1.printStackTrace(); |
121 } |
121 } |
122 } |
122 } |
123 return tmp.elements(); |
123 return tmp.elements(); |
129 Vector<AbstractPiPlugin> instances = new Vector<AbstractPiPlugin>(); |
129 Vector<AbstractPiPlugin> instances = new Vector<AbstractPiPlugin>(); |
130 |
130 |
131 if (pluginInstanceReferences == null) |
131 if (pluginInstanceReferences == null) |
132 return instances.elements(); |
132 return instances.elements(); |
133 |
133 |
134 Vector<AbstractPiPlugin> tmp = pluginInstanceReferences.get(new Integer(id)); |
134 Vector<AbstractPiPlugin> tmp = pluginInstanceReferences.get(Integer.valueOf(id)); |
135 if (tmp != null) |
135 if (tmp != null) |
136 { |
136 { |
137 AbstractPiPlugin plugin = null; |
137 AbstractPiPlugin plugin = null; |
138 java.lang.Class matchClass = null; |
138 java.lang.Class matchClass = null; |
139 |
139 |
241 public static void removeTraceInstances(int id) |
241 public static void removeTraceInstances(int id) |
242 { |
242 { |
243 if (id == 0) return; //not removing top level plugin instances |
243 if (id == 0) return; //not removing top level plugin instances |
244 if (pluginInstanceReferences != null) |
244 if (pluginInstanceReferences != null) |
245 { |
245 { |
246 pluginInstanceReferences.remove(new Integer(id)); |
246 pluginInstanceReferences.remove(Integer.valueOf(id)); |
247 } |
247 } |
248 } |
248 } |
249 |
249 |
250 public static void removeAllTraceInstances() |
250 public static void removeAllTraceInstances() |
251 { |
251 { |
263 |
263 |
264 private static void addInstanceReference(int id, AbstractPiPlugin plugin) |
264 private static void addInstanceReference(int id, AbstractPiPlugin plugin) |
265 { |
265 { |
266 if (pluginInstanceReferences == null) |
266 if (pluginInstanceReferences == null) |
267 pluginInstanceReferences = new Hashtable<Integer, Vector<AbstractPiPlugin>>(); |
267 pluginInstanceReferences = new Hashtable<Integer, Vector<AbstractPiPlugin>>(); |
268 Vector<AbstractPiPlugin> tmp = pluginInstanceReferences.get(new Integer(id)); |
268 Vector<AbstractPiPlugin> tmp = pluginInstanceReferences.get(Integer.valueOf(id)); |
269 if (tmp != null) |
269 if (tmp != null) |
270 { |
270 { |
271 // do not allow duplicate plugins |
271 // do not allow duplicate plugins |
272 if (!tmp.contains(plugin)) |
272 if (!tmp.contains(plugin)) |
273 tmp.add(plugin); |
273 tmp.add(plugin); |
274 } |
274 } |
275 else |
275 else |
276 { |
276 { |
277 Vector<AbstractPiPlugin> tmp2 = new Vector<AbstractPiPlugin>(); |
277 Vector<AbstractPiPlugin> tmp2 = new Vector<AbstractPiPlugin>(); |
278 tmp2.add(plugin); |
278 tmp2.add(plugin); |
279 pluginInstanceReferences.put(new Integer(id), tmp2); |
279 pluginInstanceReferences.put(Integer.valueOf(id), tmp2); |
280 } |
280 } |
281 } |
281 } |
282 } |
282 } |