8145845: [AOT] NullPointerException in compiler/whitebox/GetCodeHeapEntriesTest.java
Reviewed-by: kvn, thartmann
--- a/src/hotspot/share/prims/whitebox.cpp Tue Feb 12 19:22:19 2019 +0100
+++ b/src/hotspot/share/prims/whitebox.cpp Tue Feb 12 11:23:43 2019 -0800
@@ -1544,9 +1544,6 @@
blobs.append(stub);
}
}
- if (blobs.length() == 0) {
- return NULL;
- }
ThreadToNativeFromVM ttn(thread);
jobjectArray result = NULL;
jclass clazz = env->FindClass(vmSymbols::java_lang_Object()->as_C_string());
--- a/test/hotspot/jtreg/compiler/whitebox/GetCodeHeapEntriesTest.java Tue Feb 12 19:22:19 2019 +0100
+++ b/test/hotspot/jtreg/compiler/whitebox/GetCodeHeapEntriesTest.java Tue Feb 12 11:23:43 2019 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, 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
@@ -77,7 +77,7 @@
CodeBlob blob = Arrays.stream(blobs)
.filter(GetCodeHeapEntriesTest::filter)
.findAny()
- .get();
+ .orElse(null);
Asserts.assertNotNull(blob);
Asserts.assertEQ(blob.code_blob_type, type);
Asserts.assertGTE(blob.size, SIZE);