Skip to content
This repository has been archived by the owner. It is now read-only.

Validator error for AGREE Enum assignment #124

Closed
janetlj opened this issue Apr 13, 2018 · 2 comments
Closed

Validator error for AGREE Enum assignment #124

janetlj opened this issue Apr 13, 2018 · 2 comments
Assignees

Comments

@janetlj
Copy link

@janetlj janetlj commented Apr 13, 2018

In OSATE 2.3.2.vfinal version, when doing an assignment from a subcomponent feature of a datatype (e.g., Status_Type in the example below) that extends Enumeration_Type, to a local variable of the same type (e.g., active_status in the example below), the validator flags it as an error for the assignment (e.g., assign active_status = sub_test.active_status; in the example below), saying that the left side of the assignment is of Status_Type, while the right side of the assignment is of Enumeration_Type.

Code example:

data Enumeration_Type
	properties
		Data_Model::Data_Representation => Enum;
end Enumeration_Type;	

data Status_Type extends Enumeration_Type
	properties
		Data_Model::Enumerators => ("INVALID",
					"INPROGRESS", "COMPLETE");			
end Status_Type ;

   system test
       annex agree{**
           eq active_status: Status_Type;
         };
    end test;

    system implementation test.impl
         subcomponents
              sub_test: system sub_test;
          annex agree{**
               assign active_status = sub_test.active_status;
          **};
      end test.impl;

      system sub_test
         features
            active_status: out data port Status_Type;
        end sub_test;

Note: changing the assign active_status = sub_test.active_status; to the following got rid of the validator error:
eq active_status2: Enumeration_Type = sub_test.active_status;

@kfhoech kfhoech self-assigned this Apr 16, 2018
@kfhoech
Copy link
Contributor

@kfhoech kfhoech commented Apr 16, 2018

Duplicated in develop branch hash e9a3710.

The problem is that at AgreeJavaValidator.java:2696 the evaluation of type chases the type back to the type from which it was extended without regard to whether it is finding the primitive base type of an AADL subcomponent or whether the type is an enumeration type.

@kfhoech
Copy link
Contributor

@kfhoech kfhoech commented Apr 16, 2018

Resolved by Pull Request.

Thanks, @janetlj for finding this bug!

@kfhoech kfhoech closed this Apr 16, 2018
@kfhoech kfhoech added the v2.3.3 label Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants