lgtm, see minor comment within. A test for the specific issue that you try to resolve would be good too.
http://codereview.appspot.com/1903045/diff/1/2 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java (right): http://codereview.appspot.com/1903045/diff/1/2#newcode115 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java:115: // Never happens. now it can happen? http://codereview.appspot.com/1903045/diff/1/2#newcode191 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/MutableContent.java:191: protected void setContentBytesState(byte[] newBytes, Charset newEncoding) { Add explanation - can be override by derived class that need to know when encoding of content is changed. http://codereview.appspot.com/1903045/show
