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

Issue 181148: [SHINDIG-1256] Fixing several small bugs

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 8 months ago by Jon Weygandt
Modified:
10 years, 12 months ago
Reviewers:
henry.saputra, shindig.remailer
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : Same as #1, should work better #

Total comments: 19

Messages

Total messages: 9
Jon Weygandt
15 years, 8 months ago (2010-01-06 18:36:13 UTC) #1
Jon Weygandt
Same as #1, should work better
15 years, 8 months ago (2010-01-06 18:42:13 UTC) #2
Jon Weygandt
Annotated diff as required. http://codereview.appspot.com/181148/diff/12/1002 File java/common/src/main/java/org/apache/shindig/common/crypto/BasicBlobCrypter.java (right): http://codereview.appspot.com/181148/diff/12/1002#newcode78 java/common/src/main/java/org/apache/shindig/common/crypto/BasicBlobCrypter.java:78: BufferedReader reader = null; Close ...
15 years, 8 months ago (2010-01-06 18:56:00 UTC) #3
henry.saputra
Looks good with small comments/questions. http://codereview.appspot.com/181148/diff/12/1006 File java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java (right): http://codereview.appspot.com/181148/diff/12/1006#newcode63 java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java:63: public synchronized Gadget setGadgetFeatureRegistry(FeatureRegistry ...
15 years, 8 months ago (2010-01-06 20:34:59 UTC) #4
Jon Weygandt
http://codereview.appspot.com/181148/diff/12/1006 File java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java (right): http://codereview.appspot.com/181148/diff/12/1006#newcode63 java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java:63: public synchronized Gadget setGadgetFeatureRegistry(FeatureRegistry registry) { See the comment ...
15 years, 8 months ago (2010-01-06 21:02:07 UTC) #5
Jon Weygandt
http://codereview.appspot.com/181148/diff/12/1005 File java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/RpcServlet.java (right): http://codereview.appspot.com/181148/diff/12/1005#newcode89 java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/RpcServlet.java:89: InputStreamReader is = new InputStreamReader(request.getInputStream(), The answer to your ...
15 years, 8 months ago (2010-01-06 21:30:41 UTC) #6
henry.saputra
Hi, Here is my 2 cents about the why synchronized is added before. - Henry ...
15 years, 8 months ago (2010-01-07 00:38:54 UTC) #7
Jon Weygandt
http://codereview.appspot.com/181148/diff/12/1006 File java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java (right): http://codereview.appspot.com/181148/diff/12/1006#newcode63 java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java:63: public synchronized Gadget setGadgetFeatureRegistry(FeatureRegistry registry) { I propose to ...
15 years, 8 months ago (2010-01-08 16:47:39 UTC) #8
henry.saputra
15 years, 8 months ago (2010-01-08 19:17:23 UTC) #9
http://codereview.appspot.com/181148/diff/12/1006
File java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java (right):

http://codereview.appspot.com/181148/diff/12/1006#newcode63
java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java:63: public
synchronized Gadget setGadgetFeatureRegistry(FeatureRegistry registry) {
Yeah I agree uncontested synchronized wont cause problem.

+1 

On 2010/01/08 16:47:39, Jon Weygandt wrote:
> I propose to NOT do this change.
> 
> 1) I cannot find any evidence that Gadget is used in a mulththreaded
> environment.
> 
> 2) If Gadget is really used in a single thread, we can remove synchronized
> everywhere. But since an uncontested synchronized is cheap I won't propose to
> remove it from "getAllFeatures()", this is a bug fix patch, not a clean up
> patch, besides someone put it there for some reason.
> 
> 3) Should it be used in a multithreaded environment: there is really more:
> "directFeatureDeps" is also referenced in the getAllFeatures. There may be
more
> issues.
>

http://codereview.appspot.com/181148/diff/12/1005
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/RpcServlet.java
(right):

http://codereview.appspot.com/181148/diff/12/1005#newcode89
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/RpcServlet.java:89:
InputStreamReader is = new InputStreamReader(request.getInputStream(),
+1

On 2010/01/08 16:47:39, Jon Weygandt wrote:
> I'm going to propose that for this fix, we do NOT close the input stream.
> 1) Seems the general consensus from a google search is not to close it.
> 2) Searching some code of app servers shows the stream is really wrapped (e.g.
> not direct to a socket), closing it would do no harm. (which seems to be why
> people say not to close it)
> 3) So far no one has reported any memory leaks in this area for Shindig.
> 4) This bug focus on fixing character encoding.

Done.
Sign in to reply to this message.

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