Hi Marc
Case 1: "As the HelloTest is probably never instantiated this line is red". 
The line is red because HelloTest Class is never Instantiated. So why Hello 
Line doesn't have any color(red or green)? 
Case 2: All the constructor function is green or red. But the 
normal function line doesn't have any color. 
About the version: I use both eclipse(eclemma) and ant to check 
the phenomenon. The corresponding file are in the attachment.  


在 2017年11月24日星期五 UTC+8下午11:13:43,Marc R. Hoffmann写道:
>
> Hi Echo,
>
> Case 1: This is the implicit default constructor added by the Java 
> compiler. As the HelloTest is probably never instantiated this line is red.
>
> Case 2: I don't have an explanation here. What exact compiler version are 
> you using (Eclipse)? Can you please provide the corresponding class file 
> for further analysis?
>
> Regards,
> -marc
>
>  
>
>  
>
>  
>
> On 2017-11-24 08:20, Echo wrote:
>
> Hi, All. When i use jacoco to run the code, the report seems incorrect and 
> makes me confused.  
> 1. About the class name line.
> As you can see in the picture, the first line in HelloTest is red and the 
> first line in the Hello isn't red. But both classes have been executed. 
> 2.About the method name line.
> In Hello class, line 3 is green while line 9 doesn't have any color. Is it 
> because line 3 is INIT Method. 
>
>
> <https://lh3.googleusercontent.com/-9Dh5VZNWKgs/WhfHwkpZ9XI/AAAAAAAAACY/3ItVsoL5HWQCzRwJH0vMV14G7g9OhIRuQCLcBGAs/s1600/F5%25253D7%257B2PZQ%257EZ6UCX62ZA5I.png>
>
>
> <https://lh3.googleusercontent.com/-sqqNXxGAYUo/WhfH0QN41bI/AAAAAAAAACc/TKGQxoqS4gc0xi6-y5BMua1hRGUJsstfACLcBGAs/s1600/5DKEW%255BG%2540J%257EZ%2540NDKSU%2540%2528N_PD.png>
>
>  
> Regrads
> Echo
>
>  
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/ac8f339e-ce47-4de9-9017-d86a3e421639%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/ac8f339e-ce47-4de9-9017-d86a3e421639%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/26321246-fa78-4109-983b-17a61083987a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public class HelloTest {

public static void main(String[] args)  {
		Hello h=new Hello();
		}
}
public class Hello {

	public Hello(){
		int i=(int)(Math.random()*100);
		testGoto(i);
	}
	
    
    public void testGoto(int i){
     if(i==1){
     	System.out.println("i==1");
     }else{
     	System.out.println("i!=1");
     }
}
}

Attachment: HelloTest.class
Description: application/java-vm

Attachment: Hello.class
Description: application/java-vm

Reply via email to