src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java

Print this page
rev 447 : 8029237: Update copyright year to match last edit in jdk8 jaxws repository (2013)
Summary: Fixing Copyrights for year 2013
Reviewed-by: chegar
rev 472 : 8036030: Update JAX-WS RI integration to latest version

*** 1,7 **** /* ! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 191,207 **** if (is instanceof SharedInputStream) { SharedInputStream sis = (SharedInputStream) is; contentStream = sis.newStream(sis.getPosition(), -1); } else { try { ! ByteOutputStream bos = new ByteOutputStream(); bos.write(is); content = bos.getBytes(); contentLength = bos.getCount(); } catch (IOException ioex) { throw new MessagingException("Error reading input stream", ioex); } } } --- 191,211 ---- if (is instanceof SharedInputStream) { SharedInputStream sis = (SharedInputStream) is; contentStream = sis.newStream(sis.getPosition(), -1); } else { + ByteOutputStream bos = null; try { ! bos = new ByteOutputStream(); bos.write(is); content = bos.getBytes(); contentLength = bos.getCount(); } catch (IOException ioex) { throw new MessagingException("Error reading input stream", ioex); + } finally { + if (bos != null) + bos.close(); } } }
*** 1073,1084 **** * In both cases this method is typically called by the * <code>Message.saveChanges</code> method. */ protected void updateHeaders() throws MessagingException { DataHandler dh = getDataHandler(); ! if (dh == null) // Huh ? ! return; try { String type = dh.getContentType(); boolean composite = false; boolean needCTHeader = getHeader("Content-Type") == null; --- 1077,1092 ---- * In both cases this method is typically called by the * <code>Message.saveChanges</code> method. */ protected void updateHeaders() throws MessagingException { DataHandler dh = getDataHandler(); ! /* ! * Code flow indicates null is never returned from ! * getdataHandler() - findbugs ! */ ! //if (dh == null) // Huh ? ! // return; try { String type = dh.getContentType(); boolean composite = false; boolean needCTHeader = getHeader("Content-Type") == null;