diff --git a/src/main/java/org/jboss/netty/util/MapUtil.java b/src/main/java/org/jboss/netty/util/MapUtil.java index 42a476501c..409ca2c165 100644 --- a/src/main/java/org/jboss/netty/util/MapUtil.java +++ b/src/main/java/org/jboss/netty/util/MapUtil.java @@ -33,16 +33,21 @@ import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLoggerFactory; /** + * A set of utility methods related with a {@link Map}. + * * @author The Netty Project (netty-dev@lists.jboss.org) * @author Trustin Lee (tlee@redhat.com) * * @version $Rev$, $Date$ - * */ public class MapUtil { private static final InternalLogger logger = InternalLoggerFactory.getInstance(MapUtil.class); + /** + * Returns {@code true} if and only if the specified {@code map} is an + * ordered map, like {@link LinkedHashMap} is. + */ @SuppressWarnings("unchecked") public static boolean isOrderedMap(Map map) { Class mapType = map.getClass(); diff --git a/src/main/java/org/jboss/netty/util/StackTraceSimplifier.java b/src/main/java/org/jboss/netty/util/StackTraceSimplifier.java index 2e0768ee28..db365dfd4b 100644 --- a/src/main/java/org/jboss/netty/util/StackTraceSimplifier.java +++ b/src/main/java/org/jboss/netty/util/StackTraceSimplifier.java @@ -26,7 +26,14 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; +import org.jboss.netty.channel.DefaultChannelPipeline; +import org.jboss.netty.channel.SimpleChannelHandler; + /** + * Simplifies an exception stack trace by removing unnecessary + * {@link StackTraceElement}s. Please note that the stack trace simplification + * is disabled if {@linkplain DebugUtil debug mode} is turned on. + * * @author The Netty Project (netty-dev@lists.jboss.org) * @author Trustin Lee (tlee@redhat.com) * @@ -42,6 +49,11 @@ public class StackTraceSimplifier { "(util\\.(ThreadRenamingRunnable)" + "|channel\\.(SimpleChannelHandler|DefaultChannelPipeline.*))$"); + /** + * Removes unnecessary {@link StackTraceElement}s from the specified + * exception. {@link ThreadRenamingRunnable}, {@link SimpleChannelHandler}, + * and {@link DefaultChannelPipeline} will be dropped from the trace. + */ public static void simplify(Throwable e) { if (!SIMPLIFY_STACK_TRACE) { return; diff --git a/src/main/java/org/jboss/netty/util/SystemPropertyUtil.java b/src/main/java/org/jboss/netty/util/SystemPropertyUtil.java index 6ca5fec69f..4e889bfc72 100644 --- a/src/main/java/org/jboss/netty/util/SystemPropertyUtil.java +++ b/src/main/java/org/jboss/netty/util/SystemPropertyUtil.java @@ -23,6 +23,8 @@ package org.jboss.netty.util; /** + * Accesses the system property swallowing a {@link SecurityException}. + * * @author The Netty Project (netty-dev@lists.jboss.org) * @author Trustin Lee (tlee@redhat.com) * @@ -31,6 +33,14 @@ package org.jboss.netty.util; */ public class SystemPropertyUtil { + /** + * Returns the value of the Java system property with the specified + * {@code key}. + * + * @return the property value. + * {@code null} if there's no such property or if an access to the + * specified property is not allowed. + */ public static String get(String key) { try { return System.getProperty(key); @@ -39,6 +49,15 @@ public class SystemPropertyUtil { } } + /** + * Returns the value of the Java system property with the specified + * {@code key}, while falling back to the specified default value if + * the property access fails. + * + * @return the property value. + * {@code def} if there's no such property or if an access to the + * specified property is not allowed. + */ public static String get(String key, String def) { String value = get(key); if (value == null) {