Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 137356

Summary: [Markers] marker grouping not working as expected via markerSupport
Product: [Eclipse Project] Platform Reporter: Darin Wright <darin.eclipse>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Mike_Wilson, Tod_Creasey
Version: 3.2   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 137483    
Bug Blocks:    
Attachments:
Description Flags
Workaround for 137356
none
screenshot none

Description Darin Wright CLA 2006-04-18 15:48:30 EDT
N20060418-0010

The Java tooling now warns when a buildpath references an execution environment for which there is no exact match in the workspace (warning support is in HEAD as of today - org.eclipse.jdt.launching and org.eclipse.jdt.debug.ui plugins). The marker created should be categorized as a buildpath problem with other JDT build path problems. To do this, I create a marker support extension as follows (in jdt.debug.ui).

 <extension
       point="org.eclipse.ui.ide.markerSupport">
    <markerAttributeGrouping
          defaultGroupingEntry="org.eclipse.jdt.ui.category.buildpath"
          markerType="org.eclipse.jdt.launching.jreContainerMarker"/>
 </extension>	

My understanding is that this should group all markers of type "org.eclipse.jdt.launching.jreContainerMarker" as buildpath problems. JUI has a corresponding grouping entry:

    <markerGroupingEntry id="org.eclipse.jdt.ui.category.buildpath"
        markerGrouping="org.eclipse.jdt.ui.java_marker_category"
        label="%MarkerCategory.buildpath"
        priority="100"/>

I get the following error in the log:

Reference to invalid markerGroupingEntry org.eclipse.jdt.ui.category.buildpath
Comment 1 Tod Creasey CLA 2006-04-19 08:09:59 EDT
Darin what plug-in is your entry in?
Comment 2 Tod Creasey CLA 2006-04-19 09:18:04 EDT
Created attachment 38921 [details]
Workaround for 137356

Here is a patch to IDE that works around this problem. Darin if you could get me a way to test your contribution I would like to test it with this patch.

I'll need
1) Instructions on how to create the error you are trying to categorize
2) Any more information on adding this to your code. I assume you are doing this org.eclipse.jdt.debug.ui (I didn't see this markup in 04180100).
Comment 3 Darin Wright CLA 2006-04-19 10:12:26 EDT
Tod, the nightly build now contains the code for this (N20060419-0840). 

Steps to reproduce:

* Start a new empty workspace with a 1.4 or 1.5 (or greater) JRE

* Create a new Java project

* Specify an execution environment on the project's build path to be bound to a J2SE-1.3 environment (expand the project in the package explorer, select the JRE and "Configure..." from the context menu - use the 'Execution Environment' radio button/drop down to select J2SE-1.3, press "Finish")

* Since your workspace only has a 1.4 or greater JRE, a warning should appear for your project along the lines of "Build path specifies unavailable execution environment: J2SE-1.3"

* In the problems view, select "Group By > Java Problem Type". 

* The problem appears in the "Other Problems" group, rather than "Build Path".

NOTES:

1) The org.eclipse.jdt.debug.ui plug-in defines the grouping for the problem marker:

 <extension
       point="org.eclipse.ui.ide.markerSupport">
    <markerAttributeGrouping
          defaultGroupingEntry="org.eclipse.jdt.ui.category.buildpath"
          markerType="org.eclipse.jdt.launching.jreContainerMarker"/>
 </extension>

2) The problem marker type is defined in the org.eclipse.jdt.launching plug-in

Comment 4 Tod Creasey CLA 2006-04-19 13:21:25 EDT
Thanks Darin - my refactoring handles this case.

McQ I'll need a +1 on this one.
Comment 5 Tod Creasey CLA 2006-04-19 13:22:59 EDT
Fix has been released to HEAD
Comment 6 Mike Wilson CLA 2006-04-19 13:50:51 EDT
+1
Comment 7 Tod Creasey CLA 2006-04-26 07:48:13 EDT
Verified in 20060425
Comment 8 Darin Wright CLA 2006-05-01 14:56:07 EDT
Still a problem in RC2
Comment 9 Darin Wright CLA 2006-05-01 14:57:44 EDT
Created attachment 39980 [details]
screenshot

Screen shot shows that when problems are grouped by type, the buildpath problem displays with group title "org.eclipse.jdt...." rather than "build path problems".
Comment 10 Tod Creasey CLA 2006-05-01 15:20:52 EDT
Darin this bug is to do with Java Problem Type - by Type is another grouping (based on the name of the marker). These are the values you see in the Filters Dialogs when in the  "Show Items of Type" column.

If you group by Java Problem Type you will see it is correct.

Your problem is that 

 <extension
         id="jreContainerMarker"
         point="org.eclipse.core.resources.markers">
      <super type="org.eclipse.core.resources.problemmarker"/>
      <persistent value="true"/>

is missing a name.

See Bug 139581.

Verified on RC2
Comment 11 Tod Creasey CLA 2006-05-01 15:21:09 EDT
Remarking verified