On Fri, Nov 22, 2013 at 8:24 AM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,

You get the error because you do not have a setter to set the value of the isFlag property when importing the model.

How is this an indication of a problem?

I explicitly omitted the setter of the property so that the import of the property fails to show that the property is exported but cannot be imported. If the import doesn't fail then the property is not exported. I think this test can be handy in Moose.


 

Doru



On Thu, Nov 21, 2013 at 10:48 PM, Usman Bhatti <usman.bhatti@gmail.com> wrote:
I tried to reproduce it through various ways but couldn't, may be it was my image. I'll try to be more vigilant next time. In the meantime, I tried to reproduce the anomaly with this script, may be we can create a test (with a dummy class?)?

|model propertyName|
propertyName := 'isFlag'.
FAMIXMethod addInstVarNamed: propertyName.
FAMIXMethod compile: propertyName,
'<MSEProperty: #', propertyName,' type: #Boolean>
<MSEComment: ''A test flag''>
^', propertyName.

MooseModel resetMeta.
model := MooseModel new.
MoosePharoImporterTask new
importerClass: SmalltalkImporter;
doNotRunCandidateOperator; 
importingContext: (MooseImportingContext new importClass; importMethod; importPackage; yourself);
model: model;
addFromPackageNamed: #'Moose-TestResources-LAN';
run;
yourself.
model allMethods do: [ :each | each instVarNamed: propertyName put: true ].


model exportToMSEStream:(StandardFileStream forceNewFileNamed: 'aTestFile.mse').
MooseModel new importFromMSEStream:(StandardFileStream readOnlyFileNamed: 'aTestFile.mse') "should give an error because the propertyName: selector is absent"


On Thu, Nov 21, 2013 at 9:31 PM, Usman Bhatti <usman.bhatti@gmail.com> wrote:
I believe there is some sort of cache that is maintained somewhere because it works for me in the new image but if a property is added after exporting a model to a MSE file, it doesn't work.
Tx André for looking into it.

Usman



On Thu, Nov 21, 2013 at 8:58 PM, Andre Hora <andrehoraa@gmail.com> wrote:
It worked for me Usman, no problem.
As a test do:

isFlag
<MSEProperty: #isFlag type: #Boolean>
<MSEComment: 'my flag'>
^ true

Then, MooseModel resetMeta.
It will export ok:
=======
(FAMIX.Method (id: 147)
(name 'clearReplacements')
(cyclomaticComplexity 1)
(isFlag true)
(modifiers 'public')
(numberOfComments true)
(numberOfConditionals 0)
=======

Most probably your #isFlag property is nil, then it is not exported in the MSE file



On Thu, Nov 21, 2013 at 7:01 PM, Usman Bhatti <usman.bhatti@gmail.com> wrote:
I create a new property in a MooseEntity.

isFlag
<MSEProperty: #isFlag type: #Boolean>
<MSEComment: 'An exemplary flag'>
^ isFlag

I do MooseModel resetMeta.

I export the model with the entity containing the flag to an MSE.

isFlag property is absent in the mse file.

Is this a known bug/feature or do I need to update something?

Usman


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
Andre Hora

_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev