RFR: 8344895: SM cleanup of module java.xml

Alan Bateman alanb at openjdk.org
Mon Nov 25 07:47:16 UTC 2024


On Fri, 22 Nov 2024 22:13:00 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Updates to the java.xml module following the SecurityManager removal.
> Refactor to remove doPrivilege calls
> Refactor to eliminate dead code assuming getSecurityManager() == null 
> Refactor to drop use of AccessControlContext
> Remove (most) references to SecurityException
> Remove error messages that refer to security manager.
> Update copyrights and @LastModified dates
> 
> Each commit focuses on a particular kind of change (if that's any help when reviewing)

src/java.xml/share/classes/jdk/xml/internal/Utils.java line 46:

> 44:         String val = SecuritySupport.getSystemProperty("jaxp.debug");
> 45:         // Allow simply setting the prop to turn on debug
> 46:         debug = val != null && !"false".equals(val);

It might be that java.xml takes several passes to clean up but I assume the SecuritySupport.getSystemProperty methods can be removed and use-sites changed to use System.getProperty.

src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderFactory.java line 248:

> 246:             } else {
> 247:                 return null;
> 248:             }

In passing, the Iterator isn't needed here, this block can be reduced to`return ServiceLoader.load(type, cl).findFirst().orElse(null);`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22334#discussion_r1855999628
PR Review Comment: https://git.openjdk.org/jdk/pull/22334#discussion_r1855996736


More information about the core-libs-dev mailing list