src/share/jaxws_classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
child 1407
730acb5d508e
equal deleted inserted replaced
366:8c0b6bccfe47 368:0989ad8c0860
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
23 * questions. 23 * questions.
24 */ 24 */
25 25
26 package com.sun.xml.internal.ws.util.exception; 26 package com.sun.xml.internal.ws.util.exception;
27 27
28 import com.sun.xml.internal.ws.util.localization.*; 28 import com.sun.istack.internal.localization.Localizable;
29 29 import com.sun.istack.internal.localization.LocalizableMessage;
30 import javax.xml.ws.WebServiceException; 30 import com.sun.istack.internal.localization.LocalizableMessageFactory;
31 import com.sun.istack.internal.localization.Localizer;
32 import com.sun.istack.internal.localization.NullLocalizable;
31 import java.io.IOException; 33 import java.io.IOException;
32 import java.io.ObjectInputStream; 34 import java.io.ObjectInputStream;
33 import java.io.ObjectOutputStream; 35 import java.io.ObjectOutputStream;
34 import java.io.Serializable; 36 import java.io.Serializable;
37 import javax.xml.ws.WebServiceException;
35 38
36 /** 39 /**
37 * Represents a {@link WebServiceException} with 40 * Represents a {@link WebServiceException} with
38 * localizable message. 41 * localizable message.
39 * 42 *
51 * @deprecated 54 * @deprecated
52 * Should use the localizable constructor instead. 55 * Should use the localizable constructor instead.
53 */ 56 */
54 protected JAXWSExceptionBase(String key, Object... args) { 57 protected JAXWSExceptionBase(String key, Object... args) {
55 super(findNestedException(args)); 58 super(findNestedException(args));
56 this.msg = new LocalizableImpl(key,fixNull(args),getDefaultResourceBundleName()); 59 this.msg = new LocalizableMessage(getDefaultResourceBundleName(), key, args);
57 } 60 }
58 61
59 62
60 protected JAXWSExceptionBase(String message) { 63 protected JAXWSExceptionBase(String message) {
61 this(new NullLocalizable(message)); 64 this(new NullLocalizable(message));
62 }
63
64 private static Object[] fixNull(Object[] x) {
65 if(x==null) return new Object[0];
66 else return x;
67 } 65 }
68 66
69 /** 67 /**
70 * Creates a new exception that wraps the specified exception. 68 * Creates a new exception that wraps the specified exception.
71 */ 69 */

mercurial