Buggy code:
public class LoginCommand extends Command { private final Logger LOGGER = Logger . getLogger ( LoginCommand . class . getName ( ) ) ; private HashMap < String , String > details ; private Integer id ; private String username ; private String name ; private String email ; private String language ; private String country ; private String bio ; private String website ; private String link_color ; private String background_color ; private String session_id ; private Timestamp created_at ; private String avatar_url ; private Boolean overlay ; private Boolean protected_tweets ; @ Override public void execute ( ) { try { String sessionID = URLEncoder . encode ( new UID ( ) . toString ( ) , "UTF-8" ) ; dbConn = PostgresConnection . getDataSource ( ) . getConnection ( ) ; dbConn . setAutoCommit ( false ) ; proc = dbConn . prepareCall ( "{?<seq2seq4repair_space>=<seq2seq4repair_space>call<seq2seq4repair_space>get_password_info(?)}" ) ; proc . setPoolable ( true ) ; proc . registerOutParameter ( 1 , Types . VARCHAR ) ; proc . setString ( 2 , map . get ( "username" ) ) ; proc . execute ( ) ; String enc_password = proc . getString ( 1 ) ; if ( enc_password == null ) { CommandsHelp . handleError ( map . get ( "app" ) , map . get ( "method" ) , "Invalid<seq2seq4repair_space>username" , map . get ( "correlation_id" ) , LOGGER ) ; return ; } dbConn . commit ( ) ; proc . close ( ) ; boolean authenticated = BCrypt . checkpw ( map . get ( "password" ) , enc_password ) ; if ( authenticated ) { details = ( ( HashMap < String , String > ) ( Cache . returnUser ( map . get ( "username" ) ) ) ) ; User user = new User ( ) ; <START_BUG> if ( details . equals ( null ) ) { <END_BUG> proc = dbConn . prepareCall ( "{call<seq2seq4repair_space>login(?,?)}" ) ; proc . setPoolable ( true ) ; proc . registerOutParameter ( 1 , Types . OTHER ) ; proc . setString ( 1 , map . get ( "username" ) ) ; proc . setString ( 2 , sessionID ) ; proc . execute ( ) ; set = ( ( ResultSet ) ( proc . getObject ( 1 ) ) ) ; root . put ( "app" , map . get ( "app" ) ) ; root . put ( "method" , map . get ( "method" ) ) ; root . put ( "status" , "ok" ) ; root . put ( "code" , "200" ) ; root . put ( "session_id" , sessionID ) ; if ( set . next ( ) ) { id = set . getInt ( 1 ) ; username = set . getString ( 2 ) ; email = set . getString ( 3 ) ; name = set . getString ( 5 ) ; language = set . getString ( 6 ) ; country = set . getString ( 7 ) ; bio = set . getString ( 8 ) ; website = set . getString ( 9 ) ; created_at = set . getTimestamp ( 10 ) ; avatar_url = set . getString ( 11 ) ; overlay = set . getBoolean ( 12 ) ; link_color = set . getString ( 13 ) ; background_color = set . getString ( 14 ) ; protected_tweets = set . getBoolean ( 15 ) ; session_id = set . getString ( 16 ) ; user . setId ( id ) ; user . setUsername ( username ) ; user . setEmail ( email ) ; user . setName ( name ) ; user . setLanguage ( language ) ; user . setCountry ( country ) ; user . setBio ( bio ) ; user . setWebsite ( website ) ; user . setCreatedAt ( created_at ) ; user . setAvatarUrl ( avatar_url ) ; user . setOverlay ( overlay ) ; user . setLinkColor ( link_color ) ; user . setBackgroundColor ( background_color ) ; user . setProtectedTweets ( protected_tweets ) ; user . setSessionID ( session_id ) ; } Cache . cacheUser ( id . toString ( ) , username , email , name , language , country , bio , website , created_at . toString ( ) , avatar_url , overlay . toString ( ) , link_color , background_color , protected_tweets . toString ( ) , sessionID ) ; POJONode child = nf . POJONode ( user ) ; root . put ( "user" , child ) ; } else { root . put ( "app" , map . get ( "app" ) ) ; root . put ( "method" , map . get ( "method" ) ) ; root . put ( "status" , "ok" ) ; root . put ( "code" , "200" ) ; root . put ( "session_id" , sessionID ) ; user . setId ( Integer . parseInt ( details . get ( "id" ) ) ) ; user . setUsername ( details . get ( "username" ) ) ; user . setEmail ( details . get ( "email" ) ) ; user . setName ( details . get ( "name" ) ) ; user . setLanguage ( details . get ( "language" ) ) ; user . setCountry ( details . get ( "country" ) ) ; user . setBio ( details . get ( "bio" ) ) ; user . setWebsite ( details . get ( "website" ) ) ; user . setCreatedAt ( Timestamp . valueOf ( details . get ( "created_at" ) ) ) ; user . setAvatarUrl ( details . get ( "avatar_url" ) ) ; user . setOverlay ( Boolean . parseBoolean ( details . get ( "overlay" ) ) ) ; user . setLinkColor ( details . get ( "link_color" ) ) ; user . setBackgroundColor ( details . get ( "background_color" ) ) ;

Fix:
if ( ( details ) == null ) {