Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364464 - Misleading description of InstanceScope.INSTANCE field
Summary: Misleading description of InstanceScope.INSTANCE field
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.6.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-22 08:50 EST by Lars Sonchocky-Helldorf CLA
Modified: 2011-11-23 08:46 EST (History)
3 users (show)

See Also:


Attachments
bug_364464_stack-trace.txt (10.81 KB, text/plain)
2011-11-22 08:55 EST, Lars Sonchocky-Helldorf CLA
no flags Details
bug_364464_screenshot.png (57.43 KB, image/png)
2011-11-22 08:56 EST, Lars Sonchocky-Helldorf CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Sonchocky-Helldorf CLA 2011-11-22 08:50:18 EST
Build Identifier: 0.7.9.I20111119-1700

I get an exception when trying to edit the preferences, see attachments.


Caused by: java.lang.NoSuchFieldError: INSTANCE
	at org.eclipse.team.svn.core.SVNTeamPlugin.getPreferences(SVNTeamPlugin.java:141)
	at org.eclipse.team.svn.core.svnstorage.AbstractSVNStorage.initialize(AbstractSVNStorage.java:500)
	at org.eclipse.team.svn.core.operation.file.SVNFileStorage.initialize(SVNFileStorage.java:63)
	at org.eclipse.team.svn.core.SVNTeamPlugin.start(SVNTeamPlugin.java:161)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)

Eclipse is:

eclipse.buildId=M20110210-1200
java.version=1.6.0_29
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product -keyring /Users/lars/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/lars/.eclipse_keyring -showlocation


Reproducible: Always

Steps to Reproduce:
1. Update Subversive to 0.7.9.I20111119-1700
2. Choose Preferences > Team > SVN
3. An error has occurred when creating this preference page.
Comment 1 Lars Sonchocky-Helldorf CLA 2011-11-22 08:55:50 EST
Created attachment 207356 [details]
bug_364464_stack-trace.txt

stack trace for bug 364464
Comment 2 Lars Sonchocky-Helldorf CLA 2011-11-22 08:56:40 EST
Created attachment 207357 [details]
bug_364464_screenshot.png

screenshot of the bug
Comment 3 Lars Sonchocky-Helldorf CLA 2011-11-22 19:46:26 EST
this blocks the whole plugin
Comment 4 Alexander Gurov CLA 2011-11-23 01:30:16 EST
Line 141 of the SVNTeamPlugin class:

public IEclipsePreferences getPreferences() {
line 141	return InstanceScope.INSTANCE.getNode(this.getBundle().getSymbolicName());
}

this code was introduced after removing deprecated API calls and according to the recomendations in line 54 of the class InstanceScope.

What is InstanceScope.INSTANCE ? It is public Eclipse Platform API since version 3.4:

package org.eclipse.core.runtime.preferences;

public final class InstanceScope extends AbstractScope {

	/**
	 * Singleton instance of an Instance Scope object. Typical usage is:
	 * <code>InstanceScope.INSTANCE.getNode(...);</code>
	 * 
	 * @since 3.4
	 */
	public static final IScopeContext INSTANCE = new InstanceScope();

