Skip to content

HW2 review  #1

@Anderwerty

Description

@Anderwerty

image
You shouldn't put classes just into scr directory. Create a root directory. Example: com.example, com.smile.sofa
2.
image
https://mate-academy.github.io/style-guides/java/java.html#s5.2.1-package-names
Package names are all lowercase, with consecutive words simply concatenated together (no underscores). For example, com.example.deepspace, not com.example.deepSpace or com.example.deep_space
3.
image
Please read https://stackoverflow.com/questions/147454/why-is-using-a-wild-card-with-a-java-import-statement-bad
4.

public class Sort {

Try to use principle DRY (don't repeat yourself)
The same code you can find in other classes.
image
Please move it to separate method and reuse.
5. For all sorting methods (int [] sort(int[] arr)), make copy of array (System.arraycope()) and work with cope.The initial array shouldn't be changed.
6.
int i = left, j = right;

It is not a java style. Every variable declaration (field or local) declares only one variable: declarations such as int a, b; are not used.
see
7.
public Object clone() {

It is not very good an approach.
8.
return (Address) adress.clone();

Optional: You could use constructor (example: new Address(adress.getStreet()));
9.
image
If the address is null you will get NPE. The ternary operator will help you to fix it.
10. For package builder_realize please read https://habr.com/ru/post/244521/
and implement better realization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions