61 |
|
} |
62 |
|
|
63 |
|
/** Checks properties of empty collections. */ |
64 |
< |
public void testEmptyMeansEmpty() throws InterruptedException { |
64 |
> |
public void testEmptyMeansEmpty() throws Throwable { |
65 |
|
Collection c = impl.emptyCollection(); |
66 |
|
emptyMeansEmpty(c); |
67 |
|
|
68 |
< |
if (c instanceof java.io.Serializable) |
69 |
< |
emptyMeansEmpty(serialClone(c)); |
68 |
> |
if (c instanceof java.io.Serializable) { |
69 |
> |
try { |
70 |
> |
emptyMeansEmpty(serialClonePossiblyFailing(c)); |
71 |
> |
} catch (java.io.NotSerializableException ex) { |
72 |
> |
// excusable when we have a serializable wrapper around |
73 |
> |
// a non-serializable collection, as can happen with: |
74 |
> |
// Vector.subList() => wrapped AbstractList$RandomAccessSubList |
75 |
> |
if (testImplementationDetails |
76 |
> |
&& (! c.getClass().getName().matches( |
77 |
> |
"java.util.Collections.*"))) |
78 |
> |
throw ex; |
79 |
> |
} |
80 |
> |
} |
81 |
|
|
82 |
|
Collection clone = cloneableClone(c); |
83 |
|
if (clone != null) |
325 |
|
} |
326 |
|
} catch (Throwable ex) { |
327 |
|
System.err.println(impl.klazz()); |
328 |
< |
System.err.printf("c=%s%n", c); |
328 |
> |
// c is at risk of corruption if we got here, so be lenient |
329 |
> |
try { System.err.printf("c=%s%n", c); } |
330 |
> |
catch (Throwable t) { t.printStackTrace(); } |
331 |
|
System.err.printf("n=%d%n", n); |
332 |
|
System.err.printf("orig=%s%n", orig); |
333 |
|
System.err.printf("accepts=%s%n", accepts); |