Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#5668 closed defect (fixed)

Duplicate of Modelica class with dot in class name leads to unstable OMEdit state

Reported by: Christian Kral <dr.christian.kral@…> Owned by: Adeel Asghar
Priority: blocker Milestone: 1.16.0
Component: OMEdit Version: v1.14.0-dev-nightly
Keywords: Cc:

Description

Create a new empty Modelica class M in OMEdit. Make a double click on M, make a right click and select 'Duplicate':

Name: M.2

OMEdit hangs...

This applies to

Connected to OpenModelica 1.14.0~dev-26782-g1817194
Connected to OMSimulator unknown-linux

Change History (6)

comment:1 by Christian Kral <dr.christian.kral@…>, 5 years ago

Summary: Duplicate of Modelica class allows illegal charactersDuplicate of Modelica class causes OMEdit to hang

comment:2 by Francesco Casella, 5 years ago

Summary: Duplicate of Modelica class causes OMEdit to hangDuplicate of Modelica class with dot in class name leads to unstable OMEdit state

I cannot reproduce the crash with the latest nightly build on Windows. What I get is:

[1] 09:07:59 Syntax Warning
[: 1:1-1:3]: Treating .2 as 0.2. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.

[2] 09:07:59 Syntax Error
[: 1:0-1:0]: No viable alternative near token: M

[3] 09:07:59 Syntax Warning
[: 1:1-1:3]: Treating .2 as 0.2. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.

[4] 09:07:59 Syntax Error
[: 1:0-1:0]: No viable alternative near token: M

[5] 09:07:59 Scripting Warning
Could not preserve the formatting of the model instead internal pretty-printing algorithm is used.

[6] 09:07:59 Syntax Warning
[: 1:1-1:3]: Treating .2 as 0.2. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.

[7] 09:07:59 Syntax Error
[: 1:0-1:0]: No viable alternative near token: M

[8] 09:07:59 Syntax Warning
[: 1:1-1:3]: Treating .2 as 0.2. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.

[9] 09:07:59 Syntax Error
[: 1:0-1:0]: No viable alternative near token: M

[10] 09:07:59 Syntax Warning
[: 1:1-1:3]: Treating .2 as 0.2. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.

[11] 09:07:59 Syntax Error
[: 1:0-1:0]: No viable alternative near token: M

[12] 09:08:00 Syntax Warning
[: 1:1-1:3]: Treating .2 as 0.2. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.

[13] 09:08:00 Syntax Error
[: 1:0-1:0]: No viable alternative near token: M

then the situation gets messy, because I see a model M.2 in the library browser which is obviously invalid, and there is no way to get rid of it.

@adeas31 I guess we should check that new class names do not contain dots, and reject them if they do. This also holds for "New Modelica class".

comment:3 by Martin Sjölund, 5 years ago

It reproduces just fine on Linux:

getConnectionCount(M.2) 09:22:03:517
140734638623360 09:22:03:517
#s#; 0.000000; 0.196000; 'getConnectionCount(M.2)'

...

getNthConnection(M.2,211213); getErrorString();
getNthConnectionAnnotation(M.2, 211213); getErrorString();
getNthConnection(M.2,211214); getErrorString();
getNthConnectionAnnotation(M.2, 211214); getErrorString();

...

comment:4 by Martin Sjölund, 5 years ago

Of course I guess:

existClass(M.2) 09:22:03:423
Error occurred building AST
Syntax Error

being treated as true might be another problem... (Not sure if it did, but I suspect so)

comment:5 by Adeel Asghar, 5 years ago

Milestone: Future1.15.0
Resolution: fixed
Status: newclosed

comment:6 by Francesco Casella, 4 years ago

Milestone: 1.15.01.16.0

Release 1.15.0 was scrapped, because replaceable support eventually turned out to be more easily implemented in 1.16.0. Hence, all 1.15.0 tickets are rescheduled to 1.16.0

Note: See TracTickets for help on using tickets.