You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "jiangML (via GitHub)" <gi...@apache.org> on 2023/05/30 11:13:19 UTC

[GitHub] [shardingsphere] jiangML opened a new issue, #25948: Unify the use of classloader in ClasspathDriverURLProvider

jiangML opened a new issue, #25948:
URL: https://github.com/apache/shardingsphere/issues/25948

   ## Feature Request
   
   **For English only**, other languages will not be accepted.
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot make decision by current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Is your feature request related to a problem?
   
   + ClasspathDriverURLProvider
   ```java
       private InputStream getResourceAsStream(final String resource) {
           for (ClassLoader each : Arrays.asList(Thread.currentThread().getContextClassLoader(), getClass().getClassLoader(), ClassLoader.getSystemClassLoader())) {
   Use "Thread.currentThread().getContextClassLoader()" instead.
               if (null != each) {
                   InputStream result = each.getResourceAsStream(resource);
                   if (null == result) {
                       result = each.getResourceAsStream("/" + resource);
                   }
                   if (null != result) {
                       return result;
                   }
               }
           }
           throw new IllegalArgumentException(String.format("Can not find configuration file `%s`.", resource));
       }
   ```
   
   In most cases Thread.currentThread().getContextClassLoader() can replace getClass().getClassLoader(), ClassLoader.getSystemClassLoader(), so use Thread.currentThread().getContextClassLoader() uniformly
   
   ### Describe the feature you would like.
   
   Use Thread.currentThread().getContextClassLoader() uniformly


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] tristaZero closed issue #25948: Unify the use of classloader in ClasspathDriverURLProvider

Posted by "tristaZero (via GitHub)" <gi...@apache.org>.
tristaZero closed issue #25948: Unify the use of classloader in ClasspathDriverURLProvider
URL: https://github.com/apache/shardingsphere/issues/25948


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org