From 00d4e4a9710f89506f36156c24b0f3c5412971fa Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Thu, 20 Feb 2025 02:51:24 +0000 Subject: [PATCH] 8350051: [JMH] Several tests fails NPE Reviewed-by: erikj, redestad --- make/test/BuildMicrobenchmark.gmk | 13 ++++++++++++- .../openjdk/bench/javax/xml/AbstractXMLMicro.java | 6 ++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/make/test/BuildMicrobenchmark.gmk b/make/test/BuildMicrobenchmark.gmk index 53ee942d5d0..92f40472c3c 100644 --- a/make/test/BuildMicrobenchmark.gmk +++ b/make/test/BuildMicrobenchmark.gmk @@ -122,9 +122,20 @@ $(JMH_UNPACKED_JARS_DONE): $(JMH_RUNTIME_JARS) $(RM) $(JMH_UNPACKED_DIR)/*.xml $(TOUCH) $@ +# Copy dependency files for inclusion in the benchmark JARs +$(eval $(call SetupCopyFiles, COPY_JAXP_TEST_XML, \ + SRC := $(TOPDIR)/test/jaxp/javax/xml/jaxp/unittest, \ + DEST := $(MICROBENCHMARK_CLASSES)/org/openjdk/bench/javax/xml, \ + FILES := \ + stream/XMLStreamWriterTest/message_12.xml \ + validation/tck/reZ003vExc23082309.xml \ + transform/msgAttach.xml, \ + FLATTEN := true, \ +)) + # Create benchmarks JAR file with benchmarks for both the old and new JDK $(eval $(call SetupJarArchive, BUILD_JDK_JAR, \ - DEPENDENCIES := $(BUILD_JDK_MICROBENCHMARK) $(JMH_UNPACKED_JARS_DONE), \ + DEPENDENCIES := $(BUILD_JDK_MICROBENCHMARK) $(JMH_UNPACKED_JARS_DONE) $(COPY_JAXP_TEST_XML), \ SRCS := $(MICROBENCHMARK_CLASSES) $(JMH_UNPACKED_DIR), \ BIN := $(MICROBENCHMARK_JAR_BIN), \ SUFFIXES := .*, \ diff --git a/test/micro/org/openjdk/bench/javax/xml/AbstractXMLMicro.java b/test/micro/org/openjdk/bench/javax/xml/AbstractXMLMicro.java index 9d7955f3981..95593b38b3b 100644 --- a/test/micro/org/openjdk/bench/javax/xml/AbstractXMLMicro.java +++ b/test/micro/org/openjdk/bench/javax/xml/AbstractXMLMicro.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -38,15 +38,13 @@ import java.util.concurrent.ConcurrentHashMap; @State(Scope.Benchmark) public abstract class AbstractXMLMicro { - public static final String BUILDIMPL = "build-impl.xml"; - public static final String LOGCOMP = "log_comp.xml"; public static final String MESSAGE12 = "message_12.xml"; public static final String MSGATTACH = "msgAttach.xml"; public static final String REZ = "reZ003vExc23082309.xml"; protected static final ConcurrentHashMap byteCache = new ConcurrentHashMap<>(); - @Param({BUILDIMPL,LOGCOMP,MESSAGE12,MSGATTACH,REZ}) + @Param({MESSAGE12,MSGATTACH,REZ}) protected String doc; /**