-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix deprecations in common module (#22209) #22210
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
Fix deprecations in common module (#22209) #22210
Conversation
ebf3a22 to
128729b
Compare
ahus1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. I agree the Liquibase parts can be improved by using less reflection.
The removal of the classes in keycloak-common should be done by first deprecating them, and later removing them in a future issue.
The change in Encode.java should not be a problem as we set -Dfile.encoding=UTF-8 in the JAVA_OPTS in kc.sh, still it would be good to mention it in the release notes as it could lead to a different encoding of URL parameters.
ae74284 to
3a7deb3
Compare
|
@ahus1 thanks for taking a look! I readded the removed classes and marked them for removal in KC27. I also added a brief note to the release notes. |
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.model.session.SessionTimeoutsTest#testOfflineUserClientMaxLifespanSmallerThanSessionKeycloak CI - Store Model Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreported flaky test detected, please review
ahus1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes. Please add the deprecated methods to changes-26_0_0.adoc so people will know that that they'll need to change something.
| * @throws InstantiationException | ||
| */ | ||
| public static <T> T newInstance(final Class<T> fromClass) throws ClassNotFoundException, IllegalAccessException, InstantiationException { | ||
| public static <T> T newInstance(final Class<T> fromClass) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Changing the signature of the method is also a breaking change at least when people want to compile their code. AFAIK this method is not used, so I'd suggest to either keep it as is for now, deprecate it for KC27 and eventually remove it.
| * @throws IllegalAccessException | ||
| * @throws InstantiationException | ||
| */ | ||
| public static <T> T newInstance(final Class<?> type, final String fullQualifiedName) throws ClassNotFoundException, IllegalAccessException, InstantiationException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick - as above, I suggest deprecation and removal.
ahus1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. I pushed one more commit as the updated class in common still contained additional exceptions in its signature.
Thinking again about the docs, also decided to move all the docs changes to the upgrading guide as only those upgrading might be interested in them. The release notes usually only contain the highlights.
- Use charset in `Encode` class - Replace reflective call to protected `Liquibase#resetServices()` with call to exposed public method on a custom subclass `KeycloakLiquibase` - Remove usage of deprecated AccessController class in Reflections - Remove unused SetAccessibleProvilegedAction and UnsetAccessibleProvilegedAction Fixes keycloak#22209 Signed-off-by: Thomas Darimont <[email protected]>
Avoid usage of interfaces used by deprecated AccessController infrastructure. Signed-off-by: Thomas Darimont <[email protected]>
…L encoding Signed-off-by: Thomas Darimont <[email protected]>
- Added keycloak-common deprecations to changes-26 document - Avoid breaking API changes Signed-off-by: Thomas Darimont <[email protected]>
Closes keycloak#22209 Signed-off-by: Alexander Schwartz <[email protected]>
eb5c41b to
64099e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.admin.AdminConsoleWhoAmILocaleTest#testLocaleRealmI18nEnabledUserWithoutLocaleKeycloak CI - Store IT (mysql) |
EncodeclassLiquibase#resetServices()with call to exposed public method on a custom subclassKeycloakLiquibaseFixes #22209