Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casting error in 7.4.1 when processing nonProxyHosts configuration #297

Closed
cula011 opened this issue Dec 11, 2022 · 3 comments
Closed

Casting error in 7.4.1 when processing nonProxyHosts configuration #297

cula011 opened this issue Dec 11, 2022 · 3 comments
Milestone

Comments

@cula011
Copy link

cula011 commented Dec 11, 2022

Still having an issue with proxy settings, now in 7.4.1. It looks to be getting further since #291 was resolved, but now it is failing with the following:

Execution failed for task ':service:dependencyCheckAnalyze'.
> Cannot cast object 'localhost|127.0.0.1' with class 'java.lang.String' to class 'java.util.List'`

Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'localhost|127.0.0.1|192.168.1.1' with class 'java.lang.String' to class 'java.util.List'
        at org.owasp.dependencycheck.gradle.extension.ProxyExtension.setProperty(ProxyExtension.groovy)
        at org.owasp.dependencycheck.gradle.tasks.ConfiguredTask.configureProxy(ConfiguredTask.groovy:204)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

It seems it is trying to assign a String to a List<String>:

See target:

Looking at the history, it was previously fetching the nonProxyHosts differently, which was returning a List<Pattern>:

Now, It is simply fetching a single String:

String nonProxyHosts = System.getProperty("https.nonProxyHosts", System.getProperty("http.nonProxyHosts"))

@jeremylong
Copy link
Collaborator

all the reasons I hate groovy... I really need to add @groovy.transform.CompileStatic...

@jeremylong jeremylong added this to the 7.4.2 milestone Dec 13, 2022
@jeremylong
Copy link
Collaborator

Added @CompileStatic and was surprised by the number of issues. See #299

@cula011
Copy link
Author

cula011 commented Dec 19, 2022

Hi @jeremylong, do you have an ETA for the 7.4.2 release? Thanks.

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

No branches or pull requests

2 participants