From: markt Date: Wed, 18 Nov 2009 23:22:13 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48197 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f59fc8f4d56de25de74ab76d08faf060698f0457;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48197 Reduce visibility where possible Fix javadoc Based on a patch by sebb git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@881996 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/tribes/io/XByteBuffer.java b/java/org/apache/catalina/tribes/io/XByteBuffer.java index 70e6bf2c7..26e2846d0 100644 --- a/java/org/apache/catalina/tribes/io/XByteBuffer.java +++ b/java/org/apache/catalina/tribes/io/XByteBuffer.java @@ -48,18 +48,18 @@ import java.util.concurrent.atomic.AtomicInteger; public class XByteBuffer { - public static final org.apache.juli.logging.Log log = + private static final org.apache.juli.logging.Log log = org.apache.juli.logging.LogFactory.getLog( XByteBuffer.class ); /** * This is a package header, 7 bytes (FLT2002) */ - public static final byte[] START_DATA = {70,76,84,50,48,48,50}; + private static final byte[] START_DATA = {70,76,84,50,48,48,50}; /** * This is the package footer, 7 bytes (TLF2003) */ - public static final byte[] END_DATA = {84,76,70,50,48,48,51}; + private static final byte[] END_DATA = {84,76,70,50,48,48,51}; /** * Variable to hold the data @@ -331,7 +331,6 @@ public class XByteBuffer * Creates a complete data package * @param cdata - the message data to be contained within the package * @return - a full package (header,size,data,footer) - * */ public static byte[] createDataPackage(ChannelData cdata) { // return createDataPackage(cdata.getDataPackage()); @@ -438,6 +437,12 @@ public class XByteBuffer return data; } + /** + * Converts a byte array entry to boolean + * @param b byte array + * @param offset within byte array + * @return true if byte array entry is non-zero, false otherwise + */ public static boolean toBoolean(byte[] b, int offset) { return b[offset] != 0; } @@ -549,7 +554,9 @@ public class XByteBuffer throws IOException, ClassNotFoundException, ClassCastException { return deserialize(data,offset,length,null); } - public static AtomicInteger invokecount = new AtomicInteger(0); + + private static AtomicInteger invokecount = new AtomicInteger(0); + public static Serializable deserialize(byte[] data, int offset, int length, ClassLoader[] cls) throws IOException, ClassNotFoundException, ClassCastException { invokecount.addAndGet(1);