From: markt Date: Wed, 8 Dec 2010 15:07:20 +0000 (+0000) Subject: Remove some unused code X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7099a981f06468bd304574aebdec5ae816cd3519;p=tomcat7.0 Remove some unused code Fix some FindBugs niggles git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1043444 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java index 42831990a..c825c3508 100644 --- a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java +++ b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java @@ -571,7 +571,7 @@ public abstract class AbstractAjpProcessor implements ActionHook, Processor { case Constants.SC_A_SSL_KEY_SIZE : request.setAttribute(AbstractEndpoint.KEY_SIZE_KEY, - new Integer(requestHeaderMessage.getInt())); + Integer.valueOf(requestHeaderMessage.getInt())); break; case Constants.SC_A_STORED_METHOD: diff --git a/java/org/apache/coyote/ajp/AjpMessage.java b/java/org/apache/coyote/ajp/AjpMessage.java index f62c705f2..7221ba755 100644 --- a/java/org/apache/coyote/ajp/AjpMessage.java +++ b/java/org/apache/coyote/ajp/AjpMessage.java @@ -147,17 +147,6 @@ public class AjpMessage { /** - * Append an int (4 bytes) to the message. - */ - public void appendLongInt(int val) { - buf[pos++] = (byte) ((val >>> 24) & 0xFF); - buf[pos++] = (byte) ((val >>> 16) & 0xFF); - buf[pos++] = (byte) ((val >>> 8) & 0xFF); - buf[pos++] = (byte) (val & 0xFF); - } - - - /** * Write a MessageBytes out at the current write position. * A null MessageBytes is encoded as a string with length 0. */ @@ -318,12 +307,6 @@ public class AjpMessage { } - public byte peekByte() { - byte res = buf[pos]; - return res; - } - - public void getBytes(MessageBytes mb) { int length = getInt(); if ((length == 0xFFFF) || (length == -1)) { @@ -338,31 +321,6 @@ public class AjpMessage { /** - * Copy a chunk of bytes from the packet into an array and advance - * the read position past the chunk. See appendBytes() for details - * on the encoding. - * - * @return The number of bytes copied. - */ - public int getBytes(byte[] dest) { - int length = getInt(); - if (pos + length > buf.length) { - log.error(sm.getString("ajpmessage.read", "" + length)); - return 0; - } - - if ((length == 0xFFFF) || (length == -1)) { - return 0; - } - - System.arraycopy(buf, pos, dest, 0, length); - pos += length; - pos++; // Skip terminating \0 - return length; - } - - - /** * Read a 32 bits integer from packet, and advance the read position past * it. Integers are encoded as four unsigned bytes with the * high-order byte first, and, as far as I can tell, in @@ -444,7 +402,7 @@ public class AjpMessage { sb.append(" | "); for (int i = start; i < start + 16 && i < len + 4; i++) { if (!Character.isISOControl((char) buf[i])) { - sb.append(new Character((char) buf[i])); + sb.append(Character.valueOf((char) buf[i])); } else { sb.append("."); } diff --git a/java/org/apache/coyote/ajp/Constants.java b/java/org/apache/coyote/ajp/Constants.java index b73157ef6..49c95a77b 100644 --- a/java/org/apache/coyote/ajp/Constants.java +++ b/java/org/apache/coyote/ajp/Constants.java @@ -238,7 +238,7 @@ public final class Constants { int i; for (i = 0; i < SC_RESP_AJP13_MAX; i++) { responseTransHash.put(getResponseHeaderForCode(i), - new Integer(0xA001 + i)); + Integer.valueOf(0xA001 + i)); } } catch (Exception e) {