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

avoid non necessary objects allocation if session do not have any attributes data #4375

Merged
merged 4 commits into from
Dec 20, 2019

Conversation

olamy
Copy link
Member

@olamy olamy commented Nov 28, 2019

Signed-off-by: olivier lamy [email protected]

Signed-off-by: olivier lamy <[email protected]>
Signed-off-by: olivier lamy <[email protected]>
@olamy olamy requested a review from janbartel November 28, 2019 03:57
Copy link
Contributor

@janbartel janbartel left a comment

Choose a reason for hiding this comment

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

Fine, subject to ensuring that serializing 0 bytes instead of an empty map deserializes ok.

"select * from " + TABLE +
" where " + ID_COL + " = ? and " + CONTEXT_COL +
" = ? and virtualHost = ?" );
statement.setString(1, data.getId() );
Copy link
Contributor

Choose a reason for hiding this comment

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

how are you getting away with the extra space before the final ); ??? Is checkstyle broken?

Copy link
Member Author

Choose a reason for hiding this comment

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

ohh my bad I usually avoid only blank line. But agree I have to take care of spaces as well

}
}
else
{
statement.setBinaryStream( 7, EMPTY, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this deserialize correctly? Serializing an empty map would be a different result than an empty byte string.

Copy link
Member Author

Choose a reason for hiding this comment

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

just an empty map but good point I will add a test for that.

Signed-off-by: olivier lamy <[email protected]>
@joakime joakime merged commit ccf04a4 into jetty-9.4.x Dec 20, 2019
@joakime joakime deleted the jetty-9.4.x_small_improvment_jdbc branch December 20, 2019 16:29
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.

3 participants