| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.util; |
| 17 |
|
|
| 18 |
|
import org.fest.reflect.core.Reflection; |
| 19 |
|
import org.fest.util.VisibleForTesting; |
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
@author |
| 33 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 34 |
|
public final class AWTExceptionHandlerInstaller { |
| 35 |
|
|
| 36 |
|
private static final SystemPropertyWriter WRITER = new SystemPropertyWriter(); |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
@param |
| 41 |
|
@throws |
| 42 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
6
|
public static void installAWTExceptionHandler(Class<?> exceptionHandlerType) {... |
| 44 |
6
|
installAWTExceptionHandler(exceptionHandlerType, WRITER); |
| 45 |
|
} |
| 46 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 47 |
8
|
@VisibleForTesting... |
| 48 |
|
static void installAWTExceptionHandler(Class<?> exceptionHandlerType, SystemPropertyWriter writer) { |
| 49 |
8
|
try { |
| 50 |
8
|
Reflection.constructor().in(exceptionHandlerType).info(); |
| 51 |
|
} catch (RuntimeException e) { |
| 52 |
1
|
throw new IllegalArgumentException("The exception handler type should have a default constructor"); |
| 53 |
|
} |
| 54 |
7
|
writer.updateSystemProperty("sun.awt.exception.handler", exceptionHandlerType.getName()); |
| 55 |
|
} |
| 56 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 57 |
|
private AWTExceptionHandlerInstaller() {}... |
| 58 |
|
} |