< prev index next >

test/hotspot/gtest/classfile/test_placeholders.cpp

Print this page
@@ -37,14 +37,14 @@
    JavaThread* T2 = THREAD;
    // the thread should be in vm to use locks
    ThreadInVMfromNative tivfn(THREAD);
  
    // Assert messages assume these symbols are unique, and the refcounts start at one.
-   TempNewSymbol A = SymbolTable::new_symbol("abc2_8_2023_class");
-   TempNewSymbol D = SymbolTable::new_symbol("def2_8_2023_class");
+   Symbol* A = SymbolTable::new_symbol("abc2_8_2023_class");
+   Symbol* D = SymbolTable::new_symbol("def2_8_2023_class");
    Symbol* super = SymbolTable::new_symbol("super2_8_2023_supername");
-   TempNewSymbol interf = SymbolTable::new_symbol("interface2_8_2023_supername");
+   Symbol* interf = SymbolTable::new_symbol("interface2_8_2023_supername");
  
    ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
  
    {
      MutexLocker ml(THREAD, SystemDictionary_lock);

@@ -108,6 +108,11 @@
    }
  
    EXPECT_EQ(A->refcount(), 1) << "first lass name refcount should be 1";
    EXPECT_EQ(D->refcount(), 1) << "second class name refcount should be 1";
    EXPECT_EQ(super->refcount(), 0) << "super class name refcount should be 0 - was unloaded.";
+ 
+   // clean up temporary symbols
+   A->decrement_refcount();
+   D->decrement_refcount();
+   interf->decrement_refcount();
  }
< prev index next >