Bug 279461 - Shell does not have @noextend API tag
Summary: Shell does not have @noextend API tag
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux-GTK
: P3 minor (vote)
Target Milestone: 3.7 RC2   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2009-06-08 09:26 EDT by Remy Suen CLA
Modified: 2011-05-19 11:03 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2009-06-08 09:26:09 EDT
I was helping someone on IRC last week with some SWT problems when I realized he had extended Shell. He claimed to not get any exceptions (via checkSubclass(), though I find that hard to believe). While confirming the code within checkSubclass(), I noticed that Shell does not have the @noextend API tag. From skimming around bug 261391, it seems it was just forgotten, is this correct? I noticed it says...

IMPORTANT: This class is not intended to be subclassed.

...instead of...

IMPORTANT: This class is <em>not</em> intended to be subclassed.

...which might explain why Carolyn missed it in her search?
Comment 1 Carolyn MacLeod CLA 2009-06-08 12:23:02 EDT
Thanks, Remy. Yes, it looks like I missed that one, and yes, checkSubclass() should have given a "Subclassing not allowed" SWTException for Shell.

I'll mark this for 3.6 and put it in early in the 3.6 cycle.
Comment 2 Carolyn MacLeod CLA 2010-06-04 10:22:09 EDT
Oops - moving to 3.7.
Comment 3 Carolyn MacLeod CLA 2011-05-16 12:22:29 EDT
Fixed > 20110516 for 3.7RC2.
Comment 4 Carolyn MacLeod CLA 2011-05-16 12:23:16 EDT
Marking Fixed.
Comment 5 Markus Keller CLA 2011-05-17 06:20:30 EDT
Carolyn, could you please set an API baseline (3.6.2) and then use the quick fix to add an API filter for the API change on Shell?

Olivier, I guess this also needs to be added to the API freeze exclusion list.
Comment 6 Olivier Thomann CLA 2011-05-17 14:37:32 EDT
Add these lines at the end of your .api_filters file:
<resource path="Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java" type="org.eclipse.swt.widgets.Shell">
<filter id="336744520">
<message_arguments>
<message_argument value="org.eclipse.swt.widgets.Shell"/>
</message_arguments>
</filter>
</resource>

You might also need the same filter for all platforms. This will work for win32.
Comment 7 Olivier Thomann CLA 2011-05-17 14:38:36 EDT
(In reply to comment #5)
> Olivier, I guess this also needs to be added to the API freeze exclusion list.
I will add it once I get the error reported in the API freeze report. This is the easiest way to run the tool and get the new exclusion.
Comment 8 Carolyn MacLeod CLA 2011-05-17 14:55:14 EDT
Olivier, can you come and work with me on this? We do not have a separate .api_filters file for each platform. I don't think the api filtering is set up to work with something multi-platform like swt. Our current file seems to be cocoa-based. There used to be win32 stuff in previous versions of the file, but someone must have released changes under cocoa, or maybe there is some other reason for this. Maybe we need one big file that filters all platforms. I will need help in constructing this file, or in figuring out an alternate solution. Thanks.
Comment 9 Carolyn MacLeod CLA 2011-05-18 14:33:41 EDT
I cannot get to this today - I have to leave now. Is tomorrow too late for .api_filters changes to go in for RC2?
Comment 10 Dani Megert CLA 2011-05-19 02:26:56 EDT
(In reply to comment #9)
> I cannot get to this today - I have to leave now. Is tomorrow too late for
> .api_filters changes to go in for RC2?

It depends on whether a rebuild will be requested (Thursday 08:00 EDT is the last official RC2 build).
Comment 11 Carolyn MacLeod CLA 2011-05-19 10:12:24 EDT
Thanks, Dani. Apparently, we are requesting a rebuild for a different problem, so I will piggyback on that.  :)

Olivier, I see why we have all cocoa and no other platforms in our current .api_filters (someone who was working on cocoa accidentally released the .api_filters file). Before that, we only had win32 filters. I don't understand why there aren't any win32 errors when I am on win32? There was only the one Shell error - which I fixed with quick fix. (Also, why did quick fix specify  standalone="no" ? Should I release that change?) Still need help, please.
Comment 12 Carolyn MacLeod CLA 2011-05-19 11:03:26 EDT
Fixed > 20110519.
Change in .api_filters is the same as in comment 6 (plus standalone="no").
Changed org.eclipse.pde.api.tools.prefs to ignore unused problem filters because we have a lot of them.
We will let the cocoa changes go through.
The reason there aren't a ton of win32 errors is that the api baseline has changed and the win32 api filters were already released long ago and saved in an .api_baseline file that is part of the project metadata.
Apparently, we are supposed to delete the .api_filters file every year after the release and start fresh. I will open a bug to do this.