Compilation error due to overloaded method with unavailable parameter type

Gunnar Morling gunnar at hibernate.org
Tue May 31 17:27:09 UTC 2016


Hi,

I'm trying to compile some code with Jigsaw / Build 120 which is using the
FEST Assert library [1]. For that purpose I copied that library to my
module directory and added a dependency to my module-info.java.

One class of FEST Assert I'm using, Assertions, contains several overloaded
assertThat() methods, one of them [2]
expecting java.awt.image.BufferedImage as a parameter. My code does *not*
invoke that overloaded variant though, but rather the one taking List<?> as
a parameter.

Still I'm getting the following error:

   class file for java.awt.image.BufferedImage not found

I can make the error go away by adding "requires java.desktop" to
module-info.java. But that seems not right, given I'm not using
BufferedImage in my module at all.

Is this a bug in Jigsaw? Or do I actually need that requires clause in
order for overload resolution to work correctly?

Thanks,

--Gunnar

[1] https://github.com/alexruiz/fest-assert-1.x
[2]
https://github.com/alexruiz/fest-assert-1.x/blob/1.4/src/main/java/org/fest/assertions/Assertions.java#L85


More information about the jigsaw-dev mailing list