stevedlawrence commented on a change in pull request #120: Support more
versions of Java
URL: https://github.com/apache/incubator-daffodil/pull/120#discussion_r217405567
##########
File path:
daffodil-io/src/main/scala/org/apache/daffodil/io/DataOutputStreamImplMixin.scala
##########
@@ -534,16 +534,16 @@ trait DataOutputStreamImplMixin extends
DataStreamCommonState
Assert.usage(bb.remaining() == numBytesForLengthInBits)
- if (nFragBits > 0) bb.limit(bb.limit - 1) // last byte is the frag byte
+ if (nFragBits > 0) bb.limit(bb.limit() - 1) // last byte is the frag byte
val nBytesWritten = putByteBuffer(bb, finfo) // output all but the frag
byte if there is one.
val nBitsWritten = nBytesWritten * 8
if (nBytesWritten < nWholeBytes) {
nBytesWritten * 8
} else {
val isFragWritten =
if (nFragBits > 0) {
- bb.limit(bb.limit + 1)
- var fragByte: Long = Bits.asUnsignedByte(bb.get(bb.limit - 1))
+ bb.limit(bb.limit() + 1)
+ var fragByte: Long = Bits.asUnsignedByte(bb.get(bb.limit() - 1))
Review comment:
Probably. Fedora allows multiple installations of different Java versions
and uses the "alternatives" command to switch between them. I'm not sure if
eclipse figures out where java is using alternatives (or probably something
similar on other OSes) or if it uses some other mechanism. For sbt,
alternatives is sufficient to test different java versions.
Though, TravisCI is now configured to build on all java versions, so you
could just rely on the results of that to know if you missed anything or did
something that wasn't compatible with different java versions. The limit() and
position() methods are kindof a special case since the setters and getters have
the same name, just one takes a parameter. Most java methods have separate get*
and set* methods instead so this isn't an issue.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services