Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] NPE in content assist
[ATL] NPE in content assist [message #69547] Thu, 13 December 2007 18:06 Go to next message
Matthias Bohlen is currently offline Matthias BohlenFriend
Messages: 30
Registered: July 2009
Member
Hello,

when I activate the new checkbox "Enable auto activation" inside
Eclipse, Preferences, ATL, Editor, Code Assist, and then I click
Ctrl-Space, I get the following NullPointerException:

Warning: one refSetting crashed:
java.lang.NullPointerException
at
org.eclipse.gmt.tcs.injector.TCSInjector$RefSetting.doItForC ontext(TCSInjector.java:554)
at

org.eclipse.gmt.tcs.injector.TCSInjector$RefSetting.doIt(TCS Injector.java:695)
at
org.eclipse.gmt.tcs.injector.TCSInjector.performImportation( TCSInjector.java:284)
at

org.eclipse.gmt.tcs.injector.TCSInjector.performImportation( TCSInjector.java:218)
at

org.eclipse.gmt.tcs.injector.TCSInjector.performImportation( TCSInjector.java:167)
at

org.eclipse.gmt.tcs.injector.TCSInjector.inject(TCSInjector. java:97)
at
org.eclipse.m2m.atl.adt.ui.text.atl.AtlCompletionHelper.pars eExpression(AtlCompletionHelper.java:170)
at

org.eclipse.m2m.atl.adt.ui.text.atl.AtlCompletionHelper.comp uteContext(AtlCompletionHelper.java:88)
at

org.eclipse.m2m.atl.adt.ui.text.atl.AtlCompletionProcessor.c omputeCompletionProposals(AtlCompletionProcessor.java:82)
at

org.eclipse.jface.text.contentassist.ContentAssistant.comput eCompletionProposals(ContentAssistant.java:1759)
at

org.eclipse.jface.text.contentassist.CompletionProposalPopup .computeProposals(CompletionProposalPopup.java:478)
at

org.eclipse.jface.text.contentassist.CompletionProposalPopup .access$16(CompletionProposalPopup.java:475)
at

org.eclipse.jface.text.contentassist.CompletionProposalPopup $2.run(CompletionProposalPopup.java:410)
at

org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.jface.text.contentassist.CompletionProposalPopup .showProposals(CompletionProposalPopup.java:404)
at

org.eclipse.jface.text.contentassist.ContentAssistant$2.run( ContentAssistant.java:354)
at

org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at

org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3212)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2956)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at

org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at

org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:153)
at

org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at

org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at

org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at

java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)

My transformation script:

module UML2EnterpriseApp;
create OUT : EnterpriseApp from PRO: UML2, IN: UML2;

uses UML2Helpers;

-- @nsURI UML2=http://www.eclipse.org/uml2/2.1.0/UML

-- get the root node of the UML model (there is only one)
helper def: modelRoot: UML2!Model =
UML2!Model.allInstances()->asSequence()->first();

-- Transform UML model to EnterpriseApp model
rule UMLModelToEnterpriseAppModel {
from model : UML2!Model
to out : EnterpriseApp!EAppModel (
model
)
}
-- Transform UML2 classes that have the stereotype "Service"
-- to EnterpriseApp services.
rule UMLServiceToEnterpriseAppService {
from class : UML2!Class (class.oclIsTypeOf(UML2!Class) and
class.hasStereotype('Service'))
to out : EnterpriseApp!Service (
name <- class.name->debug('UMLServiceToEnterpriseAppService'),
methods <- class.ownedOperation->debug('UMLServiceToEnterpriseAppService'),
sourceReferences <-
class.clientDependency->debug('UMLServiceToEnterpriseAppService'),
model <- thisModule.modelRoot
)
do {
thisModule.links->debug('TransientLinkSet');
}
}

-- Transform UML2 classes that have the stereotype "Entity"
-- to EnterpriseApp entities.
rule UMLEntityToEnterpriseAppEntity {
from class : UML2!Class (class.oclIsTypeOf(UML2!Class) and
class.hasStereotype('Entity'))
to out : EnterpriseApp!Entity (
name <- class.name->debug('UMLEntityToEnterpriseAppEntity'),
methods <- class.ownedOperation->debug('UMLEntityToEnterpriseAppEntity'),
properties <- class.ownedAttribute->debug('UMLEntityToEnterpriseAppEntity'),
model <- thisModule.modelRoot
)
do {
thisModule.links->debug('TransientLinkSet');
}
}

-- Transform UML dependencies to EnterpriseApp references
rule UMLDependencyToEnterpriseAppReference {
from dep : UML2!Dependency (dep.supplier->first().hasStereotype('Entity'))
to out : EnterpriseApp!Reference (
target <- dep.supplier->first()
)
}

