Skip to content

getObjectClass() returns a new Class instance without equals support #9

@BenjaminKlatt

Description

@BenjaminKlatt

To test a Class element if it represents the java.lang.Object is not supported using the getObjectClass() and the equals method.

getObjectClass() always returns a new instance and the equals() method is not implemented for ClassImpl or ConcreteClassifier.

For example, the following code always returns false, even if the super class of the submitted class is the class java.lang.Object:

public boolean compareClasses(Class class){
Class objectClass = class.getObjectClass();
return(objectClass.equals(class.getSuperClass()));
}

Either the code should always return the same instance for a specific class, or the equals method should be implemented specific to the java meta model element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions