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 -
          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 ]
          Abhishek Maity made changes -
          Status Original: Reopened [ 4 ] New: Open [ 1 ]
          Abhishek Maity made changes -
          Comment [ Hi, I have accepted this task and wish to PR {-}for upcoming hacktoberfest{-}. I am new and seek guidance/help in completing this task. I am facing issue at [core/src/main/java/hudson/Main.java|https://github.com/jenkinsci/jenkins/blob/c5fbbbe88dc280d0a0876614c0f9aa6fba2ea2af/core/src/main/java/hudson/Main.java#L119] → {color:#ff0000}'URI(java.lang.String, java.lang.String)' is not public in 'java.net.URI'. Cannot be accessed from outside package{color} How to fix and proceed?

          !Screenshot 2023-09-20 005844.png|thumbnail!  
          [~notmyfault], do I need to update only at the places you have mentioned in the code snippet ? ]

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

              Created:
              Updated:
              Resolved: