History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-27730
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Anna Kozlova
Reporter: Ronald Blaschke
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Always Ignore Interfaces in Code Coverage Results

Created: 18 Jan 08 20:12   Updated: Tuesday 15:21
Component/s: Code Coverage
Fix Version/s: Diana 8526

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,648
Fixed in build: 8,509
Severity: Low


 Description  « Hide
Interfaces are mostly excluded from code coverage results, except when they are not. Non-primitive constants cause the interface to be included with 0% coverage and a red bar on the constants.

Example:
Try running "C" with coverage enabled.

public interface I { // good void f(); int i = 42; float f = 42.0f; String s2 = "Test"; // bad Character c = new Character('c'); String s1 = new String("Test"); }

public class C implements I {
public void f() {
}

public static void main(final String[] args) { final C c = new C(); c.f(); System.out.println(I.c); System.out.println(I.s2); }
}



 All   Comments   Work Log   Change History      Sort Order:
Ronald Blaschke - 18 Jan 08 20:15 - edited
Sorry, missing code markup.
public interface I {
    // good
    void f();
    int i = 42;
    float f = 42.0f;
    String s1 = "Test";

    // bad
    Character c = new Character('c');
    String s2 = new String("Test");
}

public class C implements I {
    public void f() {
    }

    public static void main(final String[] args) {
        final C c = new C();
        c.f();
        System.out.println(I.c);
        System.out.println(I.s2);
    }
}

Alexander Chernikov - 01 Jul 08 15:21
8510: fixed for me.