Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » AssertionFailed Exception with templates containing scriptles
AssertionFailed Exception with templates containing scriptles [message #52502] Wed, 29 October 2008 08:44 Go to next message
Jochen Wuttke is currently offline Jochen WuttkeFriend
Messages: 41
Registered: July 2009
Member
Hi,

I'm being bothered by the JET Template editor that fails to open
templates containing (or beginning) with scriptlets. The editor fails to
open the resource with an exception (exception and sample code follow).
Is this a bug or expected behavior?

Thanks
Jochen

Exception:

org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:111)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:97)
at org.eclipse.jface.text.Position.<init>(Position.java:62)
at
org.eclipse.jet.internal.editor.JETTextEditor$PositionsColle ctor.matchOffset(JETTextEditor.java:439)
at
org.eclipse.jet.internal.editor.JETTextEditor$PositionsColle ctor.visit(JETTextEditor.java:416)
at
org.eclipse.jet.core.parser.ast.JavaScriptlet.accept0(JavaSc riptlet.java:54)
at
org.eclipse.jet.core.parser.ast.JETASTElement.accept(JETASTE lement.java:105)
at
org.eclipse.jet.core.parser.ast.JETCompilationUnit.accept0(J ETCompilationUnit.java:128)
at
org.eclipse.jet.core.parser.ast.JETASTElement.accept(JETASTE lement.java:105)
at
org.eclipse.jet.internal.editor.JETTextEditor.requestCompila tionUnit(JETTextEditor.java:301)
at
org.eclipse.jet.internal.editor.JETTextEditor.getASTElement( JETTextEditor.java:309)
at
org.eclipse.jet.internal.editor.rules.ASTElementScannerRule. evaluate(ASTElementScannerRule.java:39)
at
org.eclipse.jet.internal.editor.rules.ASTElementScannerRule. evaluate(ASTElementScannerRule.java:33)
at
org.eclipse.jface.text.rules.RuleBasedScanner.nextToken(Rule BasedScanner.java:174)
at
org.eclipse.jface.text.rules.RuleBasedPartitionScanner.nextT oken(RuleBasedPartitionScanner.java:79)
at
org.eclipse.jface.text.rules.FastPartitioner.initialize(Fast Partitioner.java:166)
at
org.eclipse.jface.text.rules.FastPartitioner.checkInitializa tion(FastPartitioner.java:151)
at
org.eclipse.jface.text.rules.FastPartitioner.connect(FastPar titioner.java:143)
at
org.eclipse.jface.text.rules.FastPartitioner.connect(FastPar titioner.java:125)
at
org.eclipse.jet.internal.editor.configuration.JETDocumentPro vider.createDocument(JETDocumentProvider.java:45)
at
org.eclipse.ui.editors.text.FileDocumentProvider.createEleme ntInfo(FileDocumentProvider.java:734)
at
org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(A bstractDocumentProvider.java:398)
at
org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(Abst ractTextEditor.java:3991)
at
org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(Status TextEditor.java:190)
at
org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetI nput(AbstractDecoratedTextEditor.java:1325)
at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor .java:165)
at
org.eclipse.ui.texteditor.AbstractTextEditor$19.run(Abstract TextEditor.java:3026)
at
org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:458)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:366)
at
org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:758)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:755)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2487)
at
org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(Ab stractTextEditor.java:3044)
at
org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTe xtEditor.java:3071)
at
org.eclipse.jet.internal.editor.JETTextEditor.init(JETTextEd itor.java:134)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:799)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:643)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:266)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2820)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:337)
at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:325)
at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:187)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3482)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3068)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
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(EclipseS tarter.java:386)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)


The shortest template I have to reproduce this looks like this:

<%
String classname="";
%>
<c:iterate select="sort($class/@name |
$class/ancestor::*[@type='uml:Class']/@name,'count(ancestor: :*)') " var="p">
<%
String
p=context.getVariable("p").toString().replaceAll("name=", "").replace('.','
').replaceAll(" ", "");
if (classname!="")
classname=classname.concat(".");
classname=classname.concat(p);
%>
</c:iterate >
<%
context.setVariable("className",classname);

classname=classname.replace('.', '_');
context.setVariable("fileName",classname);
%>
Re: AssertionFailed Exception with templates containing scriptles [message #52586 is a reply to message #52502] Wed, 29 October 2008 12:17 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Jochen:

In general assertion failures are bugs. Feel free to submit a bugzilla:

https://bugs.eclipse.org/bugs/enter_bug.cgi

Enter it under Modeling / M2T / JET Editor

And, as always, patches are welcome.

Paul
Re: AssertionFailed Exception with templates containing scriptles [message #52638 is a reply to message #52586] Wed, 29 October 2008 13:34 Go to previous message
Jochen Wuttke is currently offline Jochen WuttkeFriend
Messages: 41
Registered: July 2009
Member
I opened a bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=252583),
and I'd love to provide a patch. Depends on how I find the time to do it.

Jochen

Paul Elder wrote:
> Jochen:
>
> In general assertion failures are bugs. Feel free to submit a bugzilla:
>
> https://bugs.eclipse.org/bugs/enter_bug.cgi
>
> Enter it under Modeling / M2T / JET Editor
>
> And, as always, patches are welcome.
>
> Paul
>
>
Previous Topic:How to check if XPath query returns empty result?
Next Topic:[JET] Running a JET transform in headless mode
Goto Forum:
  


Current Time: Fri Dec 19 08:01:39 GMT 2014

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

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