Re: svn commit: r769734 - /tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java

2009-04-30 Thread Mark Thomas
Filip Hanik - Dev Lists wrote:
 Mark Thomas wrote:
 Filip Hanik - Dev Lists wrote:
  
 As I mentioned in the bug report, what is the benefit of this?
 

 General best practise - no particular bug. Note the full proposed
 patch was bad.
   
 Bad practice would be to change an API, based on a report for general
 practice.
 It doesn't nothing but clutter the the SVN history for real bugs
 next time I will veto changes like this since what one considers best
 practice really merits to nothing,  as it is a personal opinion and
 nothing technical.

Then we disagree. I think encapsulation is a key element of good,
modular software design with many technical arguments for its benefits.

Whilst patches for bugs do have more immediate and obvious benefit, I
don't think we should reject patches that improve the overall quality of
the code, even if they don't fix actual bugs.

I agree than when best practice gets as far as naming conventions, use
of whitespace for indenting, line length and other coding style issues
then you are into the realm of personal opinion and with a few notable
exceptions (such as converting tabs to spaces) then there is little to
be gained.

Mark


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r769734 - /tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java

2009-04-29 Thread Filip Hanik - Dev Lists

As I mentioned in the bug report, what is the benefit of this?

Filip

ma...@apache.org wrote:

Author: markt
Date: Wed Apr 29 10:22:00 2009
New Revision: 769734

URL: http://svn.apache.org/viewvc?rev=769734view=rev
Log:
Reduce scope - partial application of patch by Jens Kapitza from bug 46999

Modified:
tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java?rev=769734r1=769733r2=769734view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java 
Wed Apr 29 10:22:00 2009
@@ -32,7 +32,7 @@
  */
 public class ThreadPoolExecutor extends 
java.util.concurrent.ThreadPoolExecutor {
 
-final AtomicInteger activeCount = new AtomicInteger(0);

+private final AtomicInteger activeCount = new AtomicInteger(0);
 
 public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueueRunnable workQueue, RejectedExecutionHandler handler) {

 super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, 
handler);
@@ -92,7 +92,7 @@
 super.execute(command);
 } catch (RejectedExecutionException rx) {
 if (super.getQueue() instanceof TaskQueue) {
-TaskQueue queue = (TaskQueue)super.getQueue();
+final TaskQueue queue = (TaskQueue)super.getQueue();
 try {
 if (!queue.force(command, timeout, unit)) {
 throw new RejectedExecutionException(Queue capacity is 
full.);
@@ -108,7 +108,7 @@
 }
 }
 
-static class RejectHandler implements java.util.concurrent.RejectedExecutionHandler {

+private static class RejectHandler implements 
java.util.concurrent.RejectedExecutionHandler {
 public void rejectedExecution(Runnable r, 
java.util.concurrent.ThreadPoolExecutor executor) {
 throw new RejectedExecutionException();
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


  



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r769734 - /tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java

2009-04-29 Thread Mark Thomas
Filip Hanik - Dev Lists wrote:
 As I mentioned in the bug report, what is the benefit of this?

General best practise - no particular bug. Note the full proposed patch was bad.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r769734 - /tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java

2009-04-29 Thread Filip Hanik - Dev Lists

Mark Thomas wrote:

Filip Hanik - Dev Lists wrote:
  

As I mentioned in the bug report, what is the benefit of this?



General best practise - no particular bug. Note the full proposed patch was bad.
  
Bad practice would be to change an API, based on a report for general 
practice.

It doesn't nothing but clutter the the SVN history for real bugs
next time I will veto changes like this since what one considers best 
practice really merits to nothing,  as it is a personal opinion and 
nothing technical.


Filip

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


  



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org