Skip to content
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

Revert "Workaround for Style/RedundantBegin when using JRuby 9.2" #11922

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 5 additions & 11 deletions lib/rubocop/cop/lint/shadowed_exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,12 @@ def evaluate_exceptions(group)

if rescued_exceptions.any?
rescued_exceptions.each_with_object([]) do |exception, converted|
# FIXME: Workaround `rubocop:disable` comment for JRuby.
# https://github.com/jruby/jruby/issues/6642
# rubocop:disable Style/RedundantBegin
begin
RuboCop::Util.silence_warnings do
# Avoid printing deprecation warnings about constants
converted << Kernel.const_get(exception.source)
end
rescue NameError
converted << nil
RuboCop::Util.silence_warnings do
# Avoid printing deprecation warnings about constants
converted << Kernel.const_get(exception.source)
end
# rubocop:enable Style/RedundantBegin
rescue NameError
converted << nil
end
else
# treat an empty `rescue` as `rescue StandardError`
Expand Down