osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Name resolution issues #1009

Closed lwrage closed 6 years ago

lwrage commented 6 years ago

The capstone model templates show bogus errors after clean all in OSATE 2.3.1. Everything is fine in 2.2.3. The errors go away if a file with errors is opened in the text editor, trivially modified, and saved.

lwrage commented 6 years ago

Errors occur in OSATE 2.3.0, too.

lwrage commented 6 years ago

Created a generic example that exhibits the bad behavior.

lwrage commented 6 years ago

Behavior of the same model is different under Windows (errors occur during clean all) and Linux (errors occur during certain incremental builds but not for clean all). The issue is caused by the order in which aadl files are processed during a build. This order depends on file and directory names. Differences between Windows and Linux may be related to the fact that NTFS is case insensitive whereas EXT4 is case sensitive.

lwrage commented 6 years ago

The issue is in ClusteringBuilderState when resources are first loaded cross references to files that are not already loaded remain unresolved. The unresolvable URI fragments are cached in the resource, so they builder does not try to resolve them again. When the file is opened in the editor the references are resolved properly. The implemented workaround is to clear the cache in the builder. The root cause is probably the convoluted way the AADL linking service calls the default linking service when going to the parent component (in PropertiesLinkingService.getIndexedObject() ). This is almost certainly wrong.

lwrage commented 6 years ago

Maybe the fix helps with #731, too.

lwrage commented 6 years ago

The AADL linking service implementation has a major bug in that it discards proxies returned by the global scope provider!

lwrage commented 6 years ago

Clearing the cache is not sufficient. The simpler solution is not to cache unresolvable proxies. There's a method LazyLinkingResource.isUnresolvableProxyCacheable() that can be overridden to turn the cache off.