-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
name parameter to TypePool#describe(String) has no contract #1754
Comments
The idea is that you can call the method on the class constant. For example:
or
Did you observe that this does not apply? |
Maybe I was not clear. If I call |
This is indeed a sloppyness in the input validation. For a non-primitive array, it does not currently check that the input starts with an I will add validation that it checks for well-formed input in the future. |
Next up, if I wanted a |
Dollar signs, just as the |
Hmm; OK, but |
That is true. The prefix is omitted. As if |
https://github.com/raphw/byte-buddy/blob/byte-buddy-1.16.0/byte-buddy-dep/src/main/java/net/bytebuddy/pool/TypePool.java#L576-L602
The documentation says only:
When you call
Class.getName()
, you supply no arguments, so it's hard to know how calling it could describe thename
parameter ofTypePool#describe(String)
.Maybe you meant, loosely,
Class.forName(String)
? ButClass.forName("int")
will fail, whereastypePool.describe("int")
will succeed.Then it appears that certain? all? only some? implementations of
TypePool#describe(String)
will accept Java Virtual MachineArrayTypeSignature
s, as in something like[java.lang.Integer
whereasClass.forName("[java.lang.Integer")
will fail. Is this name form officially supported, or just an implementation detail?What, then, should the documentation for the
name
parameter ofTypePool#describe(String)
be?The text was updated successfully, but these errors were encountered: