< prev index next >

test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java

Print this page
rev 10304 : [mq]: jake_pre_integ


   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 8076110
  27  * @summary Redefine running methods that have cached resolution errors
  28  * @library /testlibrary
  29  * @modules java.instrument
  30  *          java.base/jdk.internal.org.objectweb.asm

  31  * @build RedefineClassHelper
  32  * @run main RedefineClassHelper
  33  * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethodsWithResolutionErrors
  34  */
  35 
  36 import jdk.internal.org.objectweb.asm.ClassWriter;
  37 import jdk.internal.org.objectweb.asm.Label;
  38 import jdk.internal.org.objectweb.asm.MethodVisitor;
  39 import jdk.internal.org.objectweb.asm.Opcodes;
  40 
  41 import java.lang.reflect.InvocationTargetException;
  42 
  43 public class RedefineRunningMethodsWithResolutionErrors extends ClassLoader implements Opcodes {
  44 
  45     @Override
  46     protected Class<?> findClass(String name) throws ClassNotFoundException {
  47         if (name.equals("C")) {
  48             byte[] b = loadC(false);
  49             return defineClass(name, b, 0, b.length);
  50         } else {




   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 8076110
  27  * @summary Redefine running methods that have cached resolution errors
  28  * @library /testlibrary
  29  * @modules java.base/jdk.internal.org.objectweb.asm
  30  *          java.instrument
  31  *          jdk.jartool/sun.tools.jar
  32  * @build RedefineClassHelper
  33  * @run main RedefineClassHelper
  34  * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethodsWithResolutionErrors
  35  */
  36 
  37 import jdk.internal.org.objectweb.asm.ClassWriter;
  38 import jdk.internal.org.objectweb.asm.Label;
  39 import jdk.internal.org.objectweb.asm.MethodVisitor;
  40 import jdk.internal.org.objectweb.asm.Opcodes;
  41 
  42 import java.lang.reflect.InvocationTargetException;
  43 
  44 public class RedefineRunningMethodsWithResolutionErrors extends ClassLoader implements Opcodes {
  45 
  46     @Override
  47     protected Class<?> findClass(String name) throws ClassNotFoundException {
  48         if (name.equals("C")) {
  49             byte[] b = loadC(false);
  50             return defineClass(name, b, 0, b.length);
  51         } else {


< prev index next >