craigwblake / redline

Pure Java Rpm Library
http://redline-rpm.org
MIT License
128 stars 97 forks source link

Java9 compatibility issue #128

Open dizzzz opened 6 years ago

dizzzz commented 6 years ago

in org.redline_rpm.ReadableChannelWrapper#read

public int read( final ByteBuffer buffer) throws IOException {
  final int read = channel.read( buffer);
  for ( Consumer< ?> consumer : consumers.values()) consumer.consume(( ByteBuffer) buffer.duplicate().flip());
  return read;
}

results in

java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
    at org.redline_rpm.ReadableChannelWrapper.read(ReadableChannelWrapper.java:30) ~[redline-1.2.7-SNAPSHOT.jar:?]
    at org.redline_rpm.Util.fill(Util.java:75) ~[redline-1.2.7-SNAPSHOT.jar:?]
    at org.redline_rpm.Util.fill(Util.java:60) ~[redline-1.2.7-SNAPSHOT.jar:?]
    at org.redline_rpm.header.Lead.read(Lead.java:59) ~[redline-1.2.7-SNAPSHOT.jar:?]
    ....
    Suppressed: java.io.IOException: There are '2' unfinished operations.
        at org.redline_rpm.ChannelWrapper.close(ChannelWrapper.java:214) ~[redline-1.2.7-SNAPSHOT.jar:?]
        at org.redline_rpm.ReadableChannelWrapper.close(ReadableChannelWrapper.java:42) ~[redline-1.2.7-SNAPSHOT.jar:?]

when compiled with Java9 and running on Java8. See https://github.com/plasma-umass/doppio/issues/497