--- old/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template 2015-03-23 16:12:48.000000000 -0700 +++ new/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template 2015-03-23 16:12:48.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,8 +198,7 @@ public $Type$Buffer put($Type$Buffer src) { #if[rw] if (src instanceof Heap$Type$Buffer) { - if (src == this) - throw new IllegalArgumentException(); + checkSourceBufferNotThisBuffer(src); Heap$Type$Buffer sb = (Heap$Type$Buffer)src; int n = sb.remaining(); if (n > remaining())