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

Add order service #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add order service #1

wants to merge 1 commit into from

Conversation

joriba
Copy link
Owner

@joriba joriba commented Mar 10, 2024

No description provided.

Copy link
Collaborator

@yzueger yzueger left a comment

Choose a reason for hiding this comment

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

horrible code, -3/10, approved

Order foobar = readOrderFromBinaryFile(3);
if (foobar.isValid()) {
orders.add(bar);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

3x copy paste

o = i;
}
}
return o;
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need to reinvent the wheel

} finally {
if (reader != null) {
reader.close();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

that is some old Java right there


public Order readOrderFromBinaryFile(int id) throws IOException, ClassNotFoundException {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream("order-" + id + ".bin"));
return (Order) ois.readObject();
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably vulnerable to arbitrary code execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants