public Resolution save() throws IOException {
BugManager bm = new BugManager();
Bug bug = getBug();
if (this.newAttachment != null) {
Attachment attachment = new Attachment();
attachment.setName(this.newAttachment.getFileName());
attachment.setSize(this.newAttachment.getSize());
attachment.setContentType(this.newAttachment.getContentType());
byte[] data = new byte[(int) this.newAttachment.getSize()];
InputStream in = this.newAttachment.getInputStream();
in.read(data);
attachment.setData(data);
bug.addAttachment(attachment);
}
// Set the open date for new bugs
if (bug.getOpenDate() == null)