commit | 052407b9e7ceeb82bf2ea2b0d4812b257ffe9087 | [log] [tgz] |
---|---|---|
author | Googler <shahan@google.com> | Tue Mar 07 03:53:44 2023 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Mar 07 03:55:05 2023 -0800 |
tree | a8128ffad4c5c0be6da7eda4c7a5ded7fcaee041 | |
parent | b6fc2d933ec76437129677d6e63eb1d435e379b6 [diff] |
Serialization Test fixes for JDK 21. ImmutableMapCodecTest - was using getCanonicalName to retrieve the name of an anonymous inner class and was getting null, as is the defined behavior for anonymous inner classes. Switching to getName fixes the test, which makes it consistent with production code anyway. MethodCodecTest - this seems like weird JDK21 behavior. Looking up methods returned by Class.getMethods against the declaring classes does not return the same method. In this case, in particular, String.class.getMethods includes java.lang.String.resolveConstantDesc(java.lang.invoke.MethodHandles$Lookup) throws java.lang.ReflectiveOperationException which is the method signature according to the ConstantDesc interface. Adding to the strangeness, calling getDeclaringClass returns String instead of ConstantDesc. However, looking up the method with String.class.getDeclaredMethod by name and parameters, results in java.lang.String.resolveConstantDesc(java.lang.invoke.MethodHandles$Lookup) which drops the ReflectiveOperationException. This is actually the proper signature for strings. This difference shouldn't really matter for serialization correctness as long as both Method objects are invokable. Changing the test to serialize the result of looking up via getDeclaredMethod instead of getMethods fixes it. PiperOrigin-RevId: 514686339 Change-Id: I1eecae589858fc9296fedee49f810d56720d6ab2
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md