New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having generated methods for abstract classes that implement interfaces #608

Closed
Nava2 opened this Issue Aug 26, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@Nava2
Member

Nava2 commented Aug 26, 2015

Originally reported on Google Code with ID 710
Owned by @vahdat-ab


Umple automatically generates a default implementation for those methods inside interfaces
not implemented in the class. This is reasonable when the class is not abstract (although
developers must get warning on it). If the class is abstract, there must not be a default
implementation. Those methods must be implemented by subclasses of that class.

interface I {
Integer I1();
}

class A {
isA I;
}

class B {
abstract;
isA I;
}
class C {
isA B;
}

class A gets an automatic implementation for the method I1(). class B gets an automatic
implementation for the method I1() which is wrong because it is abstract.
class C doesn't need to implement the method I() because it's already been implemented,
but it's wrong and there is no valid code there. This can sometimes create defects
which are hard to notice. There must always warnings regarding these kinds of situations.


Reported by @vahdat-ab on 2015-06-04 20:34:14

@VictoriaLacroix

This comment has been minimized.

Contributor

VictoriaLacroix commented Jan 15, 2016

I'd like to take this one.

VictoriaLacroix added a commit to VictoriaLacroix/umple that referenced this issue Jan 16, 2016

Fixed methods in Abstract class from Interface.
Resolved an issue where Umple was incorrectly generating default implementation of an interface's methods in abstract child classes. In the old behaviour, a class would always be forced to implement the methods from an interface. In the new behaviour, abstract methods will not implement the methods, and instead Umple will search for unimplemented methods for both the current class' parent interfaces and the whole chain of superclasses.

Fixes umple#608

Signed-off-by: Victoria Lacroix <victoria.a.lacroix@gmail.com>

VictoriaLacroix added a commit to VictoriaLacroix/umple that referenced this issue Jan 16, 2016

Fixed methods in Abstract class from Interface.
Resolved an issue where Umple was incorrectly generating default implementation of an interface's methods in abstract child classes. In the old behaviour, a class would always be forced to implement the methods from an interface. In the new behaviour, abstract methods will not implement the methods, and instead Umple will search for unimplemented methods for both the current class' parent interfaces and the whole chain of superclasses.

Fixes umple#608

Signed-off-by: Victoria Lacroix <victoria.a.lacroix@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment