[ https://issues.apache.org/jira/browse/GROOVY-11978 ]


    Paul King deleted comment on GROOVY-11978:
    ------------------------------------

was (Author: githubbot):
codecov-commenter commented on PR #2504:
URL: https://github.com/apache/groovy/pull/2504#issuecomment-4362193563

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2504?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `38.88889%` with `11 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 67.2301%. Comparing base 
([`8dde1c8`](https://app.codecov.io/gh/apache/groovy/commit/8dde1c84134ef6fdeecf26b5cbb5183d5aab4dac?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`75282f2`](https://app.codecov.io/gh/apache/groovy/commit/75282f224545203636ea687238915f8cebfd82ae?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2504?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...ain/java/org/codehaus/groovy/tools/RootLoader.java](https://app.codecov.io/gh/apache/groovy/pull/2504?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftools%2FRootLoader.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3Rvb2xzL1Jvb3RMb2FkZXIuamF2YQ==)
 | 38.8889% | [8 Missing and 3 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2504?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2504/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2504?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2504        +/-   ##
   ==================================================
   + Coverage     67.2264%   67.2301%   +0.0037%     
   - Complexity      31984      31987         +3     
   ==================================================
     Files            1468       1468                
     Lines          123923     123940        +17     
     Branches        22251      22256         +5     
   ==================================================
   + Hits            83309      83325        +16     
   - Misses          33433      33434         +1     
     Partials         7181       7181                
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2504?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...ain/java/org/codehaus/groovy/tools/RootLoader.java](https://app.codecov.io/gh/apache/groovy/pull/2504?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftools%2FRootLoader.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3Rvb2xzL1Jvb3RMb2FkZXIuamF2YQ==)
 | `45.0000% <38.8889%> (-1.5116%)` | :arrow_down: |
   
   ... and [4 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2504/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> RootLoader returns duplicate resource URLs when the same jar appears on 
> parent and child classpaths
> ---------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11978
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11978
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> {\{RootLoader}} (used by the \{{groovy}}, \{{groovyc}}, \{{groovysh}}, 
> \{{groovyConsole}}
> and \{{grape}} launcher scripts) inherits the JVM startup classpath as its 
> parent
> loader. The launcher puts the core groovy jar on \{{-classpath}} to bootstrap
> {\{GroovyStarter}}, and \{{groovy-starter.conf}}'s \{{load 
> !\{groovy.home\}/lib/*.jar}}
> glob then re-adds the same jar to \{{RootLoader}} itself. As a result, the 
> same
> jar appears in two places in the loader hierarchy.
> This causes \{{RootLoader.getResources(name)}} to return two URLs that point 
> to
> the same entry inside the same jar. Anything that walks the enumeration and
> expects providers to be unique trips on this — for example 
> \{{java.util.ServiceLoader}},
> or any \{{ResourceBundle}}/lookup code that aborts on duplicate hits.
> h3. Reproduction
> Run any launcher that hits resource enumeration on the core jar; 
> \{{groovyConsole}}
> fails on startup with:
> {noformat}
> java.util.MissingResourceException: Can't find bundle for base name 
> groovy.console.ui.Console, locale en_AU
>     at 
> java.base/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2045)
>     ...
>     at 
> org.codehaus.groovy.tools.shell.util.MessageSource.createBundles(MessageSource.java:78)
>     at 
> org.codehaus.groovy.tools.shell.util.MessageSource.getMessage(MessageSource.java:99)
>     at groovy.console.ui.Console.main(Console.groovy:336)
> {noformat}
> h3. Fix
> Override \{{RootLoader.getResources(String)}} so URLs whose canonical jar file
> has already been seen are collapsed. Walks \{{findResources}} first then the
> parent chain, matching the existing child-first behaviour of \{{getResource}}.
> Non-jar URLs (directories, custom protocols) are passed through unchanged;
> canonical-file matching means symlinked jars also dedup correctly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to