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

First draft of Servlet 2.5 support #182

Closed
wants to merge 3 commits into from
Closed

Conversation

whiskeysierra
Copy link
Collaborator

Fixes #172
Replaces #174

@hanfak I made your tests pass and changed the implementation from being reflection-based to two distinct implementations. Code is 100% covered, but I can't verify it reliably against servlet api 2.5 since that would require to rewrite almost all tests from the logbook-servlet module.

import java.util.Map;
import java.util.Optional;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
Copy link
Member

Choose a reason for hiding this comment

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

Is it used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SimpleDateFormat?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I organized imports again. Should be gone now.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, for me it is a red flag because it is not thread safe and java 8 has better alternative

@Override
public void addDateHeader(final String name, final long date) {
super.addDateHeader(name, date);
addMultiMapHeader(name, format(date));
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov Nov 9, 2017

Choose a reason for hiding this comment

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

format could be simplified with Instant.ofEpochMilli() instead of new Date()

@whiskeysierra
Copy link
Collaborator Author

@hanfak I consulted with some colleagues about this. We took a look at the code and discussed what still would need to be done. The conclusion that we came to is that we don't see the value. It would increase the complexity of logbook disproportionately to the gained benefit.

@whiskeysierra whiskeysierra deleted the feature/servlet-2.5 branch November 9, 2017 10:44
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