winne42 opened a new pull request #760:
URL: https://github.com/apache/activemq/pull/760


   Hi guys,
   
   I noticed some issues on lgtm.com and tried to fix them. Hope I didn't break 
anything.
   Main changes:
   
   - use try-with-resources, avoid leaking streams
   - use for-each
   - use diamond operator
   - replace anonymous class with lambda/method reference in some instances
   - catch Exception instead of Throwable
   - declare methods synchronized that inherit from synchronized methods
   - remove redundant null checks (OK, we can discuss this)
   - avoid some NPEs
   - remove unnecessary boxing/unboxing
   - remove unnecessary toString()
   - make private fields final if possible
   - fix invalid JavaDoc
   - remove unnecessary modifiers (e.g., private final, public on interface 
methods)
   - make constructors in abstract classes protected, not public
   - use recommended order of modifiers
   - use Collections.emptyList() instead of Collections.EMPTY_LIST
   - simplify some boolean expressions
   - combine nested ifs
   - use built-in string formatting of loggers instead of string concatenation
   - use Exception constructor with cause parameter instead of initCause()
   - use Java[] array syntax instead of C style
   - use StandardCharsets.UTF8 instead of "UTF8"
   - use .toArray() with empty instead of pre-sized array (recommended since 
late Java 6)
   
   Enjoy!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to