Add "since" to bare Deprecated annotations#9027
Merged
headius merged 1 commit intojruby:masterfrom Oct 10, 2025
Merged
Conversation
9e03a8a to
8b872e8
Compare
The "since" attributes added here reflect the first release after
each deprecation was added. We will use this to remove oldest
deprecations (by some measure of oldest) in an upcoming release.
The Ruby script used to make this change is provided here:
```ruby
Dir[ARGV[0] + "/**/*.java"].each do |file|
file_lines = File.readlines(file)
file_lines.each_with_index do |line, i|
line.gsub!(/@deprecated\S*$/) do
sha = `git blame -L #{i+1},#{i+1} #{file}`.split(" ")[0]
tag = `git describe --abbrev=0 --tags --contains #{sha}`.split("~")[0]
"@deprecated(since = \"#{tag}\")"
end
end
File.write(file, file_lines.join(''))
puts "process #{file}"
end
```
There may be places where sources moved or the deprecation line
does not reflect the true earliest version, but worst case the
deprecations stick around a little longer, or require manual
investigation.
Several tags have been manually updated to the next logical one:
* jruby-openssl-* tags have been updated to the nearest JRuby
release tag.
* All preview and RC tags have been updated to their associated
non-prerelease versions.
* One bogus tag "list" was removed from the repo and all "since"
lines updated to point at the nearest JRuby release tag.
* The "10.0" deprecations have been updated to "10.0.0.0" so they
point at a full, valid tag and release version.
* The "9.4" deprecations added to methods that *should have* been
deprecated in 9.4.x were modified to "10.0.0.0" because that is
the first release in which they were *actually* deprecated.
8b872e8 to
a5bd586
Compare
Member
Author
|
I made a few manual changes after the initial push of the automated version:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "since" attributes added here reflect the first release after each deprecation was added. We will use this to remove oldest deprecations (by some measure of oldest) in an upcoming release.
The Ruby script used to make this change is provided here:
There may be places where sources moved or the deprecation line does not reflect the true earliest version, but worst case the deprecations stick around a little longer, or require manual investigation.