1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/AttachmentMarshallerImpl.java Thu Apr 04 19:05:24 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/AttachmentMarshallerImpl.java Tue Apr 09 14:51:13 2013 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -25,9 +25,9 @@ 1.11 1.12 package com.sun.xml.internal.ws.message.jaxb; 1.13 1.14 +import com.sun.istack.internal.logging.Logger; 1.15 import com.sun.xml.internal.ws.api.message.Attachment; 1.16 import com.sun.xml.internal.ws.api.message.AttachmentSet; 1.17 -import com.sun.xml.internal.ws.message.AttachmentSetImpl; 1.18 import com.sun.xml.internal.ws.message.DataHandlerAttachment; 1.19 1.20 import javax.activation.DataHandler; 1.21 @@ -39,6 +39,7 @@ 1.22 import java.net.URISyntaxException; 1.23 import java.net.URLEncoder; 1.24 import java.util.UUID; 1.25 +import java.util.logging.Level; 1.26 1.27 /** 1.28 * Implementation of {@link AttachmentMarshaller}, its used from JAXBMessage to marshall swaref type 1.29 @@ -47,6 +48,9 @@ 1.30 * @see JAXBMessage 1.31 */ 1.32 final class AttachmentMarshallerImpl extends AttachmentMarshaller { 1.33 + 1.34 + private static final Logger LOGGER = Logger.getLogger(AttachmentMarshallerImpl.class); 1.35 + 1.36 private AttachmentSet attachments; 1.37 1.38 public AttachmentMarshallerImpl(AttachmentSet attachemnts) { 1.39 @@ -60,16 +64,19 @@ 1.40 attachments = null; 1.41 } 1.42 1.43 + @Override 1.44 public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) { 1.45 // We don't use JAXB for handling XOP 1.46 throw new IllegalStateException(); 1.47 } 1.48 1.49 + @Override 1.50 public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) { 1.51 // We don't use JAXB for handling XOP 1.52 throw new IllegalStateException(); 1.53 } 1.54 1.55 + @Override 1.56 public String addSwaRefAttachment(DataHandler data) { 1.57 String cid = encodeCid(null); 1.58 Attachment att = new DataHandlerAttachment(cid, data); 1.59 @@ -86,7 +93,9 @@ 1.60 URI uri = new URI(ns); 1.61 cid = uri.toURL().getHost(); 1.62 } catch (URISyntaxException e) { 1.63 - e.printStackTrace(); 1.64 + if (LOGGER.isLoggable(Level.INFO)) { 1.65 + LOGGER.log(Level.INFO, null, e); 1.66 + } 1.67 return null; 1.68 } catch (MalformedURLException e) { 1.69 try {