Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 9052 - StorageDocumentProvider#setDocumentContent creates Status with null plugin ID
Summary: StorageDocumentProvider#setDocumentContent creates Status with null plugin ID
Status: RESOLVED DUPLICATE of bug 14009
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 13591
  Show dependency tree
 
Reported: 2002-02-04 13:19 EST by John Arthorne CLA
Modified: 2002-05-03 05:40 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2002-02-04 13:19:50 EST
Build 20020129

On line 83 of StorageDocumentProvider, it creates a status like so:

IStatus s= new Status(IStatus.ERROR, null, IStatus.OK, x.getMessage(), x);

Note that it passes null as the second argument, which should be the plugin id.  
This will cause a RuntimeException in the Status constructor because a null ID 
is not allowed.  It should instead pass in the ID of the UI plugin.  This can 
happen, for example, if you try to double click on a file in the repositories 
view, but you don't have the appropriate permissions in the repository.  The 
following stack trace appears in the log in this case:

java.lang.IllegalArgumentException: 
	at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java(Compiled 
Code))
	at org.eclipse.core.runtime.Status.setPlugin(Status.java(Compiled Code))
	at org.eclipse.core.runtime.Status.setPlugin(Status.java(Compiled Code))
	at org.eclipse.core.runtime.Status.<init>(Status.java(Compiled Code))
	at 
org.eclipse.ui.editors.text.StorageDocumentProvider.setDocumentContent(StorageDo
cumentProvider.java:83)
	at 
org.eclipse.ui.editors.text.StorageDocumentProvider.setDocumentContent(StorageDo
cumentProvider.java:106)
	at 
org.eclipse.ui.editors.text.FileDocumentProvider.setDocumentContent(FileDocument
Provider.java:217)
	at 
org.eclipse.ui.editors.text.StorageDocumentProvider.createDocument(StorageDocume
ntProvider.java:126)
	at 
org.eclipse.ui.editors.text.StorageDocumentProvider.createElementInfo(StorageDoc
umentProvider.java:138)
	at 
org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentP
rovider.java:381)
	at 
org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvi
der.java:244)
	at 
org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:
1158)
	at 
org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:836)
Comment 1 Simon Arsenault CLA 2002-02-05 17:47:54 EST
Since the problem is in the text editor framework you are working with, could 
you fix this. Can you also check that it is not being done elsewhere in the 
text editor framework. I will verify the rest of Eclipse UI code. Thanks!
Comment 2 Kai-Uwe Maetzel CLA 2002-05-03 05:40:19 EDT

*** This bug has been marked as a duplicate of 14009 ***