8357682: sun.security.provider.certpath.Builder#getMatchingPolicies always returns null

Reviewed-by: mullan
This commit is contained in:
Koushik Thirupattur 2025-07-30 19:56:38 +00:00 committed by Sean Mullan
parent 3bdac53178
commit 413ac74ecc

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, 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
@ -139,7 +139,7 @@ abstract class Builder {
* cert's certificate policies extension in order for a cert to be selected.
*/
Set<String> getMatchingPolicies() {
if (matchingPolicies != null) {
if (matchingPolicies == null) {
Set<String> initialPolicies = buildParams.initialPolicies();
if ((!initialPolicies.isEmpty()) &&
(!initialPolicies.contains(PolicyChecker.ANY_POLICY)) &&