Closed
Description
ClassNameGenerator
has two variants for the generateClassName
feature. One that takes a target Class<?>
and another that takes a target String
. I'm a bit confused by the concept of a target here and I think we should explain that a bit more in the javadocs.
These methods also have different behavior:
ClassName first = this.generator.generateClassName(java.io.InputStream.class, "bytes");
// will result in java.io.InputStream__Bytes
ClassName first = this.generator.generateClassName("java.io.InputStream", "bytes");
// will result in __.JavaIoInputStream__Bytes
Even if the difference of behavior is intended, the name and docs are very similar. Also, a common use case for the ClassNameGenerator
is about generating sources in a specific package to work around visibility issues. The second variant can make this case more difficult to achieve.
As a side note, this class is also referring to the now defunct @see GeneratedClassName
.