-- Transform UML2 operations to OOP methods.
rule UMLOpToOOPMethod {
from method : UML2!Operation
to out : EnterpriseApp!Method (
name <- method.name
,returnType <- method.type
,parameters <-
method.ownedParameter->select(x|x.direction<>#return)->asSequence()
,instanceScope <- not method.isStatic
)
}


-- Transform UML2 parameters to OOP parameters.
rule UMLParameterToOOPParameter {
from param : UML2!Parameter (param.direction <> #return)
to out : EnterpriseApp!Parameter (
name <- param.name ,
type <- param.type
)
}

-- Transform UML2 datatype to OOP datatype.
rule UMLDataTypeToOOPDatatype {
from type : UML2!DataType
to out : EnterpriseApp!Type (
name <- type.name->debug('UMLDataTypeToOOPDatatype')
)
}

-- Transform UML2 property to OOP property
rule UMLPropertyToOOPProperty {
from attr : UML2!Property
(attr.featuringClassifier->first().hasStereotype('Service') or
attr.featuringClassifier->first().hasStereotype('Entity'))
to out : EnterpriseApp!Property (
name <- attr.name->debug('UMLPropertyToOOPProperty'),
type <- attr.type->debug('UMLPropertyToOOPProperty')
)
do {
thisModule.links->debug('TransientLinkSet');
}
}

Can somebody check this, please?
Thanks
Matthias Bohlen
Re: [ATL] NPE in content assist [message #69569 is a reply to message #69547] Thu, 13 December 2007 18:08 Go to previous messageGo to next message
Matthias Bohlen is currently offline Matthias BohlenFriend
Messages: 30
Registered: July 2009
Member
On 2007-12-13 19:06:26 +0100, Matthias Bohlen <infomail@mbohlen.de> said:

> rule UMLModelToEnterpriseAppModel {
> from model : UML2!Model
> to out : EnterpriseApp!EAppModel (
> model
> )
> }

The word "model" before the round closing parenthesis is the place
where I pressed Ctrl-Space.

Cheers
Matthias
Re: [ATL] NPE in content assist [message #69626 is a reply to message #69569] Thu, 13 December 2007 20:46 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi Matthias,

>> rule UMLModelToEnterpriseAppModel {
>> from model : UML2!Model
>> to out : EnterpriseApp!EAppModel (
>> model
>> )
>> }
>
> The word "model" before the round closing parenthesis is the place where
> I pressed Ctrl-Space.

The content assist code uses TCS to parse programs into models that it
can navigate to provide completion suggestions.

In some cases, the program is not valid when you press Ctrl-Space, which
can generate errors.

These errors should be caught and, for instance, added to the Problem
model that the TCS injector can generate. Please, feel free to file a
bug about this.


Do you get this error in the console, or in the error log? For instance,
if it is in the console, it is probably not preventing you from using
content assist correctly.


Regards,

Frédéric Jouault
Re: [ATL] NPE in content assist [message #69686 is a reply to message #69626] Thu, 13 December 2007 22:24 Go to previous messageGo to next message
Matthias Bohlen is currently offline Matthias BohlenFriend
Messages: 30
Registered: July 2009
Member
On 2007-12-13 21:46:05 +0100, Frédéric Jouault
<frederic.jouault@univ-nantes.fr> said:

> Hi Matthias,
>
> >> rule UMLModelToEnterpriseAppModel {
> >> from model : UML2!Model
> >> to out : EnterpriseApp!EAppModel (
> >> model
> >> )
> >> }
> >
> > The word "model" before the round closing parenthesis is the place where
> > I pressed Ctrl-Space.
>
> The content assist code uses TCS to parse programs into models that it
> can navigate to provide completion suggestions.
>
> In some cases, the program is not valid when you press Ctrl-Space,
> which can generate errors.

Well, in the first place, I expected a list of attributes to appear
when I type "." or Ctrl-Space. The list should contain the attributes
of the model, so that I can select one of them, for example "name", and
then continue typing the rest of the expression/statement.

> These errors should be caught and, for instance, added to the Problem
> model that the TCS injector can generate. Please, feel free to file a
> bug about this.
>
> Do you get this error in the console, or in the error log? For
> instance, if it is in the console, it is probably not preventing you
> from using content assist correctly.

I get the error inside the console of the parent instance of Eclipse.
ATL runs inside a runtime workbench, and the exception is displayed in
the console of the original Eclipse instance from where I started the
runtime workbench. Content assist does not work at all, though. No
assistance visible.

I'll add an entry to Bugzilla.

Cheers
Matthias
Re: [ATL] NPE in content assist [message #69725 is a reply to message #69686] Fri, 14 December 2007 12:06 Go to previous message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010604050908020401050306
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

Matthias Bohlen a
Previous Topic:[ATL] AtlLauncher launch -List superimpose- argument
Next Topic:[ATL] Copy Ecore Files.launch does not exist
Goto Forum:
  


Current Time: Fri Apr 19 13:09:03 GMT 2024

Powered by FUDForum. Page generated in 0.01513 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top