|
1 /* |
|
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
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 |
|
7 * published by the Free Software Foundation. |
|
8 * |
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
|
13 * accompanied this code). |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License version |
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 * |
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 * or visit www.oracle.com if you need additional information or have any |
|
21 * questions. |
|
22 */ |
|
23 |
|
24 /* |
|
25 * @test |
|
26 * @bug 6857903 |
|
27 * @summary The initCause() incorrectly initialize the cause in |
|
28 * SAXException class when used with SAXException(String) |
|
29 * constructor. |
|
30 * @run testng/othervm sax.SAXExceptionInitCause |
|
31 * @author aleksej.efimov@oracle.com |
|
32 */ |
|
33 |
|
34 package sax; |
|
35 |
|
36 import java.io.ByteArrayInputStream; |
|
37 import java.io.ByteArrayOutputStream; |
|
38 import java.io.IOException; |
|
39 import java.io.InvalidClassException; |
|
40 import java.io.ObjectInputStream; |
|
41 import java.io.ObjectOutputStream; |
|
42 |
|
43 import org.testng.Assert; |
|
44 import org.testng.annotations.Test; |
|
45 import org.xml.sax.SAXException; |
|
46 |
|
47 public class SAXExceptionInitCause { |
|
48 |
|
49 @Test |
|
50 public void testOwnSerializationNoCause() throws Exception { |
|
51 SAXException noCauseException = new SAXException(SAX_MESSAGE); |
|
52 SAXException deserializedException; |
|
53 byte[] serialSAX; |
|
54 |
|
55 serialSAX = pickleException(noCauseException); |
|
56 deserializedException = unpickleException(serialSAX); |
|
57 |
|
58 Assert.assertNull(deserializedException.getCause()); |
|
59 Assert.assertEquals(deserializedException.getMessage(), SAX_MESSAGE); |
|
60 } |
|
61 |
|
62 @Test |
|
63 public void testSerializationWithCause() throws Exception { |
|
64 SAXException withCauseException = new SAXException(SAX_MESSAGE); |
|
65 withCauseException.initCause(new Exception(SAX_CAUSE_MESSAGE)); |
|
66 SAXException deserializedException; |
|
67 byte[] serialSAX; |
|
68 |
|
69 serialSAX = pickleException(withCauseException); |
|
70 deserializedException = unpickleException(serialSAX); |
|
71 |
|
72 Assert.assertNotNull(deserializedException.getCause()); |
|
73 Assert.assertEquals(deserializedException.getMessage(), SAX_MESSAGE); |
|
74 Assert.assertEquals(deserializedException.getCause().getMessage(), SAX_CAUSE_MESSAGE); |
|
75 } |
|
76 |
|
77 @Test |
|
78 public void testCauseInitByCtor() throws Exception { |
|
79 // Check that constructor properly initializes cause |
|
80 Exception cause = new Exception(SAX_CAUSE_MESSAGE); |
|
81 SAXException exception = new SAXException(cause); |
|
82 Assert.assertSame(exception.getCause(), cause); |
|
83 Assert.assertSame(exception.getException(), cause); |
|
84 } |
|
85 |
|
86 @Test |
|
87 public void testCauseInitWithException() { |
|
88 // Check that initCause properly initializes cause |
|
89 SAXException exception = new SAXException(); |
|
90 Exception cause = new Exception(SAX_CAUSE_MESSAGE); |
|
91 exception.initCause(cause); |
|
92 Assert.assertSame(exception.getCause(), cause); |
|
93 Assert.assertSame(exception.getException(), cause); |
|
94 } |
|
95 |
|
96 @Test |
|
97 public void testCauseInitWithThrowable() { |
|
98 // Check that if cause is initialized with Throwable instead of Exception |
|
99 // then getException returns 'null' |
|
100 SAXException exception = new SAXException(); |
|
101 Throwable cause = new Throwable(SAX_CAUSE_MESSAGE); |
|
102 exception.initCause(cause); |
|
103 Assert.assertSame(exception.getCause(),cause); |
|
104 Assert.assertNull(exception.getException()); |
|
105 } |
|
106 |
|
107 @Test(expectedExceptions = IllegalStateException.class) |
|
108 public void testInitCauseTwice() { |
|
109 SAXException exception = new SAXException(new Exception(SAX_CAUSE_MESSAGE)); |
|
110 // Expecting IllegalStateException at this point |
|
111 exception.initCause(new Exception(SAX_CAUSE_MESSAGE)); |
|
112 } |
|
113 |
|
114 @Test |
|
115 public void testLegacySerialCtor() throws Exception { |
|
116 SAXException saxException8 = unpickleException(JDK8_SET_WITH_CTOR_ONLY); |
|
117 Assert.assertNotNull(saxException8.getCause()); |
|
118 Assert.assertNotNull(saxException8.getException()); |
|
119 } |
|
120 |
|
121 @Test |
|
122 public void testLegacySerialCtorAndInit() throws Exception { |
|
123 SAXException saxException8 = unpickleException(JDK8_SET_WITH_CTOR_AND_INIT); |
|
124 Assert.assertNotNull(saxException8.getCause()); |
|
125 Assert.assertNotNull(saxException8.getException()); |
|
126 } |
|
127 |
|
128 @Test |
|
129 public void testLegacySerialInitCause() throws Exception { |
|
130 SAXException saxException8 = unpickleException(JDK8_WITH_INIT_ONLY); |
|
131 Assert.assertNotNull(saxException8.getCause()); |
|
132 Assert.assertNotNull(saxException8.getException()); |
|
133 } |
|
134 |
|
135 @Test |
|
136 public void testLegacySerialNothingSet() throws Exception { |
|
137 SAXException saxException8 = unpickleException(JDK8_NOTHING_SET); |
|
138 Assert.assertNull(saxException8.getCause()); |
|
139 Assert.assertNull(saxException8.getException()); |
|
140 } |
|
141 |
|
142 @Test(expectedExceptions = InvalidClassException.class) |
|
143 public void testReadObjectIllegalStateException() throws Exception { |
|
144 SAXException saxException8 = unpickleException(JDK8_CHECK_ILLEGAL_STATE_EXCEPTION); |
|
145 } |
|
146 |
|
147 // Serialize SAXException to byte array |
|
148 private static byte[] pickleException(SAXException saxException) throws IOException { |
|
149 ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
|
150 try (ObjectOutputStream saxExceptionOOS = new ObjectOutputStream(bos)) { |
|
151 saxExceptionOOS.writeObject(saxException); |
|
152 } |
|
153 return bos.toByteArray(); |
|
154 } |
|
155 |
|
156 //Deserialize SAXException with byte array as serial data source |
|
157 private static SAXException unpickleException(byte[] ser) |
|
158 throws IOException, ClassNotFoundException { |
|
159 SAXException saxException; |
|
160 ByteArrayInputStream bis = new ByteArrayInputStream(ser); |
|
161 try (ObjectInputStream saxExceptionOIS = new ObjectInputStream(bis)) { |
|
162 saxException = (SAXException) saxExceptionOIS.readObject(); |
|
163 } |
|
164 return saxException; |
|
165 } |
|
166 |
|
167 private static String SAX_MESSAGE = "SAXException message"; |
|
168 private static String SAX_CAUSE_MESSAGE = "SAXException cause message"; |
|
169 |
|
170 /* This is a serial form of ordinary SAXException serialized |
|
171 * by the following JDK8 code: |
|
172 * ByteArrayOutputStream fser = new ByteArrayOutputStream(); |
|
173 * ObjectOutputStream oos = new ObjectOutputStream(fser); |
|
174 * oos.writeObject(new SAXException(new Exception("Only exception field is set."))); |
|
175 * oos.close(); |
|
176 */ |
|
177 private static final byte[] JDK8_SET_WITH_CTOR_ONLY = { |
|
178 -84, -19, 0, 5, 115, 114, 0, 24, 111, 114, 103, 46, 120, 109, 108, 46, 115, 97, 120, 46, 83, 65, 88, 69, 120, |
|
179 99, 101, 112, 116, 105, 111, 110, 8, 24, 23, 45, 87, -89, -2, 32, 2, 0, 1, 76, 0, 9, 101, 120, 99, 101, 112, |
|
180 116, 105, 111, 110, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 69, 120, 99, 101, 112, 116, |
|
181 105, 111, 110, 59, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 69, 120, 99, 101, 112, 116, |
|
182 105, 111, 110, -48, -3, 31, 62, 26, 59, 28, -60, 2, 0, 0, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, |
|
183 103, 46, 84, 104, 114, 111, 119, 97, 98, 108, 101, -43, -58, 53, 39, 57, 119, -72, -53, 3, 0, 4, 76, 0, 5, 99, |
|
184 97, 117, 115, 101, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 84, 104, 114, 111, 119, 97, 98, |
|
185 108, 101, 59, 76, 0, 13, 100, 101, 116, 97, 105, 108, 77, 101, 115, 115, 97, 103, 101, 116, 0, 18, 76, 106, 97, |
|
186 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 0, 10, 115, 116, 97, 99, 107, 84, 114, |
|
187 97, 99, 101, 116, 0, 30, 91, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 97, 99, 107, 84, 114, 97, |
|
188 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 76, 0, 20, 115, 117, 112, 112, 114, 101, 115, 115, 101, 100, 69, |
|
189 120, 99, 101, 112, 116, 105, 111, 110, 115, 116, 0, 16, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 76, |
|
190 105, 115, 116, 59, 120, 112, 113, 0, 126, 0, 8, 112, 117, 114, 0, 30, 91, 76, 106, 97, 118, 97, 46, 108, 97, |
|
191 110, 103, 46, 83, 116, 97, 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 2, 70, 42, 60, |
|
192 60, -3, 34, 57, 2, 0, 0, 120, 112, 0, 0, 0, 2, 115, 114, 0, 27, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, |
|
193 83, 116, 97, 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 97, 9, -59, -102, 38, 54, -35, |
|
194 -123, 2, 0, 4, 73, 0, 10, 108, 105, 110, 101, 78, 117, 109, 98, 101, 114, 76, 0, 14, 100, 101, 99, 108, 97, |
|
195 114, 105, 110, 103, 67, 108, 97, 115, 115, 113, 0, 126, 0, 5, 76, 0, 8, 102, 105, 108, 101, 78, 97, 109, 101, |
|
196 113, 0, 126, 0, 5, 76, 0, 10, 109, 101, 116, 104, 111, 100, 78, 97, 109, 101, 113, 0, 126, 0, 5, 120, 112, 0, |
|
197 0, 0, 26, 116, 0, 8, 71, 101, 110, 101, 114, 97, 116, 101, 116, 0, 13, 71, 101, 110, 101, 114, 97, 116, 101, |
|
198 46, 106, 97, 118, 97, 116, 0, 15, 103, 101, 110, 101, 114, 97, 116, 101, 67, 97, 115, 101, 79, 110, 101, 115, |
|
199 113, 0, 126, 0, 11, 0, 0, 0, 10, 113, 0, 126, 0, 13, 113, 0, 126, 0, 14, 116, 0, 4, 109, 97, 105, 110, 115, |
|
200 114, 0, 38, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, |
|
201 36, 85, 110, 109, 111, 100, 105, 102, 105, 97, 98, 108, 101, 76, 105, 115, 116, -4, 15, 37, 49, -75, -20, |
|
202 -114, 16, 2, 0, 1, 76, 0, 4, 108, 105, 115, 116, 113, 0, 126, 0, 7, 120, 114, 0, 44, 106, 97, 118, 97, 46, |
|
203 117, 116, 105, 108, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, 111, 100, 105, |
|
204 102, 105, 97, 98, 108, 101, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 25, 66, 0, -128, -53, 94, -9, 30, |
|
205 2, 0, 1, 76, 0, 1, 99, 116, 0, 22, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 67, 111, 108, 108, 101, |
|
206 99, 116, 105, 111, 110, 59, 120, 112, 115, 114, 0, 19, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 65, 114, |
|
207 114, 97, 121, 76, 105, 115, 116, 120, -127, -46, 29, -103, -57, 97, -99, 3, 0, 1, 73, 0, 4, 115, 105, 122, 101, |
|
208 120, 112, 0, 0, 0, 0, 119, 4, 0, 0, 0, 0, 120, 113, 0, 126, 0, 23, 120, 115, 113, 0, 126, 0, 2, 113, 0, 126, 0, |
|
209 24, 116, 0, 28, 79, 110, 108, 121, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 32, 102, 105, 101, 108, 100, |
|
210 32, 105, 115, 32, 115, 101, 116, 46, 117, 113, 0, 126, 0, 9, 0, 0, 0, 2, 115, 113, 0, 126, 0, 11, 0, 0, 0, 26, |
|
211 113, 0, 126, 0, 13, 113, 0, 126, 0, 14, 113, 0, 126, 0, 15, 115, 113, 0, 126, 0, 11, 0, 0, 0, 10, 113, 0, 126, |
|
212 0, 13, 113, 0, 126, 0, 14, 113, 0, 126, 0, 17, 113, 0, 126, 0, 21, 120 |
|
213 }; |
|
214 |
|
215 /* This is a serial form of SAXException with two causes serialized |
|
216 * by the following JDK8 code: |
|
217 * ByteArrayOutputStream fser = new ByteArrayOutputStream(); |
|
218 * ObjectOutputStream oos = new ObjectOutputStream(fser); |
|
219 * oos.writeObject(new SAXException(new Exception("Exception and cause fields are set")) |
|
220 * .initCause(new Exception("Cause field"))); |
|
221 * oos.close(); |
|
222 */ |
|
223 private static final byte[] JDK8_SET_WITH_CTOR_AND_INIT = { |
|
224 -84, -19, 0, 5, 115, 114, 0, 24, 111, 114, 103, 46, 120, 109, 108, 46, 115, 97, 120, 46, 83, 65, 88, 69, 120, |
|
225 99, 101, 112, 116, 105, 111, 110, 8, 24, 23, 45, 87, -89, -2, 32, 2, 0, 1, 76, 0, 9, 101, 120, 99, 101, 112, |
|
226 116, 105, 111, 110, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 69, 120, 99, 101, 112, 116, |
|
227 105, 111, 110, 59, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 69, 120, 99, 101, 112, 116, |
|
228 105, 111, 110, -48, -3, 31, 62, 26, 59, 28, -60, 2, 0, 0, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, |
|
229 103, 46, 84, 104, 114, 111, 119, 97, 98, 108, 101, -43, -58, 53, 39, 57, 119, -72, -53, 3, 0, 4, 76, 0, 5, 99, |
|
230 97, 117, 115, 101, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 84, 104, 114, 111, 119, 97, 98, |
|
231 108, 101, 59, 76, 0, 13, 100, 101, 116, 97, 105, 108, 77, 101, 115, 115, 97, 103, 101, 116, 0, 18, 76, 106, 97, |
|
232 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 0, 10, 115, 116, 97, 99, 107, 84, 114, |
|
233 97, 99, 101, 116, 0, 30, 91, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 97, 99, 107, 84, 114, 97, |
|
234 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 76, 0, 20, 115, 117, 112, 112, 114, 101, 115, 115, 101, 100, 69, |
|
235 120, 99, 101, 112, 116, 105, 111, 110, 115, 116, 0, 16, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 76, |
|
236 105, 115, 116, 59, 120, 112, 115, 113, 0, 126, 0, 2, 113, 0, 126, 0, 9, 116, 0, 11, 67, 97, 117, 115, 101, 32, |
|
237 102, 105, 101, 108, 100, 117, 114, 0, 30, 91, 76, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 83, 116, 97, 99, |
|
238 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 2, 70, 42, 60, 60, -3, 34, 57, 2, 0, 0, 120, |
|
239 112, 0, 0, 0, 2, 115, 114, 0, 27, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 83, 116, 97, 99, 107, 84, 114, |
|
240 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 97, 9, -59, -102, 38, 54, -35, -123, 2, 0, 4, 73, 0, 10, 108, |
|
241 105, 110, 101, 78, 117, 109, 98, 101, 114, 76, 0, 14, 100, 101, 99, 108, 97, 114, 105, 110, 103, 67, 108, 97, |
|
242 115, 115, 113, 0, 126, 0, 5, 76, 0, 8, 102, 105, 108, 101, 78, 97, 109, 101, 113, 0, 126, 0, 5, 76, 0, 10, 109, |
|
243 101, 116, 104, 111, 100, 78, 97, 109, 101, 113, 0, 126, 0, 5, 120, 112, 0, 0, 0, 34, 116, 0, 8, 71, 101, 110, |
|
244 101, 114, 97, 116, 101, 116, 0, 13, 71, 101, 110, 101, 114, 97, 116, 101, 46, 106, 97, 118, 97, 116, 0, 15, |
|
245 103, 101, 110, 101, 114, 97, 116, 101, 67, 97, 115, 101, 84, 119, 111, 115, 113, 0, 126, 0, 13, 0, 0, 0, 11, |
|
246 113, 0, 126, 0, 15, 113, 0, 126, 0, 16, 116, 0, 4, 109, 97, 105, 110, 115, 114, 0, 38, 106, 97, 118, 97, 46, |
|
247 117, 116, 105, 108, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, 111, 100, 105, |
|
248 102, 105, 97, 98, 108, 101, 76, 105, 115, 116, -4, 15, 37, 49, -75, -20, -114, 16, 2, 0, 1, 76, 0, 4, 108, 105, |
|
249 115, 116, 113, 0, 126, 0, 7, 120, 114, 0, 44, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 67, 111, 108, 108, |
|
250 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, 111, 100, 105, 102, 105, 97, 98, 108, 101, 67, 111, 108, |
|
251 108, 101, 99, 116, 105, 111, 110, 25, 66, 0, -128, -53, 94, -9, 30, 2, 0, 1, 76, 0, 1, 99, 116, 0, 22, 76, |
|
252 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 59, 120, 112, |
|
253 115, 114, 0, 19, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 65, 114, 114, 97, 121, 76, 105, 115, 116, 120, |
|
254 -127, -46, 29, -103, -57, 97, -99, 3, 0, 1, 73, 0, 4, 115, 105, 122, 101, 120, 112, 0, 0, 0, 0, 119, 4, 0, 0, |
|
255 0, 0, 120, 113, 0, 126, 0, 25, 120, 112, 117, 113, 0, 126, 0, 11, 0, 0, 0, 2, 115, 113, 0, 126, 0, 13, 0, 0, |
|
256 0, 34, 113, 0, 126, 0, 15, 113, 0, 126, 0, 16, 113, 0, 126, 0, 17, 115, 113, 0, 126, 0, 13, 0, 0, 0, 11, 113, |
|
257 0, 126, 0, 15, 113, 0, 126, 0, 16, 113, 0, 126, 0, 19, 113, 0, 126, 0, 23, 120, 115, 113, 0, 126, 0, 2, 113, |
|
258 0, 126, 0, 29, 116, 0, 34, 69, 120, 99, 101, 112, 116, 105, 111, 110, 32, 97, 110, 100, 32, 99, 97, 117, 115, |
|
259 101, 32, 102, 105, 101, 108, 100, 115, 32, 97, 114, 101, 32, 115, 101, 116, 117, 113, 0, 126, 0, 11, 0, 0, 0, |
|
260 2, 115, 113, 0, 126, 0, 13, 0, 0, 0, 34, 113, 0, 126, 0, 15, 113, 0, 126, 0, 16, 113, 0, 126, 0, 17, 115, 113, |
|
261 0, 126, 0, 13, 0, 0, 0, 11, 113, 0, 126, 0, 15, 113, 0, 126, 0, 16, 113, 0, 126, 0, 19, 113, 0, 126, 0, 23, 120 |
|
262 }; |
|
263 |
|
264 /* |
|
265 * ByteArrayOutputStream fser = new ByteArrayOutputStream(); |
|
266 * ObjectOutputStream oos = new ObjectOutputStream(fser); |
|
267 * oos.writeObject(new SAXException("SAXException message").initCause(new Exception("cause field"))); |
|
268 * oos.close(); |
|
269 */ |
|
270 private static final byte[] JDK8_WITH_INIT_ONLY = { |
|
271 -84, -19, 0, 5, 115, 114, 0, 24, 111, 114, 103, 46, 120, 109, 108, 46, 115, 97, 120, 46, 83, 65, 88, 69, 120, |
|
272 99, 101, 112, 116, 105, 111, 110, 8, 24, 23, 45, 87, -89, -2, 32, 2, 0, 1, 76, 0, 9, 101, 120, 99, 101, 112, |
|
273 116, 105, 111, 110, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 69, 120, 99, 101, 112, 116, |
|
274 105, 111, 110, 59, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 69, 120, 99, 101, 112, 116, |
|
275 105, 111, 110, -48, -3, 31, 62, 26, 59, 28, -60, 2, 0, 0, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, |
|
276 103, 46, 84, 104, 114, 111, 119, 97, 98, 108, 101, -43, -58, 53, 39, 57, 119, -72, -53, 3, 0, 4, 76, 0, 5, 99, |
|
277 97, 117, 115, 101, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 84, 104, 114, 111, 119, 97, |
|
278 98, 108, 101, 59, 76, 0, 13, 100, 101, 116, 97, 105, 108, 77, 101, 115, 115, 97, 103, 101, 116, 0, 18, 76, 106, |
|
279 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 0, 10, 115, 116, 97, 99, 107, 84, |
|
280 114, 97, 99, 101, 116, 0, 30, 91, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 97, 99, 107, 84, |
|
281 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 76, 0, 20, 115, 117, 112, 112, 114, 101, 115, 115, |
|
282 101, 100, 69, 120, 99, 101, 112, 116, 105, 111, 110, 115, 116, 0, 16, 76, 106, 97, 118, 97, 47, 117, 116, 105, |
|
283 108, 47, 76, 105, 115, 116, 59, 120, 112, 115, 113, 0, 126, 0, 2, 113, 0, 126, 0, 9, 116, 0, 11, 99, 97, 117, |
|
284 115, 101, 32, 102, 105, 101, 108, 100, 117, 114, 0, 30, 91, 76, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, |
|
285 83, 116, 97, 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 2, 70, 42, 60, 60, -3, 34, |
|
286 57, 2, 0, 0, 120, 112, 0, 0, 0, 2, 115, 114, 0, 27, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 83, 116, 97, |
|
287 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 97, 9, -59, -102, 38, 54, -35, -123, 2, 0, 4, |
|
288 73, 0, 10, 108, 105, 110, 101, 78, 117, 109, 98, 101, 114, 76, 0, 14, 100, 101, 99, 108, 97, 114, 105, 110, 103, |
|
289 67, 108, 97, 115, 115, 113, 0, 126, 0, 5, 76, 0, 8, 102, 105, 108, 101, 78, 97, 109, 101, 113, 0, 126, 0, 5, 76, |
|
290 0, 10, 109, 101, 116, 104, 111, 100, 78, 97, 109, 101, 113, 0, 126, 0, 5, 120, 112, 0, 0, 0, 42, 116, 0, 8, 71, |
|
291 101, 110, 101, 114, 97, 116, 101, 116, 0, 13, 71, 101, 110, 101, 114, 97, 116, 101, 46, 106, 97, 118, 97, 116, |
|
292 0, 17, 103, 101, 110, 101, 114, 97, 116, 101, 67, 97, 115, 101, 84, 104, 114, 101, 101, 115, 113, 0, 126, 0, |
|
293 13, 0, 0, 0, 12, 113, 0, 126, 0, 15, 113, 0, 126, 0, 16, 116, 0, 4, 109, 97, 105, 110, 115, 114, 0, 38, 106, |
|
294 97, 118, 97, 46, 117, 116, 105, 108, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, |
|
295 111, 100, 105, 102, 105, 97, 98, 108, 101, 76, 105, 115, 116, -4, 15, 37, 49, -75, -20, -114, 16, 2, 0, 1, 76, |
|
296 0, 4, 108, 105, 115, 116, 113, 0, 126, 0, 7, 120, 114, 0, 44, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 67, |
|
297 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, 111, 100, 105, 102, 105, 97, 98, 108, 101, |
|
298 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 25, 66, 0, -128, -53, 94, -9, 30, 2, 0, 1, 76, 0, 1, 99, 116, |
|
299 0, 22, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 59, |
|
300 120, 112, 115, 114, 0, 19, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 65, 114, 114, 97, 121, 76, 105, 115, |
|
301 116, 120, -127, -46, 29, -103, -57, 97, -99, 3, 0, 1, 73, 0, 4, 115, 105, 122, 101, 120, 112, 0, 0, 0, 0, 119, |
|
302 4, 0, 0, 0, 0, 120, 113, 0, 126, 0, 25, 120, 116, 0, 20, 83, 65, 88, 69, 120, 99, 101, 112, 116, 105, 111, 110, |
|
303 32, 109, 101, 115, 115, 97, 103, 101, 117, 113, 0, 126, 0, 11, 0, 0, 0, 2, 115, 113, 0, 126, 0, 13, 0, 0, 0, 42, |
|
304 113, 0, 126, 0, 15, 113, 0, 126, 0, 16, 113, 0, 126, 0, 17, 115, 113, 0, 126, 0, 13, 0, 0, 0, 12, 113, 0, 126, 0, |
|
305 15, 113, 0, 126, 0, 16, 113, 0, 126, 0, 19, 113, 0, 126, 0, 23, 120, 112 |
|
306 }; |
|
307 |
|
308 /* |
|
309 * ByteArrayOutputStream fser = new ByteArrayOutputStream(); |
|
310 * ObjectOutputStream oos = new ObjectOutputStream(fser); |
|
311 * oos.writeObject(new SAXException("No cause and exception set")); |
|
312 * oos.close(); |
|
313 */ |
|
314 private static final byte[] JDK8_NOTHING_SET = { |
|
315 -84, -19, 0, 5, 115, 114, 0, 24, 111, 114, 103, 46, 120, 109, 108, 46, 115, 97, 120, 46, 83, 65, 88, 69, 120, |
|
316 99, 101, 112, 116, 105, 111, 110, 8, 24, 23, 45, 87, -89, -2, 32, 2, 0, 1, 76, 0, 9, 101, 120, 99, 101, 112, |
|
317 116, 105, 111, 110, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 69, 120, 99, 101, 112, 116, |
|
318 105, 111, 110, 59, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 69, 120, 99, 101, 112, 116, |
|
319 105, 111, 110, -48, -3, 31, 62, 26, 59, 28, -60, 2, 0, 0, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, |
|
320 103, 46, 84, 104, 114, 111, 119, 97, 98, 108, 101, -43, -58, 53, 39, 57, 119, -72, -53, 3, 0, 4, 76, 0, 5, 99, |
|
321 97, 117, 115, 101, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 84, 104, 114, 111, 119, 97, 98, |
|
322 108, 101, 59, 76, 0, 13, 100, 101, 116, 97, 105, 108, 77, 101, 115, 115, 97, 103, 101, 116, 0, 18, 76, 106, 97, |
|
323 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 0, 10, 115, 116, 97, 99, 107, 84, 114, |
|
324 97, 99, 101, 116, 0, 30, 91, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 97, 99, 107, 84, 114, |
|
325 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 76, 0, 20, 115, 117, 112, 112, 114, 101, 115, 115, 101, 100, |
|
326 69, 120, 99, 101, 112, 116, 105, 111, 110, 115, 116, 0, 16, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, |
|
327 76, 105, 115, 116, 59, 120, 112, 113, 0, 126, 0, 8, 116, 0, 26, 78, 111, 32, 99, 97, 117, 115, 101, 32, 97, 110, |
|
328 100, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 32, 115, 101, 116, 117, 114, 0, 30, 91, 76, 106, 97, 118, |
|
329 97, 46, 108, 97, 110, 103, 46, 83, 116, 97, 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, |
|
330 2, 70, 42, 60, 60, -3, 34, 57, 2, 0, 0, 120, 112, 0, 0, 0, 2, 115, 114, 0, 27, 106, 97, 118, 97, 46, 108, 97, |
|
331 110, 103, 46, 83, 116, 97, 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 97, 9, -59, -102, |
|
332 38, 54, -35, -123, 2, 0, 4, 73, 0, 10, 108, 105, 110, 101, 78, 117, 109, 98, 101, 114, 76, 0, 14, 100, 101, 99, |
|
333 108, 97, 114, 105, 110, 103, 67, 108, 97, 115, 115, 113, 0, 126, 0, 5, 76, 0, 8, 102, 105, 108, 101, 78, 97, |
|
334 109, 101, 113, 0, 126, 0, 5, 76, 0, 10, 109, 101, 116, 104, 111, 100, 78, 97, 109, 101, 113, 0, 126, 0, 5, 120, |
|
335 112, 0, 0, 0, 50, 116, 0, 8, 71, 101, 110, 101, 114, 97, 116, 101, 116, 0, 13, 71, 101, 110, 101, 114, 97, 116, |
|
336 101, 46, 106, 97, 118, 97, 116, 0, 16, 103, 101, 110, 101, 114, 97, 116, 101, 67, 97, 115, 101, 70, 111, 117, |
|
337 114, 115, 113, 0, 126, 0, 12, 0, 0, 0, 13, 113, 0, 126, 0, 14, 113, 0, 126, 0, 15, 116, 0, 4, 109, 97, 105, 110, |
|
338 115, 114, 0, 38, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, |
|
339 115, 36, 85, 110, 109, 111, 100, 105, 102, 105, 97, 98, 108, 101, 76, 105, 115, 116, -4, 15, 37, 49, -75, -20, |
|
340 -114, 16, 2, 0, 1, 76, 0, 4, 108, 105, 115, 116, 113, 0, 126, 0, 7, 120, 114, 0, 44, 106, 97, 118, 97, 46, 117, |
|
341 116, 105, 108, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, 111, 100, 105, 102, |
|
342 105, 97, 98, 108, 101, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 25, 66, 0, -128, -53, 94, -9, 30, 2, 0, |
|
343 1, 76, 0, 1, 99, 116, 0, 22, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 67, 111, 108, 108, 101, 99, 116, |
|
344 105, 111, 110, 59, 120, 112, 115, 114, 0, 19, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 65, 114, 114, 97, |
|
345 121, 76, 105, 115, 116, 120, -127, -46, 29, -103, -57, 97, -99, 3, 0, 1, 73, 0, 4, 115, 105, 122, 101, 120, 112, |
|
346 0, 0, 0, 0, 119, 4, 0, 0, 0, 0, 120, 113, 0, 126, 0, 24, 120, 112 |
|
347 }; |
|
348 |
|
349 /* |
|
350 * ByteArrayOutputStream fser = new ByteArrayOutputStream(); |
|
351 * ObjectOutputStream oos = new ObjectOutputStream(fser); |
|
352 * SAXException se = new SAXException(new Exception()); |
|
353 * se.initCause(null); |
|
354 * oos.writeObject(se); |
|
355 * oos.close(); |
|
356 */ |
|
357 private static final byte[] JDK8_CHECK_ILLEGAL_STATE_EXCEPTION = { |
|
358 -84, -19, 0, 5, 115, 114, 0, 24, 111, 114, 103, 46, 120, 109, 108, 46, 115, 97, 120, 46, 83, 65, 88, 69, 120, |
|
359 99, 101, 112, 116, 105, 111, 110, 8, 24, 23, 45, 87, -89, -2, 32, 2, 0, 1, 76, 0, 9, 101, 120, 99, 101, 112, |
|
360 116, 105, 111, 110, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 69, 120, 99, 101, 112, 116, |
|
361 105, 111, 110, 59, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 69, 120, 99, 101, 112, 116, |
|
362 105, 111, 110, -48, -3, 31, 62, 26, 59, 28, -60, 2, 0, 0, 120, 114, 0, 19, 106, 97, 118, 97, 46, 108, 97, 110, |
|
363 103, 46, 84, 104, 114, 111, 119, 97, 98, 108, 101, -43, -58, 53, 39, 57, 119, -72, -53, 3, 0, 4, 76, 0, 5, 99, |
|
364 97, 117, 115, 101, 116, 0, 21, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 84, 104, 114, 111, 119, 97, 98, |
|
365 108, 101, 59, 76, 0, 13, 100, 101, 116, 97, 105, 108, 77, 101, 115, 115, 97, 103, 101, 116, 0, 18, 76, 106, 97, |
|
366 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 0, 10, 115, 116, 97, 99, 107, 84, 114, |
|
367 97, 99, 101, 116, 0, 30, 91, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 97, 99, 107, 84, 114, |
|
368 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 76, 0, 20, 115, 117, 112, 112, 114, 101, 115, 115, 101, 100, |
|
369 69, 120, 99, 101, 112, 116, 105, 111, 110, 115, 116, 0, 16, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, |
|
370 76, 105, 115, 116, 59, 120, 112, 112, 112, 117, 114, 0, 30, 91, 76, 106, 97, 118, 97, 46, 108, 97, 110, 103, |
|
371 46, 83, 116, 97, 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 59, 2, 70, 42, 60, 60, -3, |
|
372 34, 57, 2, 0, 0, 120, 112, 0, 0, 0, 2, 115, 114, 0, 27, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 83, 116, |
|
373 97, 99, 107, 84, 114, 97, 99, 101, 69, 108, 101, 109, 101, 110, 116, 97, 9, -59, -102, 38, 54, -35, -123, 2, 0, |
|
374 4, 73, 0, 10, 108, 105, 110, 101, 78, 117, 109, 98, 101, 114, 76, 0, 14, 100, 101, 99, 108, 97, 114, 105, 110, |
|
375 103, 67, 108, 97, 115, 115, 113, 0, 126, 0, 5, 76, 0, 8, 102, 105, 108, 101, 78, 97, 109, 101, 113, 0, 126, 0, |
|
376 5, 76, 0, 10, 109, 101, 116, 104, 111, 100, 78, 97, 109, 101, 113, 0, 126, 0, 5, 120, 112, 0, 0, 0, 60, 116, 0, |
|
377 8, 71, 101, 110, 101, 114, 97, 116, 101, 116, 0, 13, 71, 101, 110, 101, 114, 97, 116, 101, 46, 106, 97, 118, |
|
378 97, 116, 0, 16, 103, 101, 110, 101, 114, 97, 116, 101, 67, 97, 115, 101, 70, 105, 118, 101, 115, 113, 0, 126, |
|
379 0, 11, 0, 0, 0, 14, 113, 0, 126, 0, 13, 113, 0, 126, 0, 14, 116, 0, 4, 109, 97, 105, 110, 115, 114, 0, 38, 106, |
|
380 97, 118, 97, 46, 117, 116, 105, 108, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, |
|
381 111, 100, 105, 102, 105, 97, 98, 108, 101, 76, 105, 115, 116, -4, 15, 37, 49, -75, -20, -114, 16, 2, 0, 1, 76, |
|
382 0, 4, 108, 105, 115, 116, 113, 0, 126, 0, 7, 120, 114, 0, 44, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 67, |
|
383 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 36, 85, 110, 109, 111, 100, 105, 102, 105, 97, 98, 108, 101, |
|
384 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 25, 66, 0, -128, -53, 94, -9, 30, 2, 0, 1, 76, 0, 1, 99, 116, |
|
385 0, 22, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 59, |
|
386 120, 112, 115, 114, 0, 19, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 65, 114, 114, 97, 121, 76, 105, 115, |
|
387 116, 120, -127, -46, 29, -103, -57, 97, -99, 3, 0, 1, 73, 0, 4, 115, 105, 122, 101, 120, 112, 0, 0, 0, 0, 119, |
|
388 4, 0, 0, 0, 0, 120, 113, 0, 126, 0, 23, 120, 115, 113, 0, 126, 0, 2, 113, 0, 126, 0, 24, 112, 117, 113, 0, 126, |
|
389 0, 9, 0, 0, 0, 2, 115, 113, 0, 126, 0, 11, 0, 0, 0, 60, 113, 0, 126, 0, 13, 113, 0, 126, 0, 14, 113, 0, 126, 0, |
|
390 15, 115, 113, 0, 126, 0, 11, 0, 0, 0, 14, 113, 0, 126, 0, 13, 113, 0, 126, 0, 14, 113, 0, 126, 0, 17, 113, 0, |
|
391 126, 0, 21, 120 |
|
392 }; |
|
393 } |