Closed GoogleCodeExporter closed 9 years ago
Original comment by aforw...@gmail.com
on 9 Feb 2014 at 10:59
Original comment by TimothyCLethbridge
on 14 Feb 2014 at 8:34
If the getCode method in the Constraint class is being changed into a derived
attribute, then should the getCode method in Constraint's parent class,
CodeBlock, also be changed to a derived attribute?
If so, I can create a separate issue and assign it to myself to work on.
Original comment by TylerJDMcConnell
on 20 Feb 2014 at 8:19
First, I notice that superclass and class CAN have the same attribute, but
there is a warning that is created
http://cruise.eecs.uottawa.ca/umpleonline/umple.php?model=140226557089
Original comment by aforw...@gmail.com
on 26 Feb 2014 at 10:49
Now looking at the CodeBlock and Constraint, they have different "code"
attributes, so I would make both derived attributes and for the time being we
will live with the warning (and possibly a separate ticket to deal with that).
FYI, this is what I see for the current implementations:
class CodeBlock
{
public String getCode()
{
return !codes.containsKey(languageUsed) ? "".equals(languageUsed) ? null : codes.get("") : codes.get(languageUsed);
}
}
class Constraint
{
String getCode(){
return StringFormatter.format(gen.translate((getNegated()?"Not":"")+format,this),inject);
}
}
Original comment by aforw...@gmail.com
on 26 Feb 2014 at 10:55
Okay, I was thinking there shouldn't be a problem in changing both getCode
methods to derived attributes, each with their own implementation. Should I
create a separate ticket for changing the CodeBlock getCode method, or should I
make the change within this issue?
Original comment by TylerJDMcConnell
on 27 Feb 2014 at 3:29
One ticket is fine, rename the title. If that bothers you, create a separate
ticket.
Original comment by aforw...@gmail.com
on 27 Feb 2014 at 3:31
Original comment by TylerJDMcConnell
on 27 Feb 2014 at 3:33
I've refactored the getCode method in Constraint and submitted a patch to the
Umple-Dev mailing list for review, but I'm having issues refactoring the
getCode method in the CodeBlock class.
Whenever I change the getCode method in CodeBlock to be a derived attribute the
CodeBlock class and all of its children classes become abstract. I have no idea
why this is happening. Any insights would be welcome.
Original comment by TylerJDMcConnell
on 28 Feb 2014 at 5:34
Splitting work to change getCode in CodeBlock into derived attribute into a
separate issue due to problems with inheritance.
Original comment by TylerJDMcConnell
on 28 Feb 2014 at 7:50
Original comment by TylerJDMcConnell
on 4 Mar 2014 at 5:28
Original issue reported on code.google.com by
aforw...@gmail.com
on 9 Feb 2014 at 10:57