-
Notifications
You must be signed in to change notification settings - Fork 101
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 #9
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.
Abstract class is not abstract
} | ||
|
||
public void markConversation(Line line) { | ||
// Nothing to do, it's perfect. |
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.
Empty method
} | ||
|
||
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.
Unnscessary, just repeats constructor
/** | ||
* Creates source file based on a file reference. | ||
*/ | ||
public static SourceFile createFromFile(File sourceFile) throws IOException { |
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.
createSourceFileFromFile or copySourceFile
public void setFile(File file) { | ||
checkValidType(AbstractComment.Type.VOICE); | ||
this.file = file; | ||
} | ||
|
||
public File getFile() { | ||
checkValidType(AbstractComment.Type.VOICE); | ||
return 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.
checkValiType() powinna byc w innym miejscu, setter i getter powinny tylko ustawiac i pobierac wartosc zmiennej
|
||
import android.content.Context; | ||
import android.graphics.Color; | ||
import android.view.View; |
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.
przerwa pomidzy importami
if (selectedLine != null) { | ||
selectedLine.setBackgroundColor(Color.TRANSPARENT); | ||
} | ||
selectedLine = (Line) view; | ||
selectedLine.setBackgroundColor(SELECTED_LINE_COLOR); |
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 by wydzielić do innej metody
for (int i = 0; i < digest.length; i++) { | ||
sb.append(Integer.toString((digest[i] & 0xff) + 0x100, 16).substring(1)); | ||
} |
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.
rowniez mozna wydzielic do prywatnej metody
while (tokenizer.hasMoreTokens()) { | ||
Line line = new Line(context, this, lines.size() + 1, tokenizer.nextToken()); | ||
line.setOnClickListener(lineHighlighter); | ||
lines.add(line); | ||
} |
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.
również wydzielić do osobnej metody
if (ApplicationSettings.highlightSources()) { | ||
return SYNTAX_HIGHLIGHTER.highlight(code, language); | ||
} else { | ||
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.
zamienić na operator trinarny ? :
Find as many defects and problems as possible!
You can skip the
Line.java
as you have already saw it in the Task 1.