8340670: Policy.UNSUPPORTED_EMPTY_COLLECTION.isReadOnly does not return true

Reviewed-by: mullan
This commit is contained in:
Artur Barashev 2024-09-24 18:57:58 +00:00 committed by Sean Mullan
parent 8c08c43a34
commit e3d80f1e1e

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -896,5 +896,15 @@ public abstract class Policy {
@Override public Enumeration<Permission> elements() {
return perms.elements();
}
/**
* If this object is readonly, no new objects can be added to it using {@code add}.
*
* @return {@code true} if this object is marked as readonly, {@code false} otherwise.
*/
@Override
public boolean isReadOnly() {
return perms.isReadOnly();
}
}
}