You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fs...@apache.org on 2015/11/22 16:28:55 UTC

svn commit: r1715633 - in /tomcat/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java webapps/docs/changelog.xml

Author: fschumacher
Date: Sun Nov 22 15:28:55 2015
New Revision: 1715633

URL: http://svn.apache.org/viewvc?rev=1715633&view=rev
Log:
Correct evaluation of system property <code>org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader</code>.
It was basically ignored before. Reported by coverity scan.

Modified:
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java?rev=1715633&r1=1715632&r2=1715633&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java Sun Nov 22 15:28:55 2015
@@ -24,7 +24,7 @@ public class ClassLoaderUtil {
     private static final Log log = LogFactory.getLog(ClassLoaderUtil.class);
 
     private static final boolean onlyAttemptFirstLoader =
-        Boolean.getBoolean(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader", "false"));
+        Boolean.getBoolean("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader");
 
     public static Class<?> loadClass(String className, ClassLoader... classLoaders) throws ClassNotFoundException {
         ClassNotFoundException last = null;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1715633&r1=1715632&r2=1715633&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Sun Nov 22 15:28:55 2015
@@ -95,6 +95,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="jdbc-pool">
+    <changelog>
+      <fix>
+        Correct evaluation of system property <code>org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader</code>.
+        It was basically ignored before. Reported by coverity scan. (fschumacher)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 9.0.0.M1" rtext="2015-11-17">
   <subsection name="General">



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


Re: svn commit: r1715633 - in /tomcat/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java webapps/docs/changelog.xml

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 30.11.2015 um 16:43 schrieb Christopher Schultz:
> Felix,
>
> On 11/24/15 3:47 PM, Felix Schumacher wrote:
>> Am 23.11.2015 um 03:19 schrieb Huxing Zhang:
>>> Hi fschumacher,
>>>
>>> Just a friendly reminder that I had a discussion with kkolinko about
>>> this before.
>>> I seems that it is better to explicitly define the default value
>>> rather than the Boolean.getBoolean syntactic sugar.
>> Thanks for the hint.
>>
>> I will change it.
> I'm not sure why Konstantin had a strong opinion on this;
> Boolean.getBoolean has a well-defined default value of Boolean.FALSE. I
> suppose it's a little more readable when you have the default explicitly
> in there.
That was his main point.
>
> But:
>
>>> -
>>> Boolean.getBoolean(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader",
>>> "false"));
> This was definitely wrong... it's looking-up the system property called
> "[something]" or "false" depending upon the value of
> org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader. This is what
> was intended:
>
> Boolean.valueOf(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader","false")
right.

>
>>> +
>>> Boolean.getBoolean("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader");
> ... and I have no objection to the above.
I will not change it back again :) but thanks for the review.

Regards,
  Felix
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


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


Re: svn commit: r1715633 - in /tomcat/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java webapps/docs/changelog.xml

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Felix,

On 11/24/15 3:47 PM, Felix Schumacher wrote:
> Am 23.11.2015 um 03:19 schrieb Huxing Zhang:
>> Hi fschumacher,
>>
>> Just a friendly reminder that I had a discussion with kkolinko about
>> this before.
>> I seems that it is better to explicitly define the default value
>> rather than the Boolean.getBoolean syntactic sugar.
> Thanks for the hint.
> 
> I will change it.

I'm not sure why Konstantin had a strong opinion on this;
Boolean.getBoolean has a well-defined default value of Boolean.FALSE. I
suppose it's a little more readable when you have the default explicitly
in there.

But:

>> -       
>> Boolean.getBoolean(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader",
>> "false"));

This was definitely wrong... it's looking-up the system property called
"[something]" or "false" depending upon the value of
org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader. This is what
was intended:

Boolean.valueOf(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader","false")

>> +       
>> Boolean.getBoolean("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader");

... and I have no objection to the above.

-chris

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


Re: svn commit: r1715633 - in /tomcat/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java webapps/docs/changelog.xml

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 23.11.2015 um 03:19 schrieb Huxing Zhang:
> Hi fschumacher,
>
> Just a friendly reminder that I had a discussion with kkolinko about this before.
> I seems that it is better to explicitly define the default value rather than the Boolean.getBoolean syntactic sugar.
Thanks for the hint.

I will change it.

Regards,
  Felix
>
>       private static final boolean onlyAttemptFirstLoader =
> -        Boolean.getBoolean(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader", "false"));
> +        Boolean.getBoolean("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader");
>
> Details can be found here:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=58564
>
> ------------------------------------------------------------------
> From:fschumacher <fs...@apache.org>
> Time:2015 Nov 22 (Sun) 23:29
> To:dev <de...@tomcat.apache.org>
> Subject:svn commit: r1715633 - in /tomcat/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java webapps/docs/changelog.xml
>
>
> Author: fschumacher
> Date: Sun Nov 22 15:28:55 2015
> New Revision: 1715633
>
> URL: http://svn.apache.org/viewvc?rev=1715633&view=rev
> Log:
> Correct evaluation of system property <code>org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader</code>.
> It was basically ignored before. Reported by coverity scan.
>
> Modified:
>      tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
>      tomcat/trunk/webapps/docs/changelog.xml
>
> Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java?rev=1715633&r1=1715632&r2=1715633&view=diff
> ==============================================================================
> --- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java (original)
> +++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java Sun Nov 22 15:28:55 2015
> @@ -24,7 +24,7 @@ public class ClassLoaderUtil {
>       private static final Log log = LogFactory.getLog(ClassLoaderUtil.class);
>   
>       private static final boolean onlyAttemptFirstLoader =
> -        Boolean.getBoolean(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader", "false"));
> +        Boolean.getBoolean("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader");
>   
>       public static Class<?> loadClass(String className, ClassLoader... classLoaders) throws ClassNotFoundException {
>           ClassNotFoundException last = null;
>
> Modified: tomcat/trunk/webapps/docs/changelog.xml
> URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1715633&r1=1715632&r2=1715633&view=diff
> ==============================================================================
> --- tomcat/trunk/webapps/docs/changelog.xml (original)
> +++ tomcat/trunk/webapps/docs/changelog.xml Sun Nov 22 15:28:55 2015
> @@ -95,6 +95,14 @@
>         </fix>
>       </changelog>
>     </subsection>
> +  <subsection name="jdbc-pool">
> +    <changelog>
> +      <fix>
> +        Correct evaluation of system property <code>org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader</code>.
> +        It was basically ignored before. Reported by coverity scan. (fschumacher)
> +      </fix>
> +    </changelog>
> +  </subsection>
>   </section>
>   <section name="Tomcat 9.0.0.M1" rtext="2015-11-17">
>     <subsection name="General">
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


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


Re: svn commit: r1715633 - in /tomcat/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java webapps/docs/changelog.xml

Posted by Huxing Zhang <hu...@alibaba-inc.com>.
Hi fschumacher,

Just a friendly reminder that I had a discussion with kkolinko about this before.
I seems that it is better to explicitly define the default value rather than the Boolean.getBoolean syntactic sugar.

     private static final boolean onlyAttemptFirstLoader =
-        Boolean.getBoolean(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader", "false"));
+        Boolean.getBoolean("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader");

Details can be found here: 
https://bz.apache.org/bugzilla/show_bug.cgi?id=58564

------------------------------------------------------------------
From:fschumacher <fs...@apache.org>
Time:2015 Nov 22 (Sun) 23:29
To:dev <de...@tomcat.apache.org>
Subject:svn commit: r1715633 - in /tomcat/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java webapps/docs/changelog.xml


Author: fschumacher
Date: Sun Nov 22 15:28:55 2015
New Revision: 1715633

URL: http://svn.apache.org/viewvc?rev=1715633&view=rev
Log:
Correct evaluation of system property <code>org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader</code>.
It was basically ignored before. Reported by coverity scan.

Modified:
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java?rev=1715633&r1=1715632&r2=1715633&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ClassLoaderUtil.java Sun Nov 22 15:28:55 2015
@@ -24,7 +24,7 @@ public class ClassLoaderUtil {
     private static final Log log = LogFactory.getLog(ClassLoaderUtil.class);
 
     private static final boolean onlyAttemptFirstLoader =
-        Boolean.getBoolean(System.getProperty("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader", "false"));
+        Boolean.getBoolean("org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader");
 
     public static Class<?> loadClass(String className, ClassLoader... classLoaders) throws ClassNotFoundException {
         ClassNotFoundException last = null;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1715633&r1=1715632&r2=1715633&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Sun Nov 22 15:28:55 2015
@@ -95,6 +95,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="jdbc-pool">
+    <changelog>
+      <fix>
+        Correct evaluation of system property <code>org.apache.tomcat.jdbc.pool.onlyAttemptCurrentClassLoader</code>.
+        It was basically ignored before. Reported by coverity scan. (fschumacher)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 9.0.0.M1" rtext="2015-11-17">
   <subsection name="General">



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

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