Java code quality notes from the trenches.

Overview

Whether you are a newbie or an old hat Java programmer, you can save yourself some embarrassment by avoiding the below most common programming errors.

  1. Not serializing objects (and nested objects within) that are stored in HttpSession.
    • See Effective Java Second Edition (EJ2), Item 74
  2. Throwing generic exception instead of application specific exception.
    • See EJ2, Item 61
  3. Ignoring or swallowing a thrown Exception while re-throwing.
    • See EJ2, Item 63, 65
  4. Not overriding hashcode() when equals() is overridden.
    • See EJ2, Item 9
  5. Mutating static member via an instance member.
    • See EJ2, Item 15 and Item 66

Epilogue

All of these will be caught by any good code quality scanner. Please use one.

The big short of utility tools.

What ?

I have written many utility tools for my side projects and they are all scattered across my multiple personal machines. This repo collects most of them that I think would be useful for me in future.

How ?

I have created a living repository in github called devops-tools (https://github.com/AskDrCatcher/devops-tools). This repo contains all the current and future scripts that I might reuse again. Note that it may or may not be useful for others but enough time is spent on making the scripts simple and easy to read and modify. Some scripts are written in javascript, some are in perl and some might be written in Java - no, just kiddin’.

Why ?

To scratch an itch

License

All scripts in this folder are of Apache 2 License.