Skip to content

Exposes Servlet Request attributes#676

Merged
jknack merged 3 commits intojooby-project:masterfrom
andrenpaes:servlet-request-attributes
Mar 20, 2017
Merged

Exposes Servlet Request attributes#676
jknack merged 3 commits intojooby-project:masterfrom
andrenpaes:servlet-request-attributes

Conversation

@andrenpaes
Copy link
Copy Markdown
Contributor

Fix for #674

I couldn't really find a good place to write a test to the HttpHandlerImpl change, but since it's a small, simple change, maybe we're good without a test.

Anyway, if you think it's worth it I can write the test, I'd just need a pointer to specific test case I could use.

Copy link
Copy Markdown
Member

@jknack jknack left a comment

Choose a reason for hiding this comment

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

Looks good, did some minor comments. Please amend your commit and update your pull.

Thank you.


@Override
public Map<String, Object> attributes() {
final Enumeration<String> attributeNames = req.getAttributeNames();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Test the empty branch too

final Enumeration<String> attributeNames = req.getAttributeNames();
if (!attributeNames.hasMoreElements()) {
return Collections.emptyMap();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

split this line and leave one method call per line. Also for name -> name, use Function.identity()

@andrenpaes andrenpaes closed this Mar 20, 2017
@andrenpaes andrenpaes reopened this Mar 20, 2017
@jknack jknack added this to the 1.1.0 milestone Mar 20, 2017
@jknack jknack merged commit 7071898 into jooby-project:master Mar 20, 2017
@andrenpaes andrenpaes deleted the servlet-request-attributes branch March 21, 2017 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants