eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

OCL file problems #348

Closed eclipse-ocl-bot closed 5 hours ago

eclipse-ocl-bot commented 5 hours ago

| --- | --- | | Bugzilla Link | 256040 | | Status | CLOSED FIXED | | Importance | P3 normal | | Reported | Nov 20, 2008 16:56 EDT | | Modified | May 27, 2011 02:41 EDT | | Reporter | Ed Willink |

Description

a) org.eclipse.ocl/plugin.properties has a "_UI_OCLcontent_type" for "_UI_OCL_content_type" typo leading to a % in the File Associations Preferences.

b) plugin.xml defines "ocl" as the extension for a variety of different files, none of which are sensibly OCL.

For users, OCL is primarily a textual language, so the "ocl" extension should be reserved for the text file.

This is particularly important given a bug in Java 6:

java.lang.NullPointerException: charsetName\ at java.io.OutputStreamWriter.(OutputStreamWriter.java:82)\ at org.eclipse.emf.ecore.resource.URIConverter$ReadableInputStream$Buffer.(URIConverter.java:357)\ at org.eclipse.emf.ecore.resource.URIConverter$ReadableInputStream.read(URIConverter.java:317)\ at org.eclipse.emf.ecore.resource.ContentHandler$ByteOrderMark.read(ContentHandler.java:275)\ at org.eclipse.emf.ecore.resource.impl.ContentHandlerImpl.getByteOrderMark(ContentHandlerImpl.java:141)\ at org.eclipse.emf.ecore.resource.impl.ContentHandlerImpl.contentDescription(ContentHandlerImpl.java:122)\ at org.eclipse.emf.ecore.xmi.impl.XMLContentHandlerImpl.contentDescription(XMLContentHandlerImpl.java:233)\ at org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl.contentDescription(RootXMLContentHandlerImpl.java:225)\ at org.eclipse.emf.ecore.resource.impl.ContentHandlerImpl$Describer.describe(ContentHandlerImpl.java:226)\ at org.eclipse.emf.ecore.resource.impl.ContentHandlerImpl$Describer.describe(ContentHandlerImpl.java:246)\ at org.eclipse.core.internal.content.ContentType.describe(ContentType.java:161)\ at org.eclipse.core.internal.content.ContentType.internalGetDescriptionFor(ContentType.java:458)\ at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:314)\ at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:322)\ at org.eclipse.core.internal.content.ContentTypeMatcher.getDescriptionFor(ContentTypeMatcher.java:93)\ at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.computeEncoding(ResourceTextFileBuffer.java:444)\ at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.commitFileBufferContent(ResourceTextFileBuffer.java:339)\ at org.eclipse.core.internal.filebuffers.ResourceFileBuffer.commit(ResourceFileBuffer.java:321)\ at org.eclipse.ui.editors.text.TextFileDocumentProvider.commitFileBuffer(TextFileDocumentProvider.java:869)\ at org.eclipse.ui.editors.text.TextFileDocumentProvider$2.execute(TextFileDocumentProvider.java:794)\ at org.eclipse.ui.editors.text.TextFileDocumentProvider$DocumentProviderOperation.run(TextFileDocumentProvider.java:131)\ at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69)\ at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)\ at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)\ at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)\ at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:75)\ at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:65)\ at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:455)\ at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:771)\ at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:4816)\ at org.eclipse.ui.texteditor.AbstractTextEditor.doSave(AbstractTextEditor.java:4605)\ at org.eclipse.imp.editor.UniversalEditor.doSave(UniversalEditor.java:1730)\ at org.eclipse.qvt.declarative.editor.ui.imp.CommonTextEditor.doSave(CommonTextEditor.java:144)\ at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.doSave(AbstractTextEditor.java:6907)\ at org.eclipse.ui.Saveable.doSave(Saveable.java:212)\ at org.eclipse.ui.internal.SaveableHelper.doSaveModel(SaveableHelper.java:339)

The above NPE occurs while EMF reads an OCL text file to determine its XML content type without discovering a definition for the encoding.

Please avoid defining "ocl" as an XMI file.

I use the extensions oclecore and oclemof for AST serialisation.

eclipse-ocl-bot commented 5 hours ago

By Christian Damus on Nov 23, 2008 20:25

Committed the following changes:

As changing the content-types and file-extensions in the genmodels required regeneration, I noticed that there were some inconsistencies in the generation that are still outstanding. These are addressed, so that re-generation again is "clean" (idempotent).

Testing this in a run-time workbench shows that Ecore and UML models are recognized as appropriate and loaded in their correct editors, and that the *.ocl{xmi,ecore,uml} files are loaded using the most appropriate resource implementations in the EMF reflective editor. Also, all strings show as their translated values in the Content Types preferences.

eclipse-ocl-bot commented 5 hours ago

By Christian Damus on Nov 25, 2008 23:17

Fix available in HEAD: 1.3.0.I200811251600.

eclipse-ocl-bot commented 5 hours ago

By Ed Willink on May 27, 2011 02:39

Closing after over a year in verified state.

eclipse-ocl-bot commented 5 hours ago

By Ed Willink on May 27, 2011 02:41

Closing after over a year in verified state.