Skip to content

Commit

Permalink
Support package private methods on CGLIB proxies with AOT
Browse files Browse the repository at this point in the history
Closes gh-29582
Closes gh-29764
  • Loading branch information
sdeleuze committed Feb 24, 2023
1 parent 7ace9aa commit 6825a84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ void refreshForAotRegisterHintsForCglibProxy() {
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS))
.accepts(runtimeHints);
assertThat(RuntimeHintsPredicates.reflection().onType(CglibConfiguration.class)
.withMemberCategories(MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_METHODS))
.accepts(runtimeHints);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,6 +34,7 @@
* on the JDK and CGLIB proxy facilities and their core conventions.
*
* @author Juergen Hoeller
* @author Sebastien Deleuze
* @since 6.0.3
* @see org.springframework.aot.hint.ProxyHints
* @see org.springframework.aot.hint.ReflectionHints
Expand All @@ -46,7 +47,8 @@ public abstract class ClassHintUtils {
MemberCategory.DECLARED_FIELDS);

private static final Consumer<TypeHint.Builder> asProxiedUserClass = hint ->
hint.withMembers(MemberCategory.INVOKE_PUBLIC_METHODS);
hint.withMembers(MemberCategory.INVOKE_PUBLIC_METHODS,
MemberCategory.INVOKE_DECLARED_METHODS);


/**
Expand Down

0 comments on commit 6825a84

Please sign in to comment.