Implementation Note
Because this class is called by MethodHandleStatics, LambdaForms generation and LambdaMetafactory, make use of lambda lead to recursive calls cause stack overflow.
| Modifier and Type | Field and Description |
|---|---|
| private static final Set | |
| private final AtomicInteger | |
| private final String | |
| private static final ConcurrentHashMap | |
| private final boolean | |
| private static final HexFormat | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | dumpFailedClass(String name, byte[] bytes)
This method dumps the given bytes at a path of the given name with a suffix ".failed-$COUNTER" where $COUNTER will be incremented for each time this method is called. |
| private static String | |
| public static ClassFileDumper | getInstance(String key, String path)
Returns a ClassFileDumper instance for the given key with a given dump path. |
| public boolean | |
| public String | |
| private Path | |
| private static Path | |
| private void |
| BAD_CHARS | back to summary |
|---|---|
| private static final Set<Character> BAD_CHARS | |
| counter | back to summary |
|---|---|
| private final AtomicInteger counter | |
| dumpDir | back to summary |
|---|---|
| private final String dumpDir | |
| DUMPER_MAP | back to summary |
|---|---|
| private static final ConcurrentHashMap<String, ClassFileDumper> DUMPER_MAP | |
| enabled | back to summary |
|---|---|
| private final boolean enabled | |
| HEX | back to summary |
|---|---|
| private static final HexFormat HEX | |
| key | back to summary |
|---|---|
| private final String key | |
| ClassFileDumper | back to summary |
|---|---|
| private ClassFileDumper(String key, String path) | |
| dumpClass | back to summary |
|---|---|
| public void dumpClass(String name, Class<?> c, byte[] bytes) This method determines the path name from the given name and | |
| dumpFailedClass | back to summary |
|---|---|
| public void dumpFailedClass(String name, byte[] bytes) This method dumps the given bytes at a path of the given name with a suffix ".failed-$COUNTER" where $COUNTER will be incremented for each time this method is called. | |
| encodeForFilename | back to summary |
|---|---|
| private static String encodeForFilename(String className) | |
| getInstance | back to summary |
|---|---|
| public static ClassFileDumper getInstance(String key, String path) Returns a ClassFileDumper instance for the given key with a given
dump path. To enable dumping of the generated classes
-D | |
| isEnabled | back to summary |
|---|---|
| public boolean isEnabled() | |
| key | back to summary |
|---|---|
| public String key() | |
| pathname | back to summary |
|---|---|
| private Path pathname(String name) | |
| validateDumpDir | back to summary |
|---|---|
| private static Path validateDumpDir(String dir) | |
| write | back to summary |
|---|---|
| private void write(Path path, byte[] bytes) | |