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

Bug 335372

Summary: M5ish change in IMarker is not (source?) compatible
Product: [Eclipse Project] Platform Reporter: David Williams <david_williams>
Component: ResourcesAssignee: James Blackburn <jamesblackburn+eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jamesblackburn+eclipse, Szymon.Brandys
Version: 3.7Flags: john.arthorne: review+
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch 1
none
test1 none

Description David Williams CLA 2011-01-25 14:59:51 EST
After trying one of the latest builds towards M5 (I20110124-1800), we in WTP got a compile error related to IMarker::setAttributes(Map<String,Object> attributes)

See WTP bug 335271. 

We had a call that (previously) used 
HashMap<String,Integer> 
as a parameter, and now gives compile error. 

Fairly sure IMarker changed from M4 to M5 (not our code). And, I'll admit I don't understand generics well ... but is this the kind of change that is "binary compatible" but not "source compatible"? 

(Or, could it be a JDT compiler bug?) 

Conceptually, sure seems like it should be fine, but, again, maybe I'm looking at it wrong. 

Thought I'd open this bug to at least let you know of the impact, even if not a true bug. I'm not sure of your practice, but maybe deserves mention if "migration guide" even if merely a source compatible issue?
Comment 1 James Blackburn CLA 2011-01-25 15:16:28 EST
Yes, this a source-level bug, it should be 

   	public void setAttributes(Map<String, ? extends Object> attributes) throws CoreException;

It'll work at runtime due to erasure.
Comment 2 James Blackburn CLA 2011-01-25 15:30:32 EST
Created attachment 187571 [details]
patch 1

Patch for the issue.
Comment 3 James Blackburn CLA 2011-01-25 15:31:08 EST
I think this needs to be fixed for M5 or people will run into it...
Comment 4 James Blackburn CLA 2011-01-25 15:43:07 EST
Created attachment 187573 [details]
test1

Fixes the generics warnings in MarkerTest.
Comment 5 James Blackburn CLA 2011-01-25 15:57:22 EST
John, this is a potential API breakage, can this go into M5?
Comment 6 John Arthorne CLA 2011-01-25 16:02:32 EST
Yes this source incompatibility was made unintentionally during generification of the API. Thanks for reporting it, and thanks for the patch James. I have released it immediately to make sure it gets in the M5 candidate build.
Comment 7 Szymon Brandys CLA 2011-01-26 04:33:17 EST
James could you verify the bug when the next IBuild is ready?
Comment 8 David Williams CLA 2011-02-21 05:11:36 EST
Just to cross-reference, for a possible similar case (in third party code, ICU), see bug 337699.