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

Updates documentation on gh-pages website (WIP) #1788

Draft
wants to merge 52 commits into
base: gh-pages
Choose a base branch
from

Conversation

manoelcampos
Copy link

@manoelcampos manoelcampos commented Mar 20, 2025

Hello, I'm re-reading Byte Buddy's documentation and found some issues I can fix.
This PR is WIP and I let you know when I'm done.
I'm sending it in advance in order to discuss some issues I've found.
You can check the live changes at https://manoelcampos.github.io/byte-buddy/

Some issues to discuss

JDK version on GitHub Workflow

If you take a look at https://manoelcampos.github.io/byte-buddy/#/develop, it currently states that:

The GitHub Action is configured to compile and test the project for the Open JDK versions 6 and 7 and the Oracle JDK versions 7 and 8.

This information is not accurate, since there are tests for the Oracle JDK 8, 11, 17, 21 (hotspot-supported version).
But there are tests for JDK 6 and 7 (hotspot-legacy). In fact, this workflow provides lots of tests for different JDK distributions and versions. Maybe, the documentation would just state that:

The GitHub Action is configured to compile and test the project for different versions of Open JDK and the Oracle JDK.

  • The sentence was changed to: "The GitHub Action is configured to compile and test the project for different versions of OpenJDK, Oracle JDK and other distributions, starting from JDK 6 up to the latest release (despite deprecated JDK releases are not supported anymore)."

Minimum JDK version required

The welcome page at https://manoelcampos.github.io/byte-buddy/ says that:

Byte Buddy is written in Java 5

Contradictorily, https://manoelcampos.github.io/byte-buddy/#/develop, states:

All this implies that you need to write Java code that is compatible to a Java 6 compiler.

  • Indicates that Byte Buddy is a Java 6 library, since the minimum JDK version on the workflow is JDK 6.

Develop page

  • I'm not sure what you meant here: "All code is to be documented what makes this property easier to validate by automatic checks"

  • Is the following sentence still true?

Java 9 support is currently still experimental."

The CI workflow shows that Java 9 is unsupported. But I'm not sure if that is because this JDK version is deprecated or if the support was not complete.

  • Is the following sentence still true?

As of Java 8, Byte Buddy not currently support the following functionality.

Tutorial page

The link about inflation mechanism used for reflection is broken.
The only reference I could find was this one.

