This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 7cabce9b2bafa1726edf1669646623185f6a5a6b Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Jan 24 11:18:50 2023 +0000 Code cleanup (format). No functional change. --- java/org/apache/catalina/tribes/util/Arrays.java | 54 +++++----- .../catalina/tribes/util/ExceptionUtils.java | 4 +- .../catalina/tribes/util/ExecutorFactory.java | 47 +++++---- java/org/apache/catalina/tribes/util/Logs.java | 1 + .../apache/catalina/tribes/util/StringManager.java | 110 +++++++++------------ .../catalina/tribes/util/TcclThreadFactory.java | 11 +-- .../apache/catalina/tribes/util/UUIDGenerator.java | 35 ++++--- 7 files changed, 124 insertions(+), 138 deletions(-) diff --git a/java/org/apache/catalina/tribes/util/Arrays.java b/java/org/apache/catalina/tribes/util/Arrays.java index 6813aacc24..bb6c1a5da1 100644 --- a/java/org/apache/catalina/tribes/util/Arrays.java +++ b/java/org/apache/catalina/tribes/util/Arrays.java @@ -31,38 +31,38 @@ public class Arrays { protected static final StringManager sm = StringManager.getManager(Arrays.class); public static boolean contains(byte[] source, int srcoffset, byte[] key, int keyoffset, int length) { - if ( srcoffset < 0 || srcoffset >= source.length) { + if (srcoffset < 0 || srcoffset >= source.length) { throw new ArrayIndexOutOfBoundsException(sm.getString("arrays.srcoffset.outOfBounds")); } - if ( keyoffset < 0 || keyoffset >= key.length) { + if (keyoffset < 0 || keyoffset >= key.length) { throw new ArrayIndexOutOfBoundsException(sm.getString("arrays.keyoffset.outOfBounds")); } - if ( length > (key.length-keyoffset) ) { + if (length > (key.length - keyoffset)) { throw new ArrayIndexOutOfBoundsException(sm.getString("arrays.length.outOfBounds")); } - //we don't have enough data to validate it - if ( length > (source.length-srcoffset) ) { + // we don't have enough data to validate it + if (length > (source.length - srcoffset)) { return false; } boolean match = true; int pos = keyoffset; - for ( int i=srcoffset; match && i<length; i++ ) { + for (int i = srcoffset; match && i < length; i++) { match = (source[i] == key[pos++]); } return match; } public static String toString(byte[] data) { - return toString(data,0,data!=null?data.length:0); + return toString(data, 0, data != null ? data.length : 0); } public static String toString(byte[] data, int offset, int length) { - return toString(data,offset,length,false); + return toString(data, offset, length, false); } public static String toString(byte[] data, int offset, int length, boolean unsigned) { StringBuilder buf = new StringBuilder("{"); - if ( data != null && length > 0 ) { + if (data != null && length > 0) { int i = offset; if (unsigned) { buf.append(data[i++] & 0xff); @@ -81,12 +81,12 @@ public class Arrays { } public static String toString(Object[] data) { - return toString(data,0,data!=null?data.length:0); + return toString(data, 0, data != null ? data.length : 0); } public static String toString(Object[] data, int offset, int length) { StringBuilder buf = new StringBuilder("{"); - if ( data != null && length > 0 ) { + if (data != null && length > 0) { buf.append(data[offset++]); for (int i = offset; i < length; i++) { buf.append(", ").append(data[i]); @@ -97,12 +97,12 @@ public class Arrays { } public static String toNameString(Member[] data) { - return toNameString(data,0,data!=null?data.length:0); + return toNameString(data, 0, data != null ? data.length : 0); } public static String toNameString(Member[] data, int offset, int length) { StringBuilder buf = new StringBuilder("{"); - if ( data != null && length > 0 ) { + if (data != null && length > 0) { buf.append(data[offset++].getName()); for (int i = offset; i < length; i++) { buf.append(", ").append(data[i].getName()); @@ -129,13 +129,13 @@ public class Arrays { } public static boolean equals(byte[] o1, byte[] o2) { - return java.util.Arrays.equals(o1,o2); + return java.util.Arrays.equals(o1, o2); } public static boolean equals(Object[] o1, Object[] o2) { boolean result = o1.length == o2.length; - if ( result ) { - for (int i=0; i<o1.length && result; i++ ) { + if (result) { + for (int i = 0; i < o1.length && result; i++) { result = o1[i].equals(o2[i]); } } @@ -145,7 +145,7 @@ public class Arrays { public static boolean sameMembers(Member[] m1, Member[] m2) { AbsoluteOrder.absoluteOrder(m1); AbsoluteOrder.absoluteOrder(m2); - return equals(m1,m2); + return equals(m1, m2); } public static Member[] merge(Member[] m1, Member[] m2) { @@ -183,7 +183,7 @@ public class Arrays { } public static Member[] remove(Member[] all, Member remove) { - return extract(all,new Member[] {remove}); + return extract(all, new Member[] { remove }); } public static Member[] extract(Member[] all, Member[] remove) { @@ -197,8 +197,8 @@ public class Arrays { public static int indexOf(Member member, Member[] members) { int result = -1; - for (int i=0; (result==-1) && (i<members.length); i++ ) { - if ( member.equals(members[i]) ) { + for (int i = 0; (result == -1) && (i < members.length); i++) { + if (member.equals(members[i])) { result = i; } } @@ -206,9 +206,9 @@ public class Arrays { } public static int nextIndex(Member member, Member[] members) { - int idx = indexOf(member,members)+1; - if (idx >= members.length ) { - idx = ((members.length>0)?0:-1); + int idx = indexOf(member, members) + 1; + if (idx >= members.length) { + idx = ((members.length > 0) ? 0 : -1); } return idx; @@ -227,15 +227,15 @@ public class Arrays { } public static byte[] fromString(String value) { - if ( value == null ) { + if (value == null) { return null; } - if ( !value.startsWith("{") ) { + if (!value.startsWith("{")) { throw new RuntimeException(sm.getString("arrays.malformed.arrays")); } - StringTokenizer t = new StringTokenizer(value,"{,}",false); + StringTokenizer t = new StringTokenizer(value, "{,}", false); byte[] result = new byte[t.countTokens()]; - for (int i=0; i<result.length; i++ ) { + for (int i = 0; i < result.length; i++) { result[i] = Byte.parseByte(t.nextToken()); } return result; diff --git a/java/org/apache/catalina/tribes/util/ExceptionUtils.java b/java/org/apache/catalina/tribes/util/ExceptionUtils.java index 9c74a15e6d..c352e3c39f 100644 --- a/java/org/apache/catalina/tribes/util/ExceptionUtils.java +++ b/java/org/apache/catalina/tribes/util/ExceptionUtils.java @@ -22,8 +22,8 @@ package org.apache.catalina.tribes.util; public class ExceptionUtils { /** - * Checks whether the supplied Throwable is one that needs to be - * rethrown and swallows all others. + * Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others. + * * @param t the Throwable to check */ public static void handleThrowable(Throwable t) { diff --git a/java/org/apache/catalina/tribes/util/ExecutorFactory.java b/java/org/apache/catalina/tribes/util/ExecutorFactory.java index 610757ea36..abc95d67a8 100644 --- a/java/org/apache/catalina/tribes/util/ExecutorFactory.java +++ b/java/org/apache/catalina/tribes/util/ExecutorFactory.java @@ -30,37 +30,42 @@ public class ExecutorFactory { public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit) { TaskQueue taskqueue = new TaskQueue(); - ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit,taskqueue); + ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit, taskqueue); taskqueue.setParent(service); return service; } - public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit, ThreadFactory threadFactory) { + public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit, + ThreadFactory threadFactory) { TaskQueue taskqueue = new TaskQueue(); - ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit,taskqueue, threadFactory); + ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit, taskqueue, + threadFactory); taskqueue.setParent(service); return service; } // ---------------------------------------------- TribesThreadPoolExecutor Inner Class private static class TribesThreadPoolExecutor extends ThreadPoolExecutor { - public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) { + public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, + BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, handler); prestartAllCoreThreads(); } - public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, - RejectedExecutionHandler handler) { + public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, + BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler); prestartAllCoreThreads(); } - public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory) { + public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, + BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory); prestartAllCoreThreads(); } - public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) { + public TribesThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, + BlockingQueue<Runnable> workQueue) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue); prestartAllCoreThreads(); } @@ -71,7 +76,7 @@ public class ExecutorFactory { super.execute(command); } catch (RejectedExecutionException rx) { if (super.getQueue() instanceof TaskQueue) { - TaskQueue queue = (TaskQueue)super.getQueue(); + TaskQueue queue = (TaskQueue) super.getQueue(); if (!queue.force(command)) { throw new RejectedExecutionException(sm.getString("executorFactory.queue.full")); } @@ -80,7 +85,7 @@ public class ExecutorFactory { } } - // ---------------------------------------------- TaskQueue Inner Class + // ---------------------------------------------- TaskQueue Inner Class private static class TaskQueue extends LinkedBlockingQueue<Runnable> { private static final long serialVersionUID = 1L; @@ -95,32 +100,32 @@ public class ExecutorFactory { } public boolean force(Runnable o) { - if ( parent.isShutdown() ) { + if (parent.isShutdown()) { throw new RejectedExecutionException(sm.getString("executorFactory.not.running")); } - return super.offer(o); //forces the item onto the queue, to be used if the task is rejected + return super.offer(o); // forces the item onto the queue, to be used if the task is rejected } @Override public boolean offer(Runnable o) { - //we can't do any checks - if (parent==null) { + // we can't do any checks + if (parent == null) { return super.offer(o); } - //we are maxed out on threads, simply queue the object + // we are maxed out on threads, simply queue the object if (parent.getPoolSize() == parent.getMaximumPoolSize()) { return super.offer(o); } - //we have idle threads, just add it to the queue - //this is an approximation, so it could use some tuning - if (parent.getActiveCount()<(parent.getPoolSize())) { + // we have idle threads, just add it to the queue + // this is an approximation, so it could use some tuning + if (parent.getActiveCount() < (parent.getPoolSize())) { return super.offer(o); } - //if we have less threads than maximum force creation of a new thread - if (parent.getPoolSize()<parent.getMaximumPoolSize()) { + // if we have less threads than maximum force creation of a new thread + if (parent.getPoolSize() < parent.getMaximumPoolSize()) { return false; } - //if we reached here, we need to add it to the queue + // if we reached here, we need to add it to the queue return super.offer(o); } } diff --git a/java/org/apache/catalina/tribes/util/Logs.java b/java/org/apache/catalina/tribes/util/Logs.java index 112e8cf8f5..1c1933b93b 100644 --- a/java/org/apache/catalina/tribes/util/Logs.java +++ b/java/org/apache/catalina/tribes/util/Logs.java @@ -18,6 +18,7 @@ package org.apache.catalina.tribes.util; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; + /** * Simple class that holds references to global loggers */ diff --git a/java/org/apache/catalina/tribes/util/StringManager.java b/java/org/apache/catalina/tribes/util/StringManager.java index ed689fdb8c..fc4b8b5b21 100644 --- a/java/org/apache/catalina/tribes/util/StringManager.java +++ b/java/org/apache/catalina/tribes/util/StringManager.java @@ -27,27 +27,22 @@ import java.util.ResourceBundle; /** - * An internationalization / localization helper class which reduces - * the bother of handling ResourceBundles and takes care of the - * common cases of message formatting which otherwise require the - * creation of Object arrays and such. - * - * <p>The StringManager operates on a package basis. One StringManager - * per package can be created and accessed via the getManager method - * call. - * - * <p>The StringManager will look for a ResourceBundle named by - * the package name given plus the suffix of "LocalStrings". In - * practice, this means that the localized information will be contained - * in a LocalStrings.properties file located in the package - * directory of the classpath. - * - * <p>Please see the documentation for java.util.ResourceBundle for - * more information. + * An internationalization / localization helper class which reduces the bother of handling ResourceBundles and takes + * care of the common cases of message formatting which otherwise require the creation of Object arrays and such. + * <p> + * The StringManager operates on a package basis. One StringManager per package can be created and accessed via the + * getManager method call. + * <p> + * The StringManager will look for a ResourceBundle named by the package name given plus the suffix of "LocalStrings". + * In practice, this means that the localized information will be contained in a LocalStrings.properties file located in + * the package directory of the classpath. + * <p> + * Please see the documentation for java.util.ResourceBundle for more information. * * @author James Duncan Davidson [dun...@eng.sun.com] * @author James Todd [go...@eng.sun.com] * @author Mel Martinez [mmarti...@g1440.com] + * * @see java.util.ResourceBundle */ public class StringManager { @@ -62,10 +57,8 @@ public class StringManager { /** - * Creates a new StringManager for a given package. This is a - * private method and all access to it is arbitrated by the - * static getManager method call so that only one StringManager - * per package will be created. + * Creates a new StringManager for a given package. This is a private method and all access to it is arbitrated by + * the static getManager method call so that only one StringManager per package will be created. * * @param packageName Name of package to create StringManager for. */ @@ -103,18 +96,16 @@ public class StringManager { /** - * Get a string from the underlying resource bundle or return null if the - * String is not found. + * Get a string from the underlying resource bundle or return null if the String is not found. * * @param key to desired resource String * - * @return resource String matching <i>key</i> from underlying bundle or - * null if not found. + * @return resource String matching <i>key</i> from underlying bundle or null if not found. * * @throws IllegalArgumentException if <i>key</i> is null */ public String getString(String key) { - if (key == null){ + if (key == null) { String msg = "key may not have a null value"; throw new IllegalArgumentException(msg); } @@ -127,17 +118,17 @@ public class StringManager { str = bundle.getString(key); } } catch (MissingResourceException mre) { - //bad: shouldn't mask an exception the following way: - // str = "[cannot find message associated with key '" + key + - // "' due to " + mre + "]"; - // because it hides the fact that the String was missing - // from the calling code. - //good: could just throw the exception (or wrap it in another) - // but that would probably cause much havoc on existing - // code. - //better: consistent with container pattern to - // simply return null. Calling code can then do - // a null check. + // bad: shouldn't mask an exception the following way: + // str = "[cannot find message associated with key '" + key + + // "' due to " + mre + "]"; + // because it hides the fact that the String was missing + // from the calling code. + // good: could just throw the exception (or wrap it in another) + // but that would probably cause much havoc on existing + // code. + // better: consistent with container pattern to + // simply return null. Calling code can then do + // a null check. str = null; } @@ -146,8 +137,7 @@ public class StringManager { /** - * Get a string from the underlying resource bundle and format - * it with the given set of arguments. + * Get a string from the underlying resource bundle and format it with the given set of arguments. * * @param key The key for the required message * @param args The values to insert into the message @@ -180,13 +170,12 @@ public class StringManager { // STATIC SUPPORT METHODS // -------------------------------------------------------------- - private static final Map<String, Map<Locale,StringManager>> managers = new HashMap<>(); + private static final Map<String, Map<Locale, StringManager>> managers = new HashMap<>(); /** - * The StringManager will be returned for the package in which the class is - * located. If a manager for that package already exists, it will be reused, - * else a new StringManager will be created and returned. + * The StringManager will be returned for the package in which the class is located. If a manager for that package + * already exists, it will be reused, else a new StringManager will be created and returned. * * @param clazz The class for which to retrieve the StringManager * @@ -198,8 +187,8 @@ public class StringManager { /** - * If a manager for a package already exists, it will be reused, else a new - * StringManager will be created and returned. + * If a manager for a package already exists, it will be reused, else a new StringManager will be created and + * returned. * * @param packageName The package name * @@ -211,32 +200,29 @@ public class StringManager { /** - * If a manager for a package/Locale combination already exists, it will be - * reused, else a new StringManager will be created and returned. + * If a manager for a package/Locale combination already exists, it will be reused, else a new StringManager will be + * created and returned. * * @param packageName The package name * @param locale The Locale * * @return The StringManager for a particular package and Locale */ - public static final synchronized StringManager getManager( - String packageName, Locale locale) { + public static final synchronized StringManager getManager(String packageName, Locale locale) { - Map<Locale,StringManager> map = managers.get(packageName); + Map<Locale, StringManager> map = managers.get(packageName); if (map == null) { /* - * Don't want the HashMap to be expanded beyond LOCALE_CACHE_SIZE. - * Expansion occurs when size() exceeds capacity. Therefore keep - * size at or below capacity. - * removeEldestEntry() executes after insertion therefore the test - * for removal needs to use one less than the maximum desired size + * Don't want the HashMap to be expanded beyond LOCALE_CACHE_SIZE. Expansion occurs when size() exceeds + * capacity. Therefore keep size at or below capacity. removeEldestEntry() executes after insertion + * therefore the test for removal needs to use one less than the maximum desired size * */ - map = new LinkedHashMap<Locale,StringManager>(LOCALE_CACHE_SIZE, 1, true) { + map = new LinkedHashMap<Locale, StringManager>(LOCALE_CACHE_SIZE, 1, true) { private static final long serialVersionUID = 1L; + @Override - protected boolean removeEldestEntry( - Map.Entry<Locale,StringManager> eldest) { + protected boolean removeEldestEntry(Map.Entry<Locale, StringManager> eldest) { if (size() > (LOCALE_CACHE_SIZE - 1)) { return true; } @@ -256,16 +242,14 @@ public class StringManager { /** - * Retrieve the StringManager for a list of Locales. The first StringManager - * found will be returned. + * Retrieve the StringManager for a list of Locales. The first StringManager found will be returned. * - * @param packageName The package for which the StringManager is required + * @param packageName The package for which the StringManager is required * @param requestedLocales the list of Locales * * @return the found StringManager or the default StringManager */ - public static StringManager getManager(String packageName, - Enumeration<Locale> requestedLocales) { + public static StringManager getManager(String packageName, Enumeration<Locale> requestedLocales) { while (requestedLocales.hasMoreElements()) { Locale locale = requestedLocales.nextElement(); StringManager result = getManager(packageName, locale); diff --git a/java/org/apache/catalina/tribes/util/TcclThreadFactory.java b/java/org/apache/catalina/tribes/util/TcclThreadFactory.java index de46faa62b..cb6c75887c 100644 --- a/java/org/apache/catalina/tribes/util/TcclThreadFactory.java +++ b/java/org/apache/catalina/tribes/util/TcclThreadFactory.java @@ -22,17 +22,14 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; /** - * ThreadFactory implementation that creates threads with the thread context - * class loader set to the class loader that loaded this factory. It is intended - * to be used when tasks may be passed to executors when the web application - * class loader is set as the thread context class loader, such as in async - * session replication. + * ThreadFactory implementation that creates threads with the thread context class loader set to the class loader that + * loaded this factory. It is intended to be used when tasks may be passed to executors when the web application class + * loader is set as the thread context class loader, such as in async session replication. */ public class TcclThreadFactory implements ThreadFactory { private static final AtomicInteger poolNumber = new AtomicInteger(1); - private static final boolean IS_SECURITY_ENABLED = - (System.getSecurityManager() != null); + private static final boolean IS_SECURITY_ENABLED = (System.getSecurityManager() != null); private final ThreadGroup group; private final AtomicInteger threadNumber = new AtomicInteger(1); diff --git a/java/org/apache/catalina/tribes/util/UUIDGenerator.java b/java/org/apache/catalina/tribes/util/UUIDGenerator.java index d3ef7a31c4..0358fbcdc0 100644 --- a/java/org/apache/catalina/tribes/util/UUIDGenerator.java +++ b/java/org/apache/catalina/tribes/util/UUIDGenerator.java @@ -27,8 +27,7 @@ import org.apache.juli.logging.LogFactory; */ public class UUIDGenerator { private static final Log log = LogFactory.getLog(UUIDGenerator.class); - protected static final StringManager sm = - StringManager.getManager("org.apache.catalina.tribes.util"); + protected static final StringManager sm = StringManager.getManager("org.apache.catalina.tribes.util"); public static final int UUID_LENGTH = 16; public static final int UUID_VERSION = 4; @@ -45,37 +44,37 @@ public class UUIDGenerator { secrand.nextInt(); long time = System.currentTimeMillis() - start; if (time > 100) { - log.info(sm.getString("uuidGenerator.createRandom", - secrand.getAlgorithm(), Long.valueOf(time))); + log.info(sm.getString("uuidGenerator.createRandom", secrand.getAlgorithm(), Long.valueOf(time))); } } public static byte[] randomUUID(boolean secure) { byte[] result = new byte[UUID_LENGTH]; - return randomUUID(secure,result,0); + return randomUUID(secure, result, 0); } public static byte[] randomUUID(boolean secure, byte[] into, int offset) { - if ( (offset+UUID_LENGTH)>into.length ) { - throw new ArrayIndexOutOfBoundsException(sm.getString("uuidGenerator.unable.fit", - Integer.toString(UUID_LENGTH), Integer.toString(into.length), - Integer.toString(offset+UUID_LENGTH))); + if ((offset + UUID_LENGTH) > into.length) { + throw new ArrayIndexOutOfBoundsException( + sm.getString("uuidGenerator.unable.fit", Integer.toString(UUID_LENGTH), + Integer.toString(into.length), Integer.toString(offset + UUID_LENGTH))); } - Random r = (secure&&(secrand!=null))?secrand:rand; - nextBytes(into,offset,UUID_LENGTH,r); - into[6+offset] &= 0x0F; - into[6+offset] |= (UUID_VERSION << 4); - into[8+offset] &= 0x3F; //0011 1111 - into[8+offset] |= 0x80; //1000 0000 + Random r = (secure && (secrand != null)) ? secrand : rand; + nextBytes(into, offset, UUID_LENGTH, r); + into[6 + offset] &= 0x0F; + into[6 + offset] |= (UUID_VERSION << 4); + into[8 + offset] &= 0x3F; // 0011 1111 + into[8 + offset] |= 0x80; // 1000 0000 return into; } /** * Same as java.util.Random.nextBytes except this one we don't have to allocate a new byte array - * @param into byte[] + * + * @param into byte[] * @param offset int * @param length int - * @param r Random + * @param r Random */ public static void nextBytes(byte[] into, int offset, int length, Random r) { int numRequested = length; @@ -86,7 +85,7 @@ public class UUIDGenerator { return; } rnd = (i == 0 ? r.nextInt() : rnd >> BITS_PER_BYTE); - into[offset+numGot] = (byte) rnd; + into[offset + numGot] = (byte) rnd; numGot++; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org