[Painless] Add a Map for java names to classes for use in the custom classloader#34424
[Painless] Add a Map for java names to classes for use in the custom classloader#34424jdconrad merged 4 commits intoelastic:masterfrom
Conversation
This fixes a bug that wasn't including the class used for a static import where only the static import is whitelisted.
|
Pinging @elastic/es-core-infra |
rjernst
left a comment
There was a problem hiding this comment.
With this change, that canonical map can contain different things than the Java class map right? Maybe they should be named to reflect that, or at least have very clear documentation about the difference (Java map being a superset).
| Class<?> existingClass = javaClassNamesToClasses.get(clazz.getName()); | ||
|
|
||
| if (existingClass == null) { | ||
| javaClassNamesToClasses.put(clazz.getName(), existingClass); |
There was a problem hiding this comment.
Why are you putting existingClass which is null, shouldn't it be clazz?
|
This whole thing needs docs. It's actually on my list to do for both this class and the PainlessLookup class. If it's all right I would like to do that as one PR together instead of just adding a couple bits here. |
|
Can you at least add a single line // comment indicating one is a superset? And also a test would be good |
|
You could also add a check in the lookup constructor ensuring the superset precondition |
|
It's not a superset. Will add a comment. |
|
Comments added. |
|
Point noted: I was thinking of the names, the values are a superset. |
|
@rjernst Thanks for the review! |
…classloader (#34424) This fixes a bug that wasn't including the class used for a static import where only the static import is whitelisted.
* elastic/master: Mute PartitionedRoutingIT#testShrinking on Windows Mute testToQuery test [TEST] Make sure there are shards started so that `ESIntegTestCase#assertSameDocIdsOnShards()` does not fail with shard not found. Change shard changes api's threadpool from get to search (elastic#34421) Update TESTING.asciidoc title (elastic#34401) Tests: Fix DateFormatter equals tests with locale (elastic#34435) Docs: Remove unnecessary qualifier from wildcard import note (elastic#34419) CCR/TEST: AwaitsFix testFailOverOnFollower [Painless] Add a Map for java names to classes for use in the custom classloader (elastic#34424) TEST: Fix indentation in FullClusterRestartIT (elastic#34420) [WIP] Ingest Attachement: Upgrade tika to v1.19.1 (elastic#33896) NETWORKING: Upgrade Netty to 4.1.30 (elastic#34417) Allow an AuthenticationResult to return metadata (elastic#34382) [ML] Add an ingest pipeline definition to structure finder (elastic#34350) Handle pre-6.x time fields (elastic#34373) ListenableFuture should preserve ThreadContext (elastic#34394)
…classloader (#34424) This fixes a bug that wasn't including the class used for a static import where only the static import is whitelisted.
This fixes a bug that wasn't including the class used for a static import where only the static import is whitelisted. This affects extensions that use classes that are not part of the core.