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.comwrote:
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.comwrote:
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