Skip to content

Bootstrap driver-examples module#643

Merged
adutra merged 2 commits into
3.0.xfrom
java1069
May 2, 2016
Merged

Bootstrap driver-examples module#643
adutra merged 2 commits into
3.0.xfrom
java1069

Conversation

@olim7t
Copy link
Copy Markdown
Contributor

@olim7t olim7t commented Apr 6, 2016

No description provided.

@olim7t olim7t added this to the 3.0.1 milestone Apr 6, 2016
@tolbertam
Copy link
Copy Markdown
Contributor

This will probably need to be rebased/changed a little bit after #635 is merged.

@tolbertam
Copy link
Copy Markdown
Contributor

Also #615

@adutra
Copy link
Copy Markdown
Contributor

adutra commented Apr 28, 2016

Squashed and rebased on top of current 3.0.x.


// Another way is to use relative getters.
while (buffer.hasRemaining()) {
assert buffer.get() == (byte) 0xFF;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you don't have assertions enabled (-ea vm argument) this will tight loop since buffer.get() is not evaluated. Maybe we should change these to not use assertions? Either that or we could document that assertions are required.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alternatively we could call .get() every time and then assert on whatever it returns separately, i.e.:

while (buffer.hasRemaining()) {
    byte b = buffer.get();
    assert b == (byte) 0xFF;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Went ahead and adopted your suggestion in 2 places where there were risks of tight loops.

@tolbertam
Copy link
Copy Markdown
Contributor

Looks great! The only thing I think that should be addressed before merge is my comment on asserts other than that this is good to merge! 👍

Alexandre Dutra and others added 2 commits May 2, 2016 17:20
This commit renames the older 'driver-examples' submodule to 'driver-tests'.
It contains substantial contributions by Olivier Michallat (@olim7t).
@adutra adutra merged commit 568948d into 3.0.x May 2, 2016
@adutra adutra deleted the java1069 branch May 2, 2016 15:27
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.

3 participants