cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1190551 - in /cxf/trunk: api/src/main/java/org/apache/cxf/io/ rt/management/src/main/java/org/apache/cxf/management/interceptor/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/pe...
Date Fri, 28 Oct 2011 20:29:44 GMT
Author: dkulp
Date: Fri Oct 28 20:29:43 2011
New Revision: 1190551

URL: http://svn.apache.org/viewvc?rev=1190551&view=rev
Log:
[CXF-3889] Change totalLen field in CachedOutputStream to long

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
    cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistInInterceptor.java
    cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistOutInterceptor.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java?rev=1190551&r1=1190550&r2=1190551&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java Fri Oct 28 20:29:43
2011
@@ -76,7 +76,7 @@ public class CachedOutputStream extends 
     private long threshold = DEFAULT_THRESHOLD;
     private long maxSize = DEFAULT_MAX_SIZE;
 
-    private int totalLength;
+    private long totalLength;
 
     private boolean inmem;
 
@@ -259,7 +259,7 @@ public class CachedOutputStream extends 
         IOUtils.copyAndCloseInput(in, out, bufferSize);
     }
 
-    public int size() {
+    public long size() {
         return totalLength;
     }
 
@@ -293,11 +293,11 @@ public class CachedOutputStream extends 
         }
     }
     
-    public void writeCacheTo(StringBuilder out, int limit) throws IOException {
+    public void writeCacheTo(StringBuilder out, long limit) throws IOException {
         writeCacheTo(out, "UTF-8", limit);
     }
     
-    public void writeCacheTo(StringBuilder out, String charsetName, int limit) throws IOException
{
+    public void writeCacheTo(StringBuilder out, String charsetName, long limit) throws IOException
{
         flush();
         if (totalLength < limit
             || limit == -1) {
@@ -305,11 +305,11 @@ public class CachedOutputStream extends 
             return;
         }
 
-        int count = 0;
+        long count = 0;
         if (inmem) {
             if (currentStream instanceof ByteArrayOutputStream) {
                 byte bytes[] = ((ByteArrayOutputStream)currentStream).toByteArray();
-                out.append(IOUtils.newStringFromBytes(bytes, charsetName, 0, limit));
+                out.append(IOUtils.newStringFromBytes(bytes, charsetName, 0, (int)limit));
             } else {
                 throw new IOException("Unknown format of currentStream");
             }
@@ -317,12 +317,12 @@ public class CachedOutputStream extends 
             // read the file
             FileInputStream fin = new FileInputStream(tempFile);
             byte bytes[] = new byte[1024];
-            int x = fin.read(bytes);
+            long x = fin.read(bytes);
             while (x != -1) {
                 if ((count + x) > limit) {
                     x = limit - count;
                 }
-                out.append(IOUtils.newStringFromBytes(bytes, charsetName, 0, x));
+                out.append(IOUtils.newStringFromBytes(bytes, charsetName, 0, (int)x));
                 count += x;
 
                 if (count >= limit) {

Modified: cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistInInterceptor.java?rev=1190551&r1=1190550&r2=1190551&view=diff
==============================================================================
--- cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistInInterceptor.java
(original)
+++ cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistInInterceptor.java
Fri Oct 28 20:29:43 2011
@@ -59,7 +59,7 @@ public class PersistInInterceptor extend
                 bos.close();
 
                 exchange.setRequest(builder.toString());
-                exchange.setRequestSize(bos.size());
+                exchange.setRequestSize((int)bos.size());
 
             } catch (IOException e) {
                 throw new Fault(e);

Modified: cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistOutInterceptor.java?rev=1190551&r1=1190550&r2=1190551&view=diff
==============================================================================
--- cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistOutInterceptor.java
(original)
+++ cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/PersistOutInterceptor.java
Fri Oct 28 20:29:43 2011
@@ -76,7 +76,7 @@ public class PersistOutInterceptor exten
             try {
                 StringBuilder buffer = new StringBuilder();
                 cos.writeCacheTo(buffer, cos.size());
-                this.exchange.setResponseSize(cos.size());
+                this.exchange.setResponseSize((int)cos.size());
                 this.exchange.setResponse(buffer.toString());
             } catch (Exception ex) {
                 // ignore

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1190551&r1=1190550&r2=1190551&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Fri Oct 28 20:29:43 2011
@@ -1100,8 +1100,8 @@ public class HTTPConduit 
 
         message.put(KEY_HTTP_CONNECTION, connection);
 
-        if (stream != null) {
-            connection.setFixedLengthStreamingMode(stream.size());
+        if (stream != null && stream.size() < Integer.MAX_VALUE) {
+            connection.setFixedLengthStreamingMode((int)stream.size());
         }
 
         // Need to set the headers before the trust decision

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java?rev=1190551&r1=1190550&r2=1190551&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java Fri Oct
28 20:29:43 2011
@@ -136,7 +136,7 @@ public class RMMessage {
      * 
      * @return
      */
-    public int getSize() {
+    public long getSize() {
         return content.size();
     }
 }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java?rev=1190551&r1=1190550&r2=1190551&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java
(original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java
Fri Oct 28 20:29:43 2011
@@ -235,9 +235,9 @@ public class RMTxStoreTest extends Asser
         EasyMock.expect(msg2.getMessageNumber()).andReturn(ONE); 
         byte[] bytes = new byte[89];
         EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
-        EasyMock.expect(msg1.getSize()).andReturn(bytes.length);
+        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
         EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
-        EasyMock.expect(msg2.getSize()).andReturn(bytes.length);
+        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
         
         control.replay();
         store.beginTransaction();
@@ -249,7 +249,7 @@ public class RMTxStoreTest extends Asser
         control.reset();
         EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE); 
         EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
-        EasyMock.expect(msg1.getSize()).andReturn(bytes.length);
+        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
         
         control.replay();
         store.beginTransaction();
@@ -265,9 +265,9 @@ public class RMTxStoreTest extends Asser
         EasyMock.expect(msg1.getMessageNumber()).andReturn(TEN);
         EasyMock.expect(msg2.getMessageNumber()).andReturn(TEN); 
         EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));

-        EasyMock.expect(msg1.getSize()).andReturn(bytes.length);
+        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
         EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));

-        EasyMock.expect(msg2.getSize()).andReturn(bytes.length);
+        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
         
         control.replay();
         store.beginTransaction();
@@ -655,7 +655,7 @@ public class RMTxStoreTest extends Asser
         EasyMock.expect(msg.getTo()).andReturn(to);
         byte[] value = ("Message " + mn.longValue()).getBytes();
         EasyMock.expect(msg.getInputStream()).andReturn(new ByteArrayInputStream(value));
-        EasyMock.expect(msg.getSize()).andReturn(value.length);
+        EasyMock.expect(msg.getSize()).andReturn((long)value.length);
         
         control.replay();
         store.beginTransaction();



Mime
View raw message