Menu

#204 CanonicalModelClassFactory fails when using Superstructure types with unexpected segments.

2.2
open
nobody
None
5
2015-02-11
2013-12-05
Tim Kutz
No

The CanonicalModelClassFactory, used to force the parser to return a specific version, or a specific message type, has an error when used to force the use of superstructure messages, such as ADT_AXX. The CanonicalModelClassFactory ignores the passed in version (usually retrieved by the caller from the message) and supplies the version that is stored in the factory's private myVersion field. When creating the factory for a specific version, (e.g., new CanonicalModelClassFactory("2.3");), this works as expected, since the myVersion field is populated in the constructor. However, when constructing to enforce a specific class, the myVersion field is not populated, which results in a null being passed as the version into the parent class method.

Locally, I've fixed this by adding the following line of code into the class-specific constructor:

    myVersion = getHighestKnownVersion();

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.