Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335372 - M5ish change in IMarker is not (source?) compatible
Summary: M5ish change in IMarker is not (source?) compatible
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.7 M5   Edit
Assignee: James Blackburn CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-25 14:59 EST by David Williams CLA
Modified: 2011-02-21 05:11 EST (History)
2 users (show)

See Also:
john.arthorne: review+


Attachments
patch 1 (3.70 KB, patch)
2011-01-25 15:30 EST, James Blackburn CLA
no flags Details | Diff
test1 (8.05 KB, patch)
2011-01-25 15:43 EST, James Blackburn CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.