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

Missing parallel structure in manual section 35.5.5 ("creating stub files") #6247

Closed
kelloggm opened this issue Oct 20, 2023 · 1 comment · Fixed by #6249
Closed

Missing parallel structure in manual section 35.5.5 ("creating stub files") #6247

kelloggm opened this issue Oct 20, 2023 · 1 comment · Fixed by #6249

Comments

@kelloggm
Copy link
Contributor

The manual's section on writing stub files begins with "If you have access to the Java source code...". There is no parallel section for "if you do not have access to the Java source code", which, in my experience, is the most common reason to want to create a stub file. It looks like the parallel structure was removed in c60a5ef, because of a breaking change to the StubGenerator. However, the StubGenerator is not necessary to create a useful stub for a library for which you don't have the source code.

My usual process is the following:

  • locate the Javadoc for the method that needs to be annotated
  • create a stub file containing only that class (in the appropriate package)
  • copy the method signature from the Javadoc
  • add the necessary annotations

This process is easy and lightweight. I propose adding a description of it to the manual to replace the lost parallel structure. @mernst, if that's okay with you, I'll open a PR.

(For context, I'm writing this because I sent an undergrad to the manual expecting them to find a nice writeup of the above process, and they came back to me frustrated after trying to write a stub file based on the "if you have access to the Java source file" section for an obscure, old part of the JDK.)

@mernst
Copy link
Member

mernst commented Oct 20, 2023

I definitely agree. Thanks in advance for fixing that.

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

Successfully merging a pull request may close this issue.

2 participants