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

Pull Request #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Pull Request #19

wants to merge 4 commits into from

Conversation

AmulVerma
Copy link

No description provided.

public static void main(String[] args)
{
//String studentRecFileName = fileReadWriteUtil.getFile(); // extract and read student file from memory
//List<Student> studentRecordList = fileReadWriteUtil.readFile("studentData.txt");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove unused comments.

//String studentRecFileName = fileReadWriteUtil.getFile(); // extract and read student file from memory
//List<Student> studentRecordList = fileReadWriteUtil.readFile("studentData.txt");

int choice = utility.getInputItemChoice(); // menu for selecting options
Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming convention for static classes needs to be followed.

//List<Student> studentRecordList = fileReadWriteUtil.readFile("studentData.txt");

int choice = utility.getInputItemChoice(); // menu for selecting options
utility.performAction(choice); // perform task according to the option chosen
Copy link
Collaborator

Choose a reason for hiding this comment

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

If utility is a static class, should it be tightly coupled with the behavior of Student.


public class Course implements Serializable{
// private static final long serialVersionUID =1L;
ArrayList<String> courses;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are access modifiers required ?

return rollNumber;
}

public void setRollNumber(int rollNumber) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Access modifiers are missing .... PMD should have broken here.

if (studentList.isEmpty()) {
System.out.println("No user details present\n");
}
studentList=sortByChoice(studentList, choice);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Checkstyle ???

Comment on lines 88 to 91
if (studentList.isEmpty()) {
System.out.println("No user details present\n");
}
studentList=sortByChoice(studentList, choice);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If true, should it still proceed ???

System.out.println("User Details : \n");
System.out.printf("%s %s %s %s %s %n \n", "Name", "Age", "Address", "Roll Number", "Courses");

for (Student value : studentList) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Look into java streams for iterating.

<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
Copy link
Collaborator

Choose a reason for hiding this comment

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

look into .gitignore for making sure unwanted files aren't committed.

System.out.print("Do you want to CONTINUE? Enter (y/n): ");
String choice = sc.next();
int inputChoice = 0;
if ("Y".equals(choice) || "y".equals(choice)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Prefer to use constants for such hard coded string.

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.

2 participants