if (bug.getStatus() == null) { newBug.setStatus(Status.New); } else { newBug.setStatus( bug.getStatus() ); }
    protected Bug populateBug(Bug bug) {        BugManager bm = new BugManager();        ComponentManager cm = new ComponentManager();        PersonManager pm = new PersonManager();        Bug newBug;        if (bug.getId() == null) {            newBug = new Bug();            newBug.setOpenDate(new Date());        }        else {            newBug = bm.getBug((bug.getId()));        }        // Populate the fields from the bug on the form        newBug.setLongDescription( bug.getLongDescription() );        newBug.setPriority( bug.getPriority());        newBug.setShortDescription( bug.getShortDescription() );        newBug.setStatus( bug.getStatus() );        newBug.setDueDate( bug.getDueDate() );        newBug.setPercentComplete( bug.getPercentComplete() );        // Link in the full component and person based on their IDs        newBug.setComponent( cm.getComponent(bug.getComponent().getId()) );        newBug.setOwner( pm.getPerson(bug.getOwner().getId()) );        return newBug;    }