Buggy code:
public class ActionExposeRemove extends AbstractAction implements Action { public ActionExposeRemove ( Map < String , Action > actions ) { } @ Override public String getURI ( ) { } @ Override public void execute ( HttpServletRequest req , HttpServletResponse resp ) throws ImmopolyException { PersistenceManager pm = PMF . get ( ) . getPersistenceManager ( ) ; try { String token = req . getParameter ( TOKEN ) ; String exposeId = req . getParameter ( EXPOSE ) ; if ( ( null == token ) || ( ( token . length ( ) ) == 0 ) ) throw new ImmopolyException ( ImmopolyException . MISSING_PARAMETER_USERNAME , "missing<seq2seq4repair_space>token" ) ; User user = DBManager . getUserByToken ( pm , token ) ; if ( null == user ) throw new ImmopolyException ( ImmopolyException . TOKEN_NOT_FOUND , ( "token<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>" + token ) ) ; History history = null ; Expose expose = DBManager . getExpose ( pm , exposeId ) ; if ( null != expose ) { if ( ( expose . getUserId ( ) ) == ( user . getId ( ) ) ) { URL url = new URL ( ( ( ( ( ( OAuthData . SERVER ) + ( OAuthData . SEARCH_PREFIX ) ) + "expose//" ) + exposeId ) + ".json" ) ) ; JSONObject obj = WebHelper . getHttpData ( url ) ; if ( obj . has ( "expose.expose" ) ) { double fine = ( Const . FINE_REMOVED ) * ( expose . getRent ( ) ) ; <START_BUG> history = new History ( History . TYPE_EXPOSE_REMOVED , user . getId ( ) , System . currentTimeMillis ( ) , ( ( ( ( ( "Du<seq2seq4repair_space>hast<seq2seq4repair_space>die<seq2seq4repair_space>Wohnung<seq2seq4repair_space>'" + ( expose . getName ( ) ) ) + "'<seq2seq4repair_space>für<seq2seq4repair_space>" ) + ( MONEYFORMAT . format ( expose . getRent ( ) ) ) ) + "<seq2seq4repair_space>im<seq2seq4repair_space>Monat<seq2seq4repair_space>zurückgegeben.<seq2seq4repair_space>Strafe:<seq2seq4repair_space>" ) + ( MONEYFORMAT . format ( fine ) ) ) , fine , expose . getExposeId ( ) ) ; <END_BUG> pm . deletePersistent ( expose ) ; user . setBalance ( ( ( user . getBalance ( ) ) - fine ) ) ; user . addExpose ( ( - 1 ) ) ; pm . makePersistent ( user ) ; pm . makePersistent ( history ) ; } else if ( obj . toString ( ) . contains ( "ERROR_RESOURCE_NOT_FOUND" ) ) { throw new ImmopolyException ( ImmopolyException . EXPOSE_NOT_FOUND , "expose<seq2seq4repair_space>jibs<seq2seq4repair_space>nich<seq2seq4repair_space>mehr,<seq2seq4repair_space>eventuell<seq2seq4repair_space>heute<seq2seq4repair_space>schon<seq2seq4repair_space>vermietet" ) ; } } else { throw new ImmopolyException ( ImmopolyException . EXPOSE_NOT_OWNED , "gehört<seq2seq4repair_space>nem<seq2seq4repair_space>anderen<seq2seq4repair_space>penner" ) ; } } else { throw new ImmopolyException ( ImmopolyException . EXPOSE_NOT_FOUND , "expose<seq2seq4repair_space>jehört<seq2seq4repair_space>dir<seq2seq4repair_space>nich" ) ; } resp . getOutputStream ( ) . write ( history . toJSON ( ) . toString ( ) . getBytes ( "UTF-8" ) ) ; } catch ( ImmopolyException e ) { throw e ; } catch ( Exception e ) { throw new ImmopolyException ( ImmopolyException . EXPOSE_REMOVE_FAILED , ( "could<seq2seq4repair_space>not<seq2seq4repair_space>add<seq2seq4repair_space>expose<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) , e ) ; } finally { pm . close ( ) ; } } }

Fix:
history = new History ( History . TYPE_EXPOSE_REMOVED , user . getId ( ) , System . currentTimeMillis ( ) , ( ( ( ( ( "Du<seq2seq4repair_space>hast<seq2seq4repair_space>die<seq2seq4repair_space>Wohnung<seq2seq4repair_space>'" + ( expose . getName ( ) ) ) + "'<seq2seq4repair_space>für<seq2seq4repair_space>" ) + ( MONEYFORMAT . format ( expose . getRent ( ) ) ) ) + "<seq2seq4repair_space>im<seq2seq4repair_space>Monat<seq2seq4repair_space>zurückgegeben.<seq2seq4repair_space>Strafe:<seq2seq4repair_space>" ) + ( MONEYFORMAT . format ( fine ) ) ) , ( - fine ) , expose . getExposeId ( ) ) ;