Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 301843 - GraphicsToGraphics2DAdaptor violates its own API restriction
Summary: GraphicsToGraphics2DAdaptor violates its own API restriction
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: 2.3   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-04 10:16 EST by Ed Merks CLA
Modified: 2010-07-19 21:57 EDT (History)
2 users (show)

See Also:


Attachments
API filter to ignore the error (985 bytes, patch)
2010-02-04 10:17 EST, Ed Merks CLA
ahunter.eclipse: iplog+
Details | Diff
Screen capture of problem (45.74 KB, image/jpeg)
2010-03-18 13:42 EDT, Ed Merks CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Merks CLA 2010-02-04 10:16:13 EST
The org.eclipse.gmf.runtime.draw2d.ui.render.awt bundle has local preference settings that make extending @noextends classes an error yet GraphicsToGraphics2DAdaptor does exactly that. So extracting this from CVS results in a project with errors. It seems that a filter is needed. I'll attach a patch for that.
Comment 1 Ed Merks CLA 2010-02-04 10:17:34 EST
Created attachment 158179 [details]
API filter to ignore the error
Comment 2 Anthony Hunter CLA 2010-02-04 19:54:04 EST
Hmm, I wonder why the API tools in my development environment did not catch this.
Comment 3 Anthony Hunter CLA 2010-02-23 16:17:58 EST
I looked at this again and I am still not seeing this API Tools error. I cannot remember if I fixed anything or not. I pointed my baseline to both 3.5.2RC3 and 3.4.2.

I did apply an API filter as a result of the issue in Bug 292918 , but not to this particular bundle.

I am getting uncomfortable and given we have no need to cheat anything, I am going to remove the filters and make the runtime 1.4.0 for helios (As I said in Bug 292918 ).

Marking this one resolved fixed for now.
Comment 4 Ed Merks CLA 2010-02-23 16:28:27 EST
Te problem happens when hosted in 3.6M5.  It didn't happen earlier in 3.6 so  I think it's probably a bug fix in 3.6 itself to more strictly/properly check.  Did you try to reproduce it that way?
Comment 5 Ed Merks CLA 2010-03-18 13:42:33 EDT
Created attachment 162439 [details]
Screen capture of problem

It's really a problem.  It's still there in M6.  I must assume that the checking is more strict than in previous releases.
Comment 6 Anthony Hunter CLA 2010-03-31 12:57:12 EDT
Ed, can you tell me what your baseline is in the API Tools preferences? Is this Galileo SR2?

I have SR2 so I do not understand where you are getting this from.

Windows + Preferences -> Plug-in Development + API Baselines
If you select edit, can you tell me the version of org.eclipse.gmf.runtime.draw2d.ui.render.awt is in your baseline?
Comment 7 Ed Merks CLA 2010-03-31 19:25:13 EDT
I have no baselines.  That dialog is empty.  I don't think this is a problem relative to some baseline though.  It's a problem of extending a class that says it must not be implemented.   Of course I don't know much about this but it does strike me that when one plugin has class that is marked @noextends and another class in another plugin extends it that this is a violation of a constraint and an override of that constraint is needed...
Comment 8 Ed Merks CLA 2010-03-31 19:26:29 EDT
Oh, and I noticed you're asking about SR2 but I've already mentioned that this problem happens in M6.  It was not a problem until M5 nor would I expect it was a problem for SR2.
Comment 9 Anthony Hunter CLA 2010-04-28 20:32:14 EDT
I played some more and still cannot get this error.

If I apply your patch I get the new warning:
The API problem filter for: 'GraphicsToGraphics2DAdaptor illegally extends Graphics' is no longer used

You need to have a baseline set in the API Tools preference page. Without a baseline, I get zero API tools errors but one warning for every project in GMF:

An API baseline has not been set for the current workspace.	

Agreed that GraphicsToGraphics2DAdaptor illegally extends Graphics, although GraphicsToGraphics2DAdaptor is not API in GMF, so I do not think API tools reports this as an error anymore. Maybe it did with an older Eclipse version?

Alex, can you check this out tomorrow when you do the API tools test for Bug 279728 ? Do you see this API Tooling error?
Comment 10 Alex Boyko CLA 2010-04-29 12:34:27 EDT
Anthony, I do get this error. I corrected the Draw2D plugin dependency version from 3.5.1 to 3.6 and still get the error. (I committed the upgrade of the plugin version - I should have done this in the first place anyway)

The error is auto-corrected for me by adding an API filter for this error.
Comment 11 Anthony Hunter CLA 2010-04-30 14:01:32 EDT
(In reply to comment #10)
> Anthony, I do get this error. I corrected the Draw2D plugin dependency version
> from 3.5.1 to 3.6 and still get the error. (I committed the upgrade of the
> plugin version - I should have done this in the first place anyway)
> 
> The error is auto-corrected for me by adding an API filter for this error.

I installed a new eclipse on a second windows machine and I still do not see the error. 

In any case, Since we have two users who see the error, makes most sense to commit Ed's filter.

Committed to HEAD
Comment 12 Eclipse Webmaster CLA 2010-07-16 23:38:26 EDT
[target cleanup] 2.3 M7 was the original target milestone for this
bug
Comment 13 Eclipse Webmaster CLA 2010-07-19 21:57:10 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime was the original product and component for this bug