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

Bug 328359

Summary: [prefs] Add singleton instance of InstanceScope
Product: [Eclipse Project] Equinox Reporter: John Arthorne <john.arthorne>
Component: CompendiumAssignee: DJ Houghton <dj.houghton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, gunnar, laurent.goubet, markus.kell.r, remy.suen, tjwatson
Version: 3.7   
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

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.