< prev index next >

test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java

Print this page
rev 16983 : [mq]: 8180397

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -33,12 +33,10 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 
-import jdk.testlibrary.IOUtils;
-
 import static java.lang.annotation.RetentionPolicy.CLASS;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
  * This test simulates a situation where there are two mutually recursive

@@ -138,11 +136,11 @@
             if (name.endsWith("_v1")) {
                 String altName = name.substring(0, name.length() - 3) + "_v2";
                 String altPath = altName.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(altPath)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is);
+                        byte[] bytes = is.readAllBytes();
                         // patch class bytes to contain original name
                         for (int i = 0; i < bytes.length - 2; i++) {
                             if (bytes[i] == '_' &&
                                 bytes[i + 1] == 'v' &&
                                 bytes[i + 2] == '2') {

@@ -161,11 +159,11 @@
             }
             else { // not special class name -> just load the class
                 String path = name.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(path)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is);
+                        byte[] bytes = is.readAllBytes();
                         return defineClass(name, bytes, 0, bytes.length);
                     }
                     else {
                         throw new ClassNotFoundException(name);
                     }
< prev index next >