Skip to content

Conversation

@PromiseChan
Copy link
Contributor

@PromiseChan PromiseChan commented Jul 20, 2023

What is the purpose of the change

fix win11 graalvm17 dubbo aot compile throws java.nio.file.NoSuchFileException

Brief changelog

Because in Windows OS , file separator is "\" .
However in jvm/graalvm , .class file URL is always splited by "/"
1
2

So the following code does not work in Windows

org.apache.dubbo.aot.generate.JarScanner#toClassName(String path)

path.substring(0, path.length() - 6).replace(File.separator, ".")

I change to

path.contains(File.separator) ? path.substring(0, path.length() - 6).replace(File.separator, ".") : path.substring(0, path.length() - 6).replace("/", ".");

Checklist

[y] dubbo_issue: win11 graalvm17 dubbo aot compile throws java.nio.file.NoSuchFileException

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@codecov-commenter
Copy link

Codecov Report

Merging #12769 (db25121) into 3.3 (80d496c) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                3.3   #12769      +/-   ##
============================================
- Coverage     68.11%   68.08%   -0.03%     
  Complexity        6        6              
============================================
  Files          1703     1703              
  Lines         70133    70133              
  Branches      10175    10175              
============================================
- Hits          47768    47752      -16     
- Misses        17719    17733      +14     
- Partials       4646     4648       +2     

see 26 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants