Skip to content

Remove reflection in ByteBufferUtils#52

Merged
drcrallen merged 5 commits intomasterfrom
saferByteBufferUtils
Sep 19, 2016
Merged

Remove reflection in ByteBufferUtils#52
drcrallen merged 5 commits intomasterfrom
saferByteBufferUtils

Conversation

@drcrallen
Copy link
Copy Markdown
Contributor

  • Also adds test

@drcrallen
Copy link
Copy Markdown
Contributor Author

@leventov I don't think the ByteBufferUtils needs to be as complex

@cheddar would you mind taking a peek at this?

@leventov
Copy link
Copy Markdown
Contributor

leventov commented Sep 14, 2016

Reflection approach is used, when somebody needs graceful fail when non-HotSpot JVM is used. I. e. somebody trying to use java-util from within Websphere will be in thouble, because it runs on IBM's J9. If we explicitly support only Hotspot JVM I think this is a good change.

@leventov
Copy link
Copy Markdown
Contributor

Ok, i see that exceptions were thrown in static blocks before, so It was not compatible with other JVMs anyway.

clean((DirectBuffer) buffer);
}
}
catch (Exception e) {
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.

Is try-catch needed here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't think so. Fixed, er... removed

@drcrallen drcrallen merged commit fa9024a into master Sep 19, 2016
@drcrallen drcrallen deleted the saferByteBufferUtils branch September 19, 2016 18:05
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