Echtzeitsysteme / java-refactoring-ttc

Object-oriented Refactoring of Java Programs using Graph Transformation (TTC'2015)
0 stars 0 forks source link

Multiplicities of overridden/hidden #7

Closed tsdh closed 9 years ago

tsdh commented 9 years ago

A field can only hide one single parent field, and a method can only override a single parent method (unless interfaces are involved). So I'd suggest to define their multiplicities as 0..1 instead of 0..*.

SvenPeldszus commented 9 years ago

You are right, the exclusion of interface reduces the multiplicities at this point to 0..1.

tsdh commented 9 years ago

Great!

tsdh commented 9 years ago

@SvenPeldszus You have adjusted the multiplicities of the wrong (opposite) references. There can be at most one overloaded method and at most one hidden field. But your changes say that there can be at most one overloading method and at most one hiding field which is wrong of course.

SvenPeldszus commented 9 years ago

Oh sorry, I have corrected it.

tsdh commented 9 years ago

Not pushed yet.

Ah, and you modified overloaded/overloading instead of overridden/overriding. The former is correct with 0..* on both sides. Sorry, I've been wrong there in my last comment, too. ;-)

tsdh commented 9 years ago

Shouldn't hiddenBy be 0..* because a field can be hidden by multiple others as in the following?

class A {int a;}
class B extends A {int a;}
class C extends A {int a;}
SvenPeldszus commented 9 years ago

This multiplicities are my windmills.

However, now should everything be correct.