Skip to content
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

Fix Umple examples that were failing Java and PHP compilation #959

Merged
merged 13 commits into from Jan 22, 2017

Conversation

jblang94
Copy link
Contributor

Description

This PR fixes the following Umple examples so that all Umple examples tested with
ant -Dmyenv=local -f build.exampletests.xml allUserManualAndExampleTests
in issue 758 now pass. The updated examples are:

  • CollisionAvoidance.ump
  • CollisionAvoidanceA1.ump
  • CollisionAvoidanceA2.ump
  • CollisionAvoidanceA3.ump
  • HomeHeater.ump
  • GeometricSystem.ump
    Note, for GeometricSystem.ump, the "@@@skipphpcompile" directive was added because of incompatible methods such as boolean isEqual(Color object)

Tests

No additional tests were added. I confirmed that the changes passed using
"ant -Dmyenv=local -f build.exampletests.xml allUserManualAndExampleTests".

@jblang94
Copy link
Contributor Author

I have opened issue #964 regarding the incorrect PHP code generation that was observed from the GeometricSystem.ump example

double getPerimeterLength(){return 1.0;}
boolean isLessThan(Polygon object){return true;}
boolean isEqual(Polygon object){return true;}
boolean isEqual(CurvedShape object){return false;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return false;}

Copy link
Contributor Author

@jblang94 jblang94 Jan 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally, I had removed that method from the examples. In this case, I removed it from the Quadrilateral class. However, when I compiled the Umple file, and then tried to compile Quadrilateral.java, the following error was thrown:

JackieLang:geometric_system$ javac Quadrilateral.java 
Quadrilateral.java:8: error: Quadrilateral is not abstract and does not override abstract method isEqual(CurvedShape) in Polygon
public class Quadrilateral extends Polygon
       ^
1 error

The same error is thrown with the other examples in your other comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vahdat-ab Added the @@@skipjavacompile directive to GeometricSystem.ump. This can be removed when the issue with TComparable is resolved.

double getPerimeterLength(){return 1.0;}
boolean isLessThan(Polygon object){return true;}
boolean isEqual(Polygon object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

@vahdat-ab vahdat-ab Jan 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

double volume(){return 1.0;}
double surfaceArea(){return 1.0;}
boolean isEqual(NonPolyhedra object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

@vahdat-ab vahdat-ab Jan 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

double volume(){return 1.0;}
double surfaceArea(){return 1.0;}
boolean isEqual(NonPolyhedra object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

@vahdat-ab vahdat-ab Jan 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

double volume(){return 1.0;}
double surfaceArea(){return 1.0;}
boolean isEqual(NonPolyhedra object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

@vahdat-ab vahdat-ab Jan 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

double volume(){return 1.0;}
double surfaceArea(){return 1.0;}
boolean isEqual(NonPolyhedra object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

double volume(){return 1.0;}
double surfaceArea(){return 1.0;}
boolean isEqual(NonPolyhedra object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

double volume(){return 1.0;}
double surfaceArea(){return 1.0;}
boolean isEqual(NonPolyhedra object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

double volume(){return 1.0;}
double surfaceArea(){return 1.0;}
boolean isEqual(Polyhedra object){return true;}
boolean isEqual(CurvedShape object){return true;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the following method should be deleted.
boolean isEqual(CurvedShape object){return true;}

* Add missing Boolean lock variable
* Rename attribute and use Umple generated API calls
* Rename attribute and use Umple API generated methods
* Add missing Boolean variable "lock"
* Rename attribute and use Umple API generated methods
* Replace assignment statements with Umple API calls
* Replace assignment statements with Umple API calls
* Replace assignment statements with Umple API calls
* Replace incorrect transition name
* Replace assignment statements with Umple API calls
* Replace incorrect transition name
* Replace assignment, increment, and decrement statements with Umple API calls
* Fix method definitions, and add "dummy" return values to non void methods
* Add @@@skipphpcompile because of incompatible methods
…xample

* Skip Java compilation until issue with TComparable is fixed
@vahdat-ab vahdat-ab merged commit d6b57ee into umple:master Jan 22, 2017
@jblang94 jblang94 deleted the resolve_issue_758 branch January 22, 2017 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants