SeUniVr / RestTestGen

A framework for automated black-box testing of RESTful APIs.
Apache License 2.0
36 stars 9 forks source link

ERROR:Ambiguous method call. Both in random.NextDouble function #20

Closed maeve13 closed 3 months ago

maeve13 commented 3 months ago

it happened at ConstraintViolationParameterMutator:123,126 because nextDouble (Double, Double) in ExtendedRandom and nextDouble (double, double) in RandomGenerator match and it can't decide which one to use, i don't know the function in ExtendedRandom didn't override the nextDouble method in RandomGenerator,cause they have same parameters,and ExtendedRandom extends Random. So I changed the name nextDouble in ExtendedRandom to newNextDouble, and the problem solved. nextDouble

davidecorradini commented 3 months ago

Hello,

This also happened to me in the past when I was using a newer version of Java than the 11, which is the currently supported Java version for RestTestGen.

Could you please tell me what Java version you are running and if the problem still occurs with Java 11?

Meanwhile, I will try to fix this to make RestTestGen compatible with newer versions of Java.

Thanks, Davide

maeve13 commented 3 months ago

I'm using java 21.

Thank you for your reply

davidecorradini commented 3 months ago

Could you please try with Java 11? You might want to run RestTestGen in Docker to avoid installing Java 11 on your machine.

Thanks.

maeve13 commented 3 months ago

I tried rtg in docker as you suggested, and it runs successfully. The problem didn't occur

davidecorradini commented 3 months ago

Perfect. I'm closing this issue.