changeset 53732:d667de4734ac

8145845: [AOT] NullPointerException in compiler/whitebox/GetCodeHeapEntriesTest.java Reviewed-by: kvn, thartmann
author iignatyev
date Tue, 12 Feb 2019 11:23:43 -0800
parents ee45b48c9e4a
children b5d45c2fe8a0
files src/hotspot/share/prims/whitebox.cpp test/hotspot/jtreg/compiler/whitebox/GetCodeHeapEntriesTest.java
diffstat 2 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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);