-
Notifications
You must be signed in to change notification settings - Fork 1
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
Group 2 #20
base: master
Are you sure you want to change the base?
Group 2 #20
Conversation
public class Airport { | ||
|
||
/** | ||
* Prints transport military planes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is very vague.
//Constructor | ||
public Airport(List<? extends Plane> planes) { | ||
this.planes = planes; | ||
this.printMaxTransportMilitaryPlane(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we printing something in a constructor?
} | ||
} //if | ||
else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank else?
|
||
} // else | ||
} //for | ||
System.out.println("model:" + maxPlane.getModel()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would crash if there are no TRANSPORT planes in the airport, as maxPlane=null, this should be properly handled.
|
||
for (Plane plane : planes) { | ||
if (plane instanceof MilitaryPlane) { | ||
if (((MilitaryPlane) plane).getType() == MilitaryType.TRANSPORT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this shouldn't be a subclass?
maxPlane = plane; | ||
} | ||
} | ||
} //if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove not needed comments and else block.
System.out.println ("***** Largest Transport Military Plane ******"); | ||
System.out.println ("*********************************************"); | ||
|
||
for (Plane plane : planes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we always prefix with this
?
@@ -0,0 +1,49 @@ | |||
import models.MilitaryType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation?
No description provided.