-
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
Add order service #1
base: main
Are you sure you want to change the base?
Conversation
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.
horrible code, -3/10, approved
Order foobar = readOrderFromBinaryFile(3); | ||
if (foobar.isValid()) { | ||
orders.add(bar); | ||
} |
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.
3x copy paste
o = i; | ||
} | ||
} | ||
return o; |
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.
no need to reinvent the wheel
} finally { | ||
if (reader != null) { | ||
reader.close(); | ||
} |
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.
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(); |
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.
probably vulnerable to arbitrary code execution
No description provided.