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

Resolve a few warnings about uninitialized variables. #564

Merged
merged 1 commit into from
Aug 22, 2018

Conversation

dacto
Copy link
Contributor

@dacto dacto commented Aug 22, 2018

consumer_work_pool.rb

  • During initialize, work pool is not running; set @running to false.

cruby/ssl_socket.rb, jruby/ssl_socket.rb

  • Add initialize method to init @bunny_socket_eof_flag to false while
    still passing args, if any, to superclass

reader_loop.rb

  • Initialize flags used in the loop to sensible values given that:
    Not stopping or stopped (since we havent started), and don't know if
    network is down, yet.

session.rb

  • Move initialization of variables referenced by to_s before the call to
    init_default_logger, which calls to_s.
  • Initialize @transport, @heartbeat_sender, and @last_connection_error before
    they are referenced.
  • Removed code referencing @socket_configurator.
    The commit that added it: aa2642c
    The commit that removed setting it: 7a1b557
    The library doesn't sets it anywhere via instance_variable_set but users
    might've set it this way instead of using configure_socket..

transport.rb

  • Initialize @socket before it is referenced.

fixes #563

consumer_work_pool.rb
  * During initialize, work pool is not running; set @running to false.

cruby/ssl_socket.rb, jruby/ssl_socket.rb
  * Add initialize method to init @__bunny_socket_eof_flag__ to false while
    still passing args, if any, to superclass

reader_loop.rb
  * Initialize flags used in the loop to sensible values given that:
      Not stopping or stopped (since we havent started), and don't know if
      network is down, yet.

session.rb
  * Move initialization of variables referenced by to_s before the call to
    init_default_logger, which calls to_s.
  * Initialize @transport, @heartbeat_sender, and @last_connection_error before
    they are referenced.
  * Removed code referencing @socket_configurator.
    The commit that added it: aa2642c
    The commit that removed setting it: 7a1b557
    The library doesn't sets it anywhere via instance_variable_set but users
    might've set it this way instead of using configure_socket..

transport.rb
  * Initialize @socket before it is referenced.

fixes ruby-amqp#563
@michaelklishin michaelklishin merged commit f3c18b0 into ruby-amqp:master Aug 22, 2018
@michaelklishin
Copy link
Member

Thank you!

@michaelklishin michaelklishin mentioned this pull request Sep 3, 2018
michaelklishin added a commit that referenced this pull request Aug 1, 2019
Not very elegant but neither are Kernel#defined? checks
or warnings.

Closes #581.
References #564.
michaelklishin added a commit that referenced this pull request Oct 18, 2019
Not very elegant but neither are Kernel#defined? checks
or warnings.

Closes #581.
References #564.

(cherry picked from commit 5ac7b2a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warnings
2 participants