Author jeff.allen
Recipients adamburke, jeff.allen
Date 2019-10-05.13:50:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I've seen this when compiling on 9 and running on something earlier, but I don't see why this would happen compiling on 8 and running on something later. It's not so much deprecation as an unfortunate specialisation. (I've done similar things myself.)

A suspicious element is that we're looking for clear() returning ByteBuffer while the signature (both in Buffer and ByteBuffer) returns Buffer. When I look at with Oracle 1.8.0_211-b12, I see:

public void clear();
     0: aload_0
     1: getfield      #5                  // Field buffer:Ljava/nio/ByteBuffer;
     4: invokevirtual #13                 // Method java/nio/ByteBuffer.clear:()Ljava/nio/Buffer;
     7: iconst_0
     8: invokevirtual #29                 // Method java/nio/Buffer.limit:(I)Ljava/nio/Buffer;
    11: pop
    12: return

I wonder if this is an openjdk thing? Possibly:

Maybe the answer here is to cast ((Buffer) buffer).clear() so as to seek the right one?
Date User Action Args
2019-10-05 13:50:10jeff.allensetmessageid: <>
2019-10-05 13:50:10jeff.allensetrecipients: + jeff.allen, adamburke
2019-10-05 13:50:10jeff.allenlinkissue2810 messages
2019-10-05 13:50:10jeff.allencreate