Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 197176 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/hyades/trace/views/internal/MethodDetailsStatistic.java (-35 / +81 lines)
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
							
Lines 557-568 Link Here
557
								Iterator i = selection.getInvocations().iterator();
580
								Iterator i = selection.getInvocations().iterator();
558
								while(i.hasNext())
581
								while(i.hasNext())
559
								{
582
								{
560
									TRCMethodInvocation mi = ((TRCMethodInvocation)i.next()).getInvokedBy();
561
									if(mi != null && mi.getMethod().equals(e1))
562
										nb1++;
563
									
583
									
564
									if(mi != null && mi.getMethod().equals(e2))
584
									TRCMethodInvocation mi = ((TRCMethodInvocation)i.next());
565
										nb2++;									
585
									
586
									if(mi != null && mi.getInvokedBy().getMethod().equals(e1)) {
587
										if (mi instanceof TRCAggregatedMethodInvocation) {
588
											nb1 += ((TRCAggregatedMethodInvocation) mi).getCount();
589
										}
590
										else {
591
											nb1++;
592
										}
593
									}
594
									
595
//									TRCMethodInvocation mi = ((TRCMethodInvocation)i.next());
596
									
597
									if(mi != null && mi.getInvokedBy().getMethod().equals(e2)) {
598
										if (mi instanceof TRCAggregatedMethodInvocation) {
599
											nb2 += ((TRCAggregatedMethodInvocation) mi).getCount();
600
										}
601
										else {
602
											nb2++;
603
										}
604
									}
605
									
606
//									TRCMethodInvocation mi = ((TRCMethodInvocation)i.next()).getInvokedBy();
607
//									if(mi != null && mi.getMethod().equals(e1))
608
//										nb1++;
609
//									
610
//									if(mi != null && mi.getMethod().equals(e2))
611
//										nb2++;									
566
								}																
612
								}																
567
							}
613
							}
568
							
614
							

Return to bug 197176