1.1 --- a/src/share/vm/runtime/jniHandles.cpp Mon Aug 21 05:20:03 2017 -0400 1.2 +++ b/src/share/vm/runtime/jniHandles.cpp Mon Aug 21 11:34:41 2017 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -196,8 +196,10 @@ 1.11 int _count; 1.12 public: 1.13 CountHandleClosure(): _count(0) {} 1.14 - virtual void do_oop(oop* unused) { 1.15 - _count++; 1.16 + virtual void do_oop(oop* ooph) { 1.17 + if (*ooph != JNIHandles::deleted_handle()) { 1.18 + _count++; 1.19 + } 1.20 } 1.21 virtual void do_oop(narrowOop* unused) { ShouldNotReachHere(); } 1.22 int count() { return _count; }