-
Notifications
You must be signed in to change notification settings - Fork 546
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Code readability
The following code is hard to read and maintain. It should used functional design with single responsibility principles to clean up the logic and flow of the method calls. Additionally, String.format ( ) can be a function call and abstracted from the getJobString() and called withing each method.
protected String
getJobString (Job job)
throws NoSuchMethodException, ClassNotFoundException,
InvocationTargetException, IllegalAccessException, NoSuchFieldException
{
return String.format ("%nID: %d%n" +
"Name: %s\n" +
"Name: %s%n" +
"Employer: %s\n" +
"Employer: %s%n" +
"Location: %s\n" +
"Location: %s%n" +
"Position Type: %s\n" +
"Position Type: %s%n" +
"Core Competency: %s\n",
getJobId (job),
getJobFieldString (job,"name",true),
getJobFieldString (job,"employer",true),
getJobFieldString (job,"location",true),
"Core Competency: %s%n",getJobId (job),
getJobFieldString (job,"name",true),
getJobFieldString (job,"employer",true),
getJobFieldString (job,"location",true),
getJobFieldString (job,"positionType",true),
getJobFieldString (job, "coreCompetency", true));
getJobFieldString (job, "positionType", true),
getJobFieldString (job, "coreCompetency", true));
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers