Skip to content

Commit 00d4e4a

Browse files
author
SendaoYan
committed
8350051: [JMH] Several tests fails NPE
Reviewed-by: erikj, redestad
1 parent 0131c1b commit 00d4e4a

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

make/test/BuildMicrobenchmark.gmk

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,20 @@ $(JMH_UNPACKED_JARS_DONE): $(JMH_RUNTIME_JARS)
122122
$(RM) $(JMH_UNPACKED_DIR)/*.xml
123123
$(TOUCH) $@
124124

125+
# Copy dependency files for inclusion in the benchmark JARs
126+
$(eval $(call SetupCopyFiles, COPY_JAXP_TEST_XML, \
127+
SRC := $(TOPDIR)/test/jaxp/javax/xml/jaxp/unittest, \
128+
DEST := $(MICROBENCHMARK_CLASSES)/org/openjdk/bench/javax/xml, \
129+
FILES := \
130+
stream/XMLStreamWriterTest/message_12.xml \
131+
validation/tck/reZ003vExc23082309.xml \
132+
transform/msgAttach.xml, \
133+
FLATTEN := true, \
134+
))
135+
125136
# Create benchmarks JAR file with benchmarks for both the old and new JDK
126137
$(eval $(call SetupJarArchive, BUILD_JDK_JAR, \
127-
DEPENDENCIES := $(BUILD_JDK_MICROBENCHMARK) $(JMH_UNPACKED_JARS_DONE), \
138+
DEPENDENCIES := $(BUILD_JDK_MICROBENCHMARK) $(JMH_UNPACKED_JARS_DONE) $(COPY_JAXP_TEST_XML), \
128139
SRCS := $(MICROBENCHMARK_CLASSES) $(JMH_UNPACKED_DIR), \
129140
BIN := $(MICROBENCHMARK_JAR_BIN), \
130141
SUFFIXES := .*, \

test/micro/org/openjdk/bench/javax/xml/AbstractXMLMicro.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,15 +38,13 @@
3838
@State(Scope.Benchmark)
3939
public abstract class AbstractXMLMicro {
4040

41-
public static final String BUILDIMPL = "build-impl.xml";
42-
public static final String LOGCOMP = "log_comp.xml";
4341
public static final String MESSAGE12 = "message_12.xml";
4442
public static final String MSGATTACH = "msgAttach.xml";
4543
public static final String REZ = "reZ003vExc23082309.xml";
4644

4745
protected static final ConcurrentHashMap<String, byte[]> byteCache = new ConcurrentHashMap<>();
4846

49-
@Param({BUILDIMPL,LOGCOMP,MESSAGE12,MSGATTACH,REZ})
47+
@Param({MESSAGE12,MSGATTACH,REZ})
5048
protected String doc;
5149

5250
/**

0 commit comments

Comments
 (0)