Skip to content

Commit

Permalink
Exclude cli and picocli
Browse files Browse the repository at this point in the history
  • Loading branch information
gayaldassanayake committed Feb 15, 2024
1 parent 478a0ef commit fdc9029
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
Class<?> loadedClass = findLoadedClass(name);
if (loadedClass == null) {
try {
// First, try to load the class from the URLs
loadedClass = findClass(name);
// Load from parent if cli or picocli classes. This is to avoid SPI and class loading issues
if (name.startsWith("io.ballerina.cli") || name.startsWith("picocli")) {
loadedClass = super.loadClass(name, resolve);

Check warning on line 51 in cli/ballerina-cli/src/main/java/io/ballerina/cli/launcher/CustomToolClassLoader.java

View check run for this annotation

Codecov / codecov/patch

cli/ballerina-cli/src/main/java/io/ballerina/cli/launcher/CustomToolClassLoader.java#L51

Added line #L51 was not covered by tests
} else {
// First, try to load the class from the URLs
loadedClass = findClass(name);

Check warning on line 54 in cli/ballerina-cli/src/main/java/io/ballerina/cli/launcher/CustomToolClassLoader.java

View check run for this annotation

Codecov / codecov/patch

cli/ballerina-cli/src/main/java/io/ballerina/cli/launcher/CustomToolClassLoader.java#L54

Added line #L54 was not covered by tests
}
} catch (ClassNotFoundException e) {
try {
// If not found, delegate to the parent
Expand Down

0 comments on commit fdc9029

Please sign in to comment.