Skip to content

Commit

Permalink
NPE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mjok committed Feb 4, 2021
1 parent df44961 commit 0571a89
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -291,10 +292,14 @@ public static void main(String[] args) throws Exception {
private static void appendMetadataFromJavaDoc(Class<?> aClass, Optional<Method> benchmarkMethod, BenchmarkReport benchmarkReport) {
final String key = aClass.getName() + "." + benchmarkMethod.get().getName();

LOG.info("Appending javadoc for {}", key);
Properties p = new Properties();
try {
p.load(ClassLoader.getSystemResourceAsStream("benchJavaDoc"));
final InputStream benchJavaDoc = ClassLoader.getSystemResourceAsStream("benchJavaDoc");
if (benchJavaDoc == null) {
LOG.info("No javadoc descriptions found");
return;
}
p.load(benchJavaDoc);

final String property = p.getProperty(key);
if (property != null) {
Expand Down

0 comments on commit 0571a89

Please sign in to comment.