Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(98)

Issue 1044042: Add contentBytes-type data modification to MutableContent (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 8 months ago by johnfargo
Modified:
15 years, 8 months ago
Reviewers:
Paul Lindner, zhoresh, shindig.remailer, jtarrio
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

Makes it possible to modify MutableContent (ie in a rewriter) by raw content in addition to DOM and String.

Patch Set 1 #

Patch Set 2 : Updated patch to head. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -3 lines) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java View 1 7 chunks +65 lines, -3 lines 6 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/MutableContentTest.java View 1 5 chunks +23 lines, -0 lines 2 comments Download

Messages

Total messages: 5
johnfargo
15 years, 8 months ago (2010-04-30 19:46:50 UTC) #1
johnfargo
Updated patch to head.
15 years, 8 months ago (2010-04-30 20:15:53 UTC) #2
jtarrio
http://codereview.appspot.com/1044042/diff/7001/8002 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java (right): http://codereview.appspot.com/1044042/diff/7001/8002#newcode128 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java:128: * is modified, resultant behavior is undefined? :) http://codereview.appspot.com/1044042/diff/7001/8002#newcode131 ...
15 years, 8 months ago (2010-04-30 20:46:34 UTC) #3
Paul Lindner
lgtm
15 years, 8 months ago (2010-04-30 20:47:43 UTC) #4
johnfargo
15 years, 8 months ago (2010-04-30 22:02:23 UTC) #5
Committed, but missed Jacobo's comments. I've updated the code in response to
them, and am committing an incremental update.

http://codereview.appspot.com/1044042/diff/7001/8002
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java
(right):

http://codereview.appspot.com/1044042/diff/7001/8002#newcode128
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java:128:
* is modified, resultant behavior is
On 2010/04/30 20:46:34, jtarrio wrote:
> undefined? :)

Done.

http://codereview.appspot.com/1044042/diff/7001/8002#newcode131
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java:131:
public InputStream getContentBytes() {
On 2010/04/30 20:46:34, jtarrio wrote:
> The comment says that it's returned as a byte array, but in reality it returns
> an InputStream.

Done.

http://codereview.appspot.com/1044042/diff/7001/8002#newcode163
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java:163:
if (contentBytes == null || Arrays.equals(contentBytes, newBytes)) {
On 2010/04/30 20:46:34, jtarrio wrote:
> !Arrays.equals

Done.

http://codereview.appspot.com/1044042/diff/7001/8001
File
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/MutableContentTest.java
(right):

http://codereview.appspot.com/1044042/diff/7001/8001#newcode61
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/MutableContentTest.java:61:
content.getBytes("UTF8"), IOUtils.toByteArray(mhc.getContentBytes())));
Good call, test added!

On 2010/04/30 20:46:34, jtarrio wrote:
> If you'd like to test that UTF-8 is really used internally for the
conversions,
> you can add some non-ascii characters, as in "DÉFÃÜLT VÌÊW" or "NËW CØNTÈNT"
:)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b