mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8274318: Replace 'for' cycles with iterator with enhanced-for in java.management
Reviewed-by: cjplummer, sspitsyn, dfuchs
This commit is contained in:
parent
754bc82c4c
commit
9945f7a074
3 changed files with 9 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2021, 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
|
||||
|
@ -494,8 +494,7 @@ public abstract class RMIServerImpl implements Closeable, RMIServer {
|
|||
if (subject != null) {
|
||||
Set<Principal> principals = subject.getPrincipals();
|
||||
String sep = "";
|
||||
for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) {
|
||||
Principal p = it.next();
|
||||
for (Principal p : principals) {
|
||||
String name = p.getName().replace(' ', '_').replace(';', ':');
|
||||
buf.append(sep).append(name);
|
||||
sep = ";";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue