Starting with Java 20, instantiating URLs via new URL is deprecated in favor of URI#toURL().

      While the project's codebase targets Java 11, we can address backwards-compatible deprecations still. The methods to use exist in Java 11 as well.

      The following occurrences are of concern: https://github.com/search?q=repo%3Ajenkinsci%2Fjenkins+%22new+URL%22+lang%3Ajava&type=code

      More information about the deprecation can be found in the javadocs and constructor deprecation.

          [JENKINS-72028] Address deprecated URL instantiation

          Alexander Brandes created issue -

          Achintha added a comment - - edited

          notmyfault I understand we can use the "uri.toURL()" on java 11. So the requirement is to use "uri.toURL()" over the "new URL()" in all the places you have mentioned in the code is it?

           

          Achintha added a comment - - edited notmyfault I understand we can use the " uri.toURL() " on java 11. So the requirement is to use " uri.toURL() " over the " new URL() " in all the places you have mentioned in the code is it?  
          Abhishek Maity made changes -
          Assignee New: Abhishek Maity [ abhishekmaity ]
          Abhishek Maity made changes -
          Attachment New: Screenshot 2023-09-20 005844.png [ 61161 ]
          Abhishek Maity made changes -
          Attachment Original: Screenshot 2023-09-20 005844.png [ 61161 ]
          Abhishek Maity made changes -
          Attachment New: Screenshot 2023-09-20 005844.png [ 61162 ]
          Abhishek Maity made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Abhishek Maity made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Abhishek Maity made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]
          Abhishek Maity made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Fixed but Unreleased [ 10203 ] New: Reopened [ 4 ]

            abhishekmaity Abhishek Maity
            notmyfault Alexander Brandes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: