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

[T2A2][W15-A1] Xu Bili #267

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

[T2A2][W15-A1] Xu Bili #267

wants to merge 5 commits into from

Conversation

xbili
Copy link

@xbili xbili commented Jan 31, 2017

PR for [LO-Refactor] and [LO-MethodAbstraction].

@xbili xbili changed the title [T2A2][W15A1] Xu Bili [T2A2][W15-A1] Xu Bili Jan 31, 2017
@xbili
Copy link
Author

xbili commented Jan 31, 2017

Ready for review

@@ -266,7 +270,7 @@ private static void processProgramArgs(String[] args) {
setupGivenFileForStorage(args[0]);
}

if(args.length == 0) {
if (args.length == 0) {
Copy link

Choose a reason for hiding this comment

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

good that coding standard violation was spotted.

@@ -339,8 +345,28 @@ private static boolean hasValidParentDirectory(Path filePath) {
* If a file already exists, it must be a regular file.
*/
private static boolean hasValidFileName(Path filePath) {
return filePath.getFileName().toString().lastIndexOf('.') > 0
&& (!Files.exists(filePath) || Files.isRegularFile(filePath));
if (!hasExtension(filePath)) {
Copy link

Choose a reason for hiding this comment

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

good that the long condition has been made easier to read.

private static String removePrefixSign(String s, String sign) {
return s.replace(sign, "");
private static String removePrefix(String fullString, String prefix) {
return fullString.replace(prefix, "");
Copy link

Choose a reason for hiding this comment

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

as mentioned in tutorial, the replace behaviour would also remove instances of the prefix argument that are found else where than the start of fullString

@@ -1150,8 +1204,8 @@ private static String getUsageInfoForExitCommand() {
* @param sign Parameter sign to be removed
* @return string without the sign
Copy link

Choose a reason for hiding this comment

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

need to update the header comments after updating the method.

@mauris
Copy link

mauris commented Feb 2, 2017

Some comments added. Feel free to add more comment if you have any questions. Once you are done, you may close the PR after reading comments.

@mauris mauris added the Reviewed label Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants