Mocking lab#14
Conversation
ellenspertus
left a comment
There was a problem hiding this comment.
Good job! There are just minor items to fix.
| * Downloads the Wordnik Word of the Day and adds it to a list. | ||
| * | ||
| * @param the list to add the word to | ||
| * @return the list the word was added to |
There was a problem hiding this comment.
This function is void, so don't use the @return tag.
| } | ||
|
|
||
| /** | ||
| * Populates the passed list, with sample words and Wordnik's Word of the Day. |
There was a problem hiding this comment.
Excellent wording! Just drop the comma.
| /** | ||
| * Populates the passed list, with sample words and Wordnik's Word of the Day. | ||
| * | ||
| * @param the list of word records to be populated |
There was a problem hiding this comment.
Since the type is shown in the signature, I would just say "the list to be populated" or "the list".
| System.err.println("Unable to get API key."); | ||
| WordApi wordApi = client.buildClient(WordApi.class); | ||
| addWordOfTheDay(backingList, wordsApi, wordApi); | ||
| } catch (Exception ex) { |
There was a problem hiding this comment.
I don't like such a wide catch. Only catch what might be thrown, and display an appropriate error message.
| return Map.of("text", definition); | ||
| } | ||
|
|
||
| // make var args for any number of definitions instead of array |
There was a problem hiding this comment.
Either do this or remove the comment.
| return fs; | ||
| } | ||
|
|
||
| // add test for Yucca |
ellenspertus
left a comment
There was a problem hiding this comment.
You accidentally checked in your javadoc with the last commit. Do you know how to get rid of it and keep it from being re-added?
| WordApi wordApi = client.buildClient(WordApi.class); | ||
| addWordOfTheDay(backingList, wordsApi, wordApi); | ||
| } catch (IOException ex) { | ||
| System.out.println("Probably couldn't access the API client: " + ex); |
There was a problem hiding this comment.
Write to System.err.println, not System.out.println. https://stackoverflow.com/questions/3163399/difference-between-system-out-println-and-system-err-println
No description provided.