|
1 | 1 | /* |
2 | | - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
155 | 155 | * logging or debugging of format corruptions. |
156 | 156 | * |
157 | 157 | * <P> |
158 | | - * Note the term <i>class file</i> is used as defined in section 3.1 of |
159 | | - * <cite>The Java Virtual Machine Specification</cite>, to mean a |
160 | | - * sequence of bytes in class file format, whether or not they reside in a |
| 158 | + * Note the term <i>class file</i> is used as defined in chapter {@jvms 4} The |
| 159 | + * {@code class} File Format of <cite>The Java Virtual Machine Specification</cite>, |
| 160 | + * to mean a sequence of bytes in class file format, whether or not they reside in a |
161 | 161 | * file. |
162 | 162 | * |
| 163 | + * @apiNote |
| 164 | + * Great care must be taken when transforming core JDK classes which are at the |
| 165 | + * same time required during the transformation process as this can lead to class |
| 166 | + * circularity or linkage errors. |
| 167 | + * |
| 168 | + * <P> |
| 169 | + * If for example the invocation of {@link #transform transform()} for a class |
| 170 | + * {@code C} requires loading or resolving the same class {@code C}, |
| 171 | + * an error is thrown that is an instance of {@link LinkageError} (or a subclass). |
| 172 | + * If the {@link LinkageError} occurs during reference resolution (see section |
| 173 | + * {@jvms 5.4.3} Resolution of <cite>The Java Virtual Machine Specification</cite>) |
| 174 | + * for a class {@code D}, the resolution of the corresponding reference in class |
| 175 | + * {@code D} will permanently fail with the same error at any subsequent attempt. |
| 176 | + * This means that a {@link LinkageError} triggered during transformation of |
| 177 | + * {@code C} in a class {@code D} not directly related to {@code C} can repeatedly |
| 178 | + * occur later in arbitrary user code which uses {@code D}. |
| 179 | + * |
163 | 180 | * @see java.lang.instrument.Instrumentation |
164 | 181 | * @since 1.5 |
165 | 182 | */ |
|
0 commit comments