< prev index next >

test/jdk/tools/jimage/ImageReaderDuplicateChildNodesTest.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2022, 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.
--- 1,7 ---
  /*
!  * Copyright (c) 2022, 2025, 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.

*** 20,10 ***
--- 20,11 ---
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
  import jdk.internal.jimage.ImageReader;
+ import jdk.internal.jimage.PreviewMode;
  
  import java.nio.file.Files;
  import java.nio.file.Path;
  import java.nio.file.Paths;
  import java.util.HashSet;

*** 52,11 ***
              return;
          }
          System.out.println("Running test against image " + imagePath);
          final String integersParentResource = "/modules/java.base/java/lang";
          final String integerResource = integersParentResource + "/Integer.class";
!         try (final ImageReader reader = ImageReader.open(imagePath)) {
              // find the child node/resource first
              final ImageReader.Node integerNode = reader.findNode(integerResource);
              if (integerNode == null) {
                  throw new RuntimeException("ImageReader could not locate " + integerResource
                          + " in " + imagePath);
--- 53,11 ---
              return;
          }
          System.out.println("Running test against image " + imagePath);
          final String integersParentResource = "/modules/java.base/java/lang";
          final String integerResource = integersParentResource + "/Integer.class";
!         try (final ImageReader reader = ImageReader.open(imagePath, PreviewMode.DISABLED)) {
              // find the child node/resource first
              final ImageReader.Node integerNode = reader.findNode(integerResource);
              if (integerNode == null) {
                  throw new RuntimeException("ImageReader could not locate " + integerResource
                          + " in " + imagePath);
< prev index next >