|
Lines 13-19
Link Here
|
| 13 |
|
13 |
|
| 14 |
import java.util.HashMap; |
14 |
import java.util.HashMap; |
| 15 |
import java.util.Iterator; |
15 |
import java.util.Iterator; |
| 16 |
|
16 |
import org.eclipse.hyades.models.trace.TRCAggregatedMethodInvocation; |
| 17 |
import org.eclipse.hyades.models.trace.TRCMethod; |
17 |
import org.eclipse.hyades.models.trace.TRCMethod; |
| 18 |
import org.eclipse.hyades.models.trace.TRCMethodInvocation; |
18 |
import org.eclipse.hyades.models.trace.TRCMethodInvocation; |
| 19 |
import org.eclipse.hyades.trace.ui.internal.util.TString; |
19 |
import org.eclipse.hyades.trace.ui.internal.util.TString; |
|
Lines 275-290
Link Here
|
| 275 |
Iterator children = inv.getInvokes().iterator(); |
275 |
Iterator children = inv.getInvokes().iterator(); |
| 276 |
while(children.hasNext()) |
276 |
while(children.hasNext()) |
| 277 |
{ |
277 |
{ |
| 278 |
TRCMethod m = ((TRCMethodInvocation)children.next()).getMethod(); |
278 |
TRCMethodInvocation child_inv = (TRCMethodInvocation)children.next(); |
|
|
279 |
TRCMethod m = child_inv.getMethod(); |
| 279 |
|
280 |
|
|
|
281 |
int count = 1; |
| 282 |
if (child_inv instanceof TRCAggregatedMethodInvocation) { |
| 283 |
count = ((TRCAggregatedMethodInvocation) child_inv).getCount(); |
| 284 |
} |
| 285 |
|
| 280 |
Object value = tmpMap.get(m); |
286 |
Object value = tmpMap.get(m); |
| 281 |
if(value != null) |
287 |
if(value != null) { |
| 282 |
{ |
288 |
tmpMap.put(m, new Integer(((Integer)value).intValue() + count)); |
| 283 |
int i = ((Integer)value).intValue()+1; |
289 |
} |
| 284 |
tmpMap.put(m, new Integer(i)); |
290 |
else { |
|
|
291 |
tmpMap.put(m, new Integer(count)); |
| 285 |
} |
292 |
} |
| 286 |
else |
|
|
| 287 |
tmpMap.put(m, new Integer(1)); |
| 288 |
} |
293 |
} |
| 289 |
} |
294 |
} |
| 290 |
|
295 |
|
|
Lines 317-339
Link Here
|
| 317 |
Iterator iterator = method.getInvocations().iterator(); |
322 |
Iterator iterator = method.getInvocations().iterator(); |
| 318 |
while(iterator.hasNext()) |
323 |
while(iterator.hasNext()) |
| 319 |
{ |
324 |
{ |
| 320 |
TRCMethodInvocation inv = (TRCMethodInvocation) iterator.next(); |
325 |
TRCMethodInvocation inv = (TRCMethodInvocation) iterator.next(); |
| 321 |
|
326 |
|
| 322 |
if(inv.getInvokedBy() == null) |
327 |
if(inv.getInvokedBy() == null) |
| 323 |
continue; |
328 |
continue; |
| 324 |
|
329 |
|
| 325 |
TRCMethod m = inv.getInvokedBy().getMethod(); |
330 |
TRCMethod m = inv.getInvokedBy().getMethod(); |
| 326 |
|
331 |
|
| 327 |
Object value = tmpMap.get(m); |
332 |
int count = 1; |
| 328 |
if(value != null) |
333 |
if (inv instanceof TRCAggregatedMethodInvocation) { |
| 329 |
{ |
334 |
count = ((TRCAggregatedMethodInvocation) inv).getCount(); |
| 330 |
int i = ((Integer)value).intValue()+1; |
335 |
} |
| 331 |
tmpMap.put(m, new Integer(i)); |
336 |
|
| 332 |
} |
337 |
Object value = tmpMap.get(m); |
| 333 |
else |
338 |
if(value != null) |
| 334 |
tmpMap.put(m, new Integer(1)); |
339 |
{ |
| 335 |
} |
340 |
tmpMap.put(m, new Integer(((Integer)value).intValue() + count)); |
| 336 |
|
341 |
} |
|
|
342 |
else { |
| 343 |
tmpMap.put(m, new Integer(count)); |
| 344 |
} |
| 345 |
} |
| 346 |
|
| 337 |
Iterator methods = tmpMap.keySet().iterator(); |
347 |
Iterator methods = tmpMap.keySet().iterator(); |
| 338 |
while(methods.hasNext()) |
348 |
while(methods.hasNext()) |
| 339 |
{ |
349 |
{ |
|
Lines 388-395
Link Here
|
| 388 |
while(i.hasNext()) |
398 |
while(i.hasNext()) |
| 389 |
{ |
399 |
{ |
| 390 |
TRCMethodInvocation mi = ((TRCMethodInvocation)i.next()).getInvokedBy(); |
400 |
TRCMethodInvocation mi = ((TRCMethodInvocation)i.next()).getInvokedBy(); |
| 391 |
if(mi != null && mi.getMethod().equals(selection)) |
401 |
if(mi != null && mi.getMethod().equals(selection)) { |
| 392 |
nb++; |
402 |
if (mi instanceof TRCAggregatedMethodInvocation) { |
|
|
403 |
nb += ((TRCAggregatedMethodInvocation) mi).getCount(); |
| 404 |
} |
| 405 |
else { |
| 406 |
nb++; |
| 407 |
} |
| 408 |
} |
| 393 |
|
409 |
|
| 394 |
} |
410 |
} |
| 395 |
|
411 |
|
|
Lines 407-415
Link Here
|
| 407 |
Iterator i = selection.getInvocations().iterator(); |
423 |
Iterator i = selection.getInvocations().iterator(); |
| 408 |
while(i.hasNext()) |
424 |
while(i.hasNext()) |
| 409 |
{ |
425 |
{ |
| 410 |
TRCMethodInvocation mi = ((TRCMethodInvocation)i.next()).getInvokedBy(); |
426 |
TRCMethodInvocation mi = ((TRCMethodInvocation)i.next()); |
| 411 |
if(mi != null && mi.getMethod().equals(m)) |
427 |
|
| 412 |
nb++; |
428 |
if(mi != null && mi.getInvokedBy().getMethod().equals(m)) { |
|
|
429 |
if (mi instanceof TRCAggregatedMethodInvocation) { |
| 430 |
nb += ((TRCAggregatedMethodInvocation) mi).getCount(); |
| 431 |
} |
| 432 |
else { |
| 433 |
nb++; |
| 434 |
} |
| 435 |
} |
| 413 |
|
436 |
|
| 414 |
} |
437 |
} |
| 415 |
|
438 |
|