-
Notifications
You must be signed in to change notification settings - Fork 0
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
Review Task 2 #2
base: master
Are you sure you want to change the base?
Conversation
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
public class AbstractComment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Myląca nazwa, może sugerować że klasa jest abstrakcyjna
public Type getType() { | ||
return type; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Po co zwracać niesformatowaną datę w getterze
protected String getAuthor() { | ||
return author; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum zadeklarowany na drugim końcu pliku, kiedy Type wykorzystywane jest na początku
@@ -0,0 +1,4 @@ | |||
package pl.fracz.mcr.comment; | |||
|
|||
public class CommentNotAddedException extends Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???????? Pusta klasa dziedzicząca po exception
public class Comment extends AbstractComment { | ||
private String text; | ||
|
||
private File file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nazwa powinna mówić po co jest określona zmienna, file niewiele mówi ale mogłoby być wykorzystywane np w iteracji kiedy wynika z kontekstu
public static SourceFile createFromString(String sourceCode, String language) { | ||
return new SourceFile(sourceCode, language); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bezużyteczny komentarz
*/ | ||
public static SourceFile createFromFile(File sourceFile) throws IOException { | ||
String sourceCode = FileUtils.read(sourceFile); | ||
return createFromString(sourceCode, FileUtils.getExtension(sourceFile.getName())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Godline
} | ||
|
||
public void addTextComment(String comment) throws CommentNotAddedException { | ||
if (selectedLine == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niepotrzebny null
|
||
// public void addVideoComment(File videoFile) throws CommentNotAddedException { | ||
// } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niejednolite nazewnictwo, parametr bool
return code; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Można prościej
Find as many defects and problems as possible!
You can skip the
Line.java
as you have already saw it in the Task 1.