Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328359 - [prefs] Add singleton instance of InstanceScope
Summary: [prefs] Add singleton instance of InstanceScope
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-21 10:40 EDT by John Arthorne CLA
Modified: 2011-02-28 09:06 EST (History)
6 users (show)

See Also:


Attachments
patch (6.15 KB, patch)
2010-12-17 14:57 EST, DJ Houghton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2010-10-21 10:40:17 EDT
I can't think of any benefit for clients to create new instances of InstanceScope. We should add a singleton field so clients don't have to create a new instance:

InstanceScope.INSTANCE.getNode(...) instead of new InstanceScope().getNode(...)
Comment 1 Markus Keller CLA 2010-10-21 10:57:43 EDT
That applies to all 4 subclasses of AbstractScope.
Comment 2 DJ Houghton CLA 2010-12-17 14:57:55 EST
Created attachment 185455 [details]
patch
Comment 3 DJ Houghton CLA 2010-12-17 14:58:39 EST
Patch released to HEAD.
Comment 4 Markus Keller CLA 2010-12-22 09:17:46 EST
Any reason for not deprecating the constructors?
Comment 5 DJ Houghton CLA 2011-01-05 10:36:07 EST
Just waiting for the new year so I could update the copyrights to 2011. ;-)
Released to HEAD.
Comment 6 Laurent Goubet CLA 2011-02-28 08:25:16 EST
And here I was writing a comment about how you marked this as "@since 3.4" instead of "@since 3.7" ... without realizing equinox does not follow the numbering of the Eclipse platform :p.

I broke the compatibility of my project with Eclipse 3.5 and Eclipse 3.6 by using this new singleton thinking the @since was enough reason for me to do it without checking too much into it... Now I just have to pay chocolate to my team (http://model-driven-blogging.blogspot.com/2008/01/chocolate-commit.html) and pay a little more attention in the future :p.
Comment 7 Thomas Watson CLA 2011-02-28 09:06:29 EST
(In reply to comment #6)
> And here I was writing a comment about how you marked this as "@since 3.4"
> instead of "@since 3.7" ... without realizing equinox does not follow the
> numbering of the Eclipse platform :p.
> 

It not that we don't follow the numbering of the Eclipse platform.  It is because all of our bundles are versioned independently.  You will find that there are a number of other bundles in the eclipse platform for 3.7 that are not versioned at 3.7 either.