	/**
	 * Create and return a new instance scope instance.
line 54	 * @deprecated call <code>InstanceScope.INSTANCE</code> instead.
	 */
	public InstanceScope() {
		super();
	}

So, now I'll move this bug to the Eclipse platform for further investigation.
Comment 5 Tom Chiverton CLA 2011-11-23 05:54:04 EST
I can't perform any SVN operations since todays automatic update which included Mylyn and some SVN bits).

Stack trace is the same:
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.team.svn.core (611).
	at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:121)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:338)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:232)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1197)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.team.core.RepositoryProvider.newProvider(RepositoryProvider.java:706)
	at org.eclipse.team.core.RepositoryProvider.mapNewProvider(RepositoryProvider.java:162)
	at org.eclipse.team.core.RepositoryProvider.mapExistingProvider(RepositoryProvider.java:235)
	at org.eclipse.team.core.RepositoryProvider.getProvider(RepositoryProvider.java:507)
	at org.eclipse.team.internal.core.TeamHookDispatcher.getProvider(TeamHookDispatcher.java:97)
	at org.eclipse.team.internal.core.TeamHookDispatcher.getRuleFactory(TeamHookDispatcher.java:105)
	at org.eclipse.core.internal.resources.Rules.factoryFor(Rules.java:92)
	at org.eclipse.core.internal.resources.Rules.createRule(Rules.java:70)
	at com.adobe.flexbuilder.util.DirectoryCreator.doOutputDirectoryCreate(DirectoryCreator.java:180)
	at com.adobe.flexbuilder.util.DirectoryCreator.createOutputDirectory(DirectoryCreator.java:78)
	at com.adobe.flexbuilder.project.actionscript.internal.ActionScriptProject.updateToolCompileSettings(ActionScriptProject.java:1401)
	at com.adobe.flexbuilder.project.actionscript.internal.ActionScriptProject.doSetProjectDescription(ActionScriptProject.java:1376)
	at com.adobe.flexbuilder.project.internal.FlexProject.doSetProjectDescription(FlexProject.java:407)
	at com.adobe.flexbuilder.project.actionscript.internal.ActionScriptProject.loadDescription(ActionScriptProject.java:497)
	at com.adobe.flexbuilder.project.actionscript.internal.ActionScriptProject.<init>(ActionScriptProject.java:183)
	at com.adobe.flexbuilder.project.internal.FlexBasedProject.<init>(FlexBasedProject.java:100)
	at com.adobe.flexbuilder.project.internal.FlexProject.<init>(FlexProject.java:85)
	at com.adobe.flexbuilder.project.actionscript.ActionScriptCore$2.doCreate(ActionScriptCore.java:318)
	at com.adobe.flexbuilder.project.actionscript.ActionScriptCore$ProjectCreator.run(ActionScriptCore.java:503)
	at com.adobe.flexbuilder.project.actionscript.ActionScriptCore$ProjectCreator.safeGetOrCreate(ActionScriptCore.java:472)
	at com.adobe.flexbuilder.project.actionscript.ActionScriptCore.getProject(ActionScriptCore.java:439)
	at com.adobe.flexbuilder.project.FlexProjectManager.getActionScriptOrFlexProject(FlexProjectManager.java:739)
	at com.adobe.flexbuilder.project.internal.ApplicationResourceListener$1.visit(ApplicationResourceListener.java:86)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
	at com.adobe.flexbuilder.project.internal.ApplicationResourceListener.resourceChanged(ApplicationResourceListener.java:76)
	at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:327)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1181)
	at org.eclipse.core.internal.resources.Marker.delete(Marker.java:70)
	at de.richinternet.flexbuilder.task.FlexDocumentListener.removeMarkers(FlexDocumentListener.java:208)
	at de.richinternet.flexbuilder.task.FlexDocumentListener.processDocument(FlexDocumentListener.java:125)
	at de.richinternet.flexbuilder.task.FlexDocumentListener.bufferCreated(FlexDocumentListener.java:73)
	at org.eclipse.core.internal.filebuffers.TextFileBufferManager$11.run(TextFileBufferManager.java:802)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireBufferCreated(TextFileBufferManager.java:800)
	at org.eclipse.core.internal.filebuffers.TextFileBufferManager.connect(TextFileBufferManager.java:127)
	at org.eclipse.ui.editors.text.TextFileDocumentProvider.createFileInfo(TextFileDocumentProvider.java:559)
	at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:478)
	at com.adobe.flexide.editorcore.editor.AbstractFlexDocumentProvider.connect(AbstractFlexDocumentProvider.java:87)
	at com.adobe.flexbuilder.mxml.editor.code.MXMLDocumentProvider.connect(MXMLDocumentProvider.java:65)
	at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4056)
	at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:217)
	at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1444)
	at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor.java:169)
	at com.adobe.flexide.editorcore.editor.AbstractFlexEditor.doSetInput(AbstractFlexEditor.java:1429)
	at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3043)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2606)
	at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3061)
	at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3088)
	at com.adobe.flexide.editorcore.editor.AbstractFlexEditor.init(AbstractFlexEditor.java:452)
	at com.adobe.flexide.mxml.core.editor.MXMLCoreEditor.init(MXMLCoreEditor.java:75)
	at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:237)
	at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:211)
	at com.adobe.flexbuilder.editorcore.editor.CodeAndDesignEditor.createPages(CodeAndDesignEditor.java:210)
	at com.adobe.flexbuilder.mxml.editor.MXMLEditor.createPages(MXMLEditor.java:284)
	at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
	at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271)
	at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1429)
	at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:942)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
	at org.eclipse.ui.internal.Workbench$31.runWithException(Workbench.java:1567)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	... 1 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.team.svn.core.SVNTeamPlugin.start() of bundle org.eclipse.team.svn.core.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
	at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
	at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
	... 119 more
Caused by: java.lang.NoSuchFieldError: org/eclipse/core/runtime/preferences/InstanceScope.INSTANCELorg/eclipse/core/runtime/preferences/IScopeContext;
	at org.eclipse.team.svn.core.SVNTeamPlugin.getPreferences(SVNTeamPlugin.java:141)
	at org.eclipse.team.svn.core.svnstorage.AbstractSVNStorage.initialize(AbstractSVNStorage.java:500)
	at org.eclipse.team.svn.core.operation.file.SVNFileStorage.initialize(SVNFileStorage.java:63)
	at org.eclipse.team.svn.core.SVNTeamPlugin.start(SVNTeamPlugin.java:161)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
	... 125 more
Comment 6 Alexander Gurov CLA 2011-11-23 06:05:41 EST
Is there anything that could be done on the Subversive side? Should I change the Subversive code to the previous version and use the deprecated calls instead?
Comment 7 Tom Chiverton CLA 2011-11-23 06:16:36 EST
Could you rollback the update site before anyone else has their plugin broken ?
Comment 8 Alexander Gurov CLA 2011-11-23 06:29:54 EST
(In reply to comment #7)
> Could you rollback the update site before anyone else has their plugin broken
Ok, the site will be restored to the previous version until the issue is taken care of.
Comment 9 Alexander Gurov CLA 2011-11-23 06:43:43 EST
It seems the real problem is the misleading part here:

    /**
     * Singleton instance of an Instance Scope object. Typical usage is:
     * <code>InstanceScope.INSTANCE.getNode(...);</code>
     * 
     * @since 3.4
     */
    public static final IScopeContext INSTANCE = new InstanceScope();

It is not "since 3.4", but actually "since 3.7". The changes related to this API usage will be undone in the Subversive, but I think it will be best to correct this statement.

P.S.
On the Subversive side the issue is fixed and the build with the fix will be published tomorrow (https://bugs.eclipse.org/bugs/show_bug.cgi?id=364572).
Comment 10 Tom Chiverton CLA 2011-11-23 06:46:47 EST
> published tomorrow
What about people who are already broken ? Can you produce an updated .jar or something that can be manually put in while the update site is being updated ?
Comment 11 Alexander Gurov CLA 2011-11-23 06:51:05 EST
(In reply to comment #10)
> > published tomorrow
> What about people who are already broken ? Can you produce an updated .jar or
> something that can be manually put in while the update site is being updated ?

I'm working on it now. It takes some time to make a signed build (about a hour will be enough). When build will be ready I'll write here.
Comment 12 Tom Chiverton CLA 2011-11-23 06:53:23 EST
Awesome.

I'll write back on http://www.eclipse.org/forums/index.php/t/262555/ once that's up.
Comment 13 Alexander Gurov CLA 2011-11-23 08:09:30 EST
(In reply to comment #12)
> Awesome.
> 
> I'll write back on http://www.eclipse.org/forums/index.php/t/262555/ once
> that's up.

It's done, works in Eclipse 3.6.x and available at the Early Access site. Replication to the mirrors will be finished probably by tomorrow.
Comment 14 Paul Webster CLA 2011-11-23 08:21:43 EST
(In reply to comment #9)
> It seems the real problem is the misleading part here:
> 
>     /**
>      * Singleton instance of an Instance Scope object. Typical usage is:
>      * <code>InstanceScope.INSTANCE.getNode(...);</code>
>      * 
>      * @since 3.4
>      */
>     public static final IScopeContext INSTANCE = new InstanceScope();
> 
> It is not "since 3.4", but actually "since 3.7". The changes related to this
> API usage will be undone in the Subversive, but I think it will be best to
> correct this statement.

API declarations within a bundle are tied to the bundle version, not the product version (3.6, WTP 3.1, Juno, Indigo, etc).

This was added to org.eclipse.equinox.preferences version 3.4.0, and the @since # must match the bundle version, not the product number (which can be any number of things).  Yes, prefs 3.4 was included in Eclipse SDK 3.7

PW
Comment 15 Alexander Gurov CLA 2011-11-23 08:25:52 EST
(In reply to comment #14)
Thank you for the answer. It seems to be the misunderstanding on my side. Then I'll close the report as "INVALID" one. Next time I'll be sure to check through all the Eclipse Platform versions first.
Comment 16 Paul Webster CLA 2011-11-23 08:46:04 EST
Just for complete information, the Eclipse TLP follows http://wiki.eclipse.org/Version_Numbering#Which_version_to_use_in_javadoc_tags when versioning its plugins (well, we try to anyway :-)

PW