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

Group 2 #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Group 2 #20

wants to merge 1 commit into from

Conversation

johanneskross
Copy link

No description provided.

@PtrBld PtrBld requested review from dmitrii-n and pvjosue September 6, 2021 08:04
public class Airport {

/**
* Prints transport military planes
Copy link

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();
Copy link
Collaborator

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 {

Copy link
Collaborator

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());
Copy link

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) {
Copy link
Collaborator

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
Copy link

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) {
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Documentation?

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.

3 participants