You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2026/01/10 12:09:00 UTC

[jira] [Commented] (JCR-5154) Replace deprecated call of Class.newInstance()

    [ https://issues.apache.org/jira/browse/JCR-5154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18051001#comment-18051001 ] 

Julian Reschke commented on JCR-5154:
-------------------------------------

trunk: [165d8988b|https://github.com/apache/jackrabbit/commit/165d8988bdc105db55668e76af2ef0ed56a7b2c5]

> Replace deprecated call of Class.newInstance()
> ----------------------------------------------
>
>                 Key: JCR-5154
>                 URL: https://issues.apache.org/jira/browse/JCR-5154
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>            Priority: Trivial
>             Fix For: 2.24, 2.23.3
>
>
> Since Java 9 the method [Class.newInstance() is deprecated|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html#newInstance()]. Those methods should be replaced by 
> {code}
> clazz.getDeclaredConstructor().newInstance()
> {code}
> This query gives a rough overview of methods to replace: https://github.com/search?q=repo%3Aapache%2Fjackrabbit%20newInstance()&type=code (however there are some false positives in there).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)