Author: fhanik Date: Thu Apr 13 12:08:45 2006 New Revision: 393893 URL: http://svn.apache.org/viewcvs?rev=393893&view=rev Log: Cloning should use Object return type
Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelMessage.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ClusterData.java Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelMessage.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelMessage.java?rev=393893&r1=393892&r2=393893&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelMessage.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelMessage.java Thu Apr 13 12:08:45 2006 @@ -76,11 +76,11 @@ * Shallow clone, only the actual message(getMessage()) is cloned, the rest remains as references * @return ChannelMessage */ - public ChannelMessage clone(); + public Object clone(); /** * Deep clone, everything gets cloned * @return ChannelMessage */ - public ChannelMessage deepclone(); + public Object deepclone(); } Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java?rev=393893&r1=393892&r2=393893&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java Thu Apr 13 12:08:45 2006 @@ -107,7 +107,7 @@ ChannelMessage[] messages = new ChannelMessage[count]; int remaining = size; for ( int i=0; i<count; i++ ) { - ChannelMessage tmp = msg.clone(); + ChannelMessage tmp = (ChannelMessage)msg.clone(); int offset = (i*maxSize); int length = Math.min(remaining,maxSize); tmp.getMessage().clear(); Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java?rev=393893&r1=393892&r2=393893&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java Thu Apr 13 12:08:45 2006 @@ -52,7 +52,7 @@ if ( async && run ) { if ( (currentSize.get()+msg.getMessage().getLength()) > maxQueueSize ) throw new ChannelException("Asynchronous queue is full, reached its limit of "+maxQueueSize+" bytes, current:"+currentSize+" bytes."); //add to queue - if ( useDeepClone ) msg = msg.deepclone(); + if ( useDeepClone ) msg = (ChannelMessage)msg.deepclone(); if (!queue.add(msg, destination, payload) ) { throw new ChannelException("Unable to add the message to the async queue, queue bug?"); } Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ClusterData.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ClusterData.java?rev=393893&r1=393892&r2=393893&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ClusterData.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ClusterData.java Thu Apr 13 12:08:45 2006 @@ -212,7 +212,7 @@ * Create a shallow clone, only the data gets recreated * @return ClusterData */ - public ClusterData clone() { + public Object clone() { // byte[] d = this.getDataPackage(); // return ClusterData.getDataFromPackage(d); ClusterData clone = new ClusterData(false); @@ -228,7 +228,7 @@ * Complete clone * @return ClusterData */ - public ClusterData deepclone() { + public Object deepclone() { byte[] d = this.getDataPackage(); return ClusterData.getDataFromPackage(d); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]