Skip to content

Wrong methods of class RelationType in requirement.py #258

@mc2172

Description

@mc2172

The class Relation type has errors in methods get_relation_type/set_relation_type.
get_relation_type is returning a Java object instead instead Python object, while set_relation_type is expecting a Python object, but the actual code makes use of Java object.

The original code is

    def get_relation_type(self) -> RelationType:
        """
        Returns: RelationType
        """
        return self.get_java_object().getRelationType()
    def set_relation_type(self, value: RelationType):
        """
        Parameters: value: RelationType
        """
        self.get_java_object().setRelationType(value)

It should be patched as below

    def get_relation_type(self) -> RelationType:
        """
        Returns: RelationType
        """
        value = self.get_java_object().getRelationType()
        if  value is None:
            return value
        else:
            return RelationType(value)
    def set_relation_type(self, value: RelationType):
        """
        Parameters: value: RelationType
        """
        self.get_java_object().setRelationType(value.get_java_object())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions