On Tue, 28 Jan 2025 19:42:57 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:

>> Chris Plummer has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   use lookupType() api that does not throw an exception.
>
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java line 
> 161:
> 
>> 159:         /* Only add DeoptimizeObjectsALotThread if it is actually 
>> present in the type database. */
>> 160:         try {
>> 161:             db.lookupType("DeoptimizeObjectsALotThread");
> 
> I see there is `public Type lookupType(String cTypeName, boolean 
> throwException);`, so this might be more accurately, without over-catching 
> the exceptions:
> 
> 
>   if (db.lookupType("DeoptimizeObjectsALotThread", false) != null) {
>      virtualConstructor.addMapping("DeoptimizeObjectsALotThread", 
> DeoptimizeObjectsALotThread.class);
>   }
> 
> 
> ?

Good idea. I've updated to do that.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23339#discussion_r1932797898

Reply via email to