However, this inflation mechanism seems to be dropped in JDK 18, being replaced by method handles (I'm not sure about that). This way, I think the sentence below needs to be rewritten:

However, modern JVMs know a concept called inflation where the JNI-based method invocation is replaced by generated byte code that is injected into a dynamically created class.

  • I updated the entire paragraph including information about JDK releases before and after 18.

  • It's not clear what you mean by "Benchmark (2a)" and other references. There are no such references on the table.

  • The sentence "Also, if example.Bar extended example.Foo, any overridden package-private methods would become inoperative but would delegate to the original implementations." is confusing.

  • Is the following sentence still true? "Furthermore, Byte Buddy currently only takes loaded classes as its argument, this will change in future versions where the existing API can be used to equally work with unloaded classes."

  • At "From the above example, it is obvious that the super method is called by injecting some instance of a Callable into the LoggerInterceptor which invokes the original, non-overridden implementation of MemoryDatabase#load(String) from its call method. This helper class is called an AuxiliaryType within Byte Buddy's terminology", it's not clear which AuxiliaryType is that. Is it a class that ByteBuddy creates that implements Callable?

@manoelcampos manoelcampos marked this pull request as draft March 20, 2025 22:03
@manoelcampos manoelcampos changed the title Updates documentation (WIP) Updates documentation on gh-pages website(WIP) Mar 20, 2025
@manoelcampos manoelcampos changed the title Updates documentation on gh-pages website(WIP) Updates documentation on gh-pages website (WIP) Mar 20, 2025
Fix coherence of sentence about gpg signing.
Uses a `<ul>` tag to make it clear which are the modules.

Signed-off-by: Manoel Campos <[email protected]>
@raphw
Copy link
Owner

raphw commented Mar 21, 2025

That is right, the reflection implementation was dropped when it was retrofitted to use method handles. This also to avoid JNI and its limitations to virtual threads.

@raphw
Copy link
Owner

raphw commented Mar 21, 2025

This is a great effort if you want to update the documentation. I did not find time to work on it in a long time, and it is rather outdated. It would really need some attention.

@manoelcampos manoelcampos force-pushed the gh-pages-patch branch 2 times, most recently from 16115f9 to 1b2ab9c Compare March 21, 2025 21:29
@manoelcampos
Copy link
Author

Hey @raphw
I'm updating the tutorial page (the last one), but it will take some time. I hope I finish this week.
I updated the comments above and added some checkboxes to track the progress.
I'd need your help on those unchecked ones.

@manoelcampos manoelcampos force-pushed the gh-pages-patch branch 2 times, most recently from ce23d62 to 48ff436 Compare March 25, 2025 00:56
Fix module name from "byte-buddy-dev" to "byte-buddy-dep"

Signed-off-by: Manoel Campos <[email protected]>
Sentences such as "The implementation of implementation context"
is confusing. Uses the interface name instead.

Signed-off-by: Manoel Campos <[email protected]>
Inverts order of types according the order they were mentioned in the sentence for clarity.

Signed-off-by: Manoel Campos <[email protected]>
- Rephrases sentence for clarity
- Punctuation and simplification.

Signed-off-by: Manoel Campos <[email protected]>
Adds current version from maven central badge.

Signed-off-by: Manoel Campos <[email protected]>
Indicates that Byte Buddy is a Java 6 library,
since the minimum JDK version on the CI workflow is JDK 6.

Signed-off-by: Manoel Campos <[email protected]>
(no redirection and it's shorter)

Signed-off-by: Manoel Campos <[email protected]>
Fix Mockito and Bazel website domains

Signed-off-by: Manoel Campos <[email protected]>
The link the Duke's Chice award nomination is broken
and could not be found by searching on the oracle website.
The page was recovery from the Web Archive Website.

Signed-off-by: Manoel Campos <[email protected]>
- Fix grammar and punctuation
- Removes repetitive "This way"
- Removes duplicated "is" on tutorial.partial.html
- Simplifies sentence.

Signed-off-by: Manoel Campos <[email protected]>
There is no `ClassLoadingStrategy.withProtectionDomain`.
The method is just `with`

Signed-off-by: Manoel Campos <[email protected]>
…al.partial.html

Since class's class file is confusing

Signed-off-by: Manoel Campos <[email protected]>
…al.html

If the user is using JDK 8+, the code can be simplified with a lambda expression.

Signed-off-by: Manoel Campos <[email protected]>
That include the minimum required Java version and some links
that are used in different places.

Signed-off-by: Manoel Campos <[email protected]>
…ll()` on tutorial.partial.html

since the former doesn't exist anymore.

Signed-off-by: Manoel Campos <[email protected]>
Shows how to try the `ToStringAgent` adding a main method that calls the premain.

Signed-off-by: Manoel Campos <[email protected]>
- Fix typo
- Simplifies sentences

Signed-off-by: Manoel Campos <[email protected]>
…classes on tutorial.partial.html

Signed-off-by: Manoel Campos <[email protected]>
since the former doesn't exist anymore.
Simplifies sentence removing redundancy.

Signed-off-by: Manoel Campos <[email protected]>
since the former doesn't exist anymore

Signed-off-by: Manoel Campos <[email protected]>
since the former doesn't exist anymore

Signed-off-by: Manoel Campos <[email protected]>
@manoelcampos manoelcampos force-pushed the gh-pages-patch branch 2 times, most recently from 60fed7a to a3fcc85 Compare March 27, 2025 18:43
…tic on tutorial.partial.html

Signed-off-by: Manoel Campos <[email protected]>
with the same name that causes confusion (mainly when imported via IDE).

Signed-off-by: Manoel Campos <[email protected]>
…`@Origin` on tutorial.partial.html

That makes a clear separation between the explanation of different types.

Signed-off-by: Manoel Campos <[email protected]>
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 this pull request may close these issues.

2 participants