[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlrpc-dev
Subject: cvs commit: xml-rpc/src/java/org/apache/xmlrpc XmlRpcServer.java
From: dlr () apache ! org
Date: 2002-02-22 16:08:42
[Download RAW message or body]
dlr 02/02/22 08:08:42
Modified: src/java/org/apache/xmlrpc XmlRpcServer.java
Log:
Moved EMPTY_BYTE_ARRAY back to where Jon had put it in the first
place. Rick Johnston <RRJohnston@symantec.com> indicates that javac
(perhaps incorrectly) does not allow it, and provides some information
from the JLS:
"In compiling the latest version of XmlRpcServer.java with javac
(1.3.1), I got a compiler error because of the static member
'EMPTY_BYTE_ARRAY' in the inner 'Worker' class. Section 8.1.2 of the
Java Language Spec 2nd ed. does specifically state that "Inner classes
may not declare static members, unless they are compile-time constant
fields." Since EMPTY_BYTE_ARRAY is defined as "= new byte[0]", this
is not a compile-time constant and is therefore invalid.
Interestingly, the Jikes compiler does not complain about this
(perhaps because it is also declared as final?). Alternatively, if
the Worker class was a Nested class but not an Inner class (i.e.,
Worker is 'static' - which doesn't seem appropriate), this would be
legal."
Revision Changes Path
1.22 +2 -2 xml-rpc/src/java/org/apache/xmlrpc/XmlRpcServer.java
Index: XmlRpcServer.java
===================================================================
RCS file: /home/cvs/xml-rpc/src/java/org/apache/xmlrpc/XmlRpcServer.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -u -r1.21 -r1.22
--- XmlRpcServer.java 20 Feb 2002 20:22:12 -0000 1.21
+++ XmlRpcServer.java 22 Feb 2002 16:08:42 -0000 1.22
@@ -70,6 +70,8 @@
*/
public class XmlRpcServer
{
+ private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
+
private Hashtable handlers;
private Stack pool;
private int workers;
@@ -171,8 +173,6 @@
*/
class Worker extends XmlRpc
{
- private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
-
private Vector inParams;
private ByteArrayOutputStream buffer;
private XmlWriter writer;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic