How to Clear Code Coverage Highlighting in Eclipse

Question

How can I remove code coverage highlighting in Eclipse after running tests?

Answer

Eclipse, when used with coverage tools like Cobertura or EMMA, highlights source code lines based on coverage results. This can clutter your view once you're done reviewing the reports. Fortunately, clearing this highlighting is straightforward.

Causes

  • Coverage highlighting is enabled by the coverage tools like Cobertura or EMMA after reports are generated.
  • The default behavior of Eclipse retains the highlighting to help developers quickly identify tested and untested code.

Solutions

  • Go to the 'Coverage' view in Eclipse.
  • Select the coverage report you want to clear.
  • Right-click on the report and choose 'Clear Coverage' from the context menu.
  • Alternatively, you can select 'Clear All Coverage' from the Coverage menu in the GUI. This will remove all highlights.

Common Mistakes

Mistake: Not selecting the correct coverage report before attempting to clear highlights.

Solution: Ensure you are right-clicking the appropriate coverage report in the Coverage view.

Mistake: Confusing clearing coverage with removing it permanently.

Solution: Clearing the highlighting does not delete the coverage data; it simply removes the visual cues from the editor.

Helpers

  • clear code coverage highlighting
  • Eclipse clear coverage report
  • remove coverage highlighting in Eclipse
  • Cobertura Eclipse plugin
  • EMMA plugin Eclipse remove highlight

Related Questions

⦿How to Enable JavaDocs Tooltips in IntelliJ IDEA?

Learn how to display JavaDocs tooltips on method hover in IntelliJ IDEA enhancing your coding experience with essential documentation.

⦿How to Send Emails in Android Using JavaMail API Without the Default Email App

Learn how to create an Android mail application using JavaMail API without launching the builtin email app. Stepbystep guide and code snippets included.

⦿How to Resolve `Unsupported major.minor version 52.0` Error in Java

Learn how to fix the Unsupported major.minor version 52.0 error in Java with detailed steps and code snippets.

⦿How to Programmatically Determine the Size of an Object in Java

Learn how to calculate the size of an object in Java to avoid OutOfMemoryErrors when processing large data sets.

⦿Why Isn't There a ConcurrentHashSet in Java Similar to ConcurrentHashMap?

Explore the reasons behind the absence of ConcurrentHashSet in Java its basis on ConcurrentHashMap and how to create your own threadsafe Set.

⦿Understanding NoClassDefFoundError in Java: Causes and Solutions

Explore the common causes of NoClassDefFoundError in Java and discover effective solutions to resolve this issue in your applications.

⦿What Are the Key Differences Between JPA and Hibernate?

Discover the essential differences between JPA and Hibernate including practical use cases features and recommended resources for learning.

⦿How to Parse ISO 8601 Date Format in Java: 2011-08-12T20:17:46.384Z

Learn how to parse the ISO 8601 date format in Java using SimpleDateFormat. Discover solutions to common parsing errors with tips.

⦿Is It Legal to Remove Items from a Collection While Iterating in Java?

Learn about removing elements from a collection during iteration in Java using foreach loops. Understand ConcurrentModificationException and safe practices.

⦿Real-Life Examples of GoF Design Patterns in Java's Core Libraries

Explore practical examples of Gang of Four design patterns found in Javas core libraries. Enhance your understanding of these essential concepts.

© Copyright 2025 - CodingTechRoom.com