jabref icon indicating copy to clipboard operation
jabref copied to clipboard

NullPointerException in StringUtil.join() when input array is null

Open shamka17 opened this issue 6 months ago • 2 comments

JabRef version

5.15 (latest release)

Operating system

macOS

Details on version and operating system

JabRef latest master branch Java 25

Checked with the latest development build (copy version output from About dialog)

  • [x] I made a backup of my libraries before testing the latest development version.
  • [x] I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

Description

While performing automated combinatorial JUnit testing on JabRef utility components, a NullPointerException was observed in StringUtil.join() when the input array is null.

StringUtilTest> testNullInput() FAILED java.lang.NullPointerException at StringUtilJava.java:31

Steps to reproduce

Execute the following JUnit test:

@Test public void testNullInput() { String result = StringUtil.join(null, ",", 0, 1); assertEquals("", result); } Expected behavior

The method should safely handle null input by either:

returning an empty string, or throwing a documented validation exception. Actual behavior

A NullPointerException is thrown during execution.

Environment JabRef latest master branch Java 25 Gradle test execution macOS

Appendix

...

Log File


shamka17 avatar May 16 '26 12:05 shamka17

The failing "test" passes null directly to StringUtil.join, but I don't see an existing call oath that can do that.

pluto-han avatar May 16 '26 17:05 pluto-han

Thanks for the clarification.

The issue was identified during combinatorial edge-case testing of utility methods using JUnit. I agree that the current application workflow may not expose a direct execution path that passes null to StringUtil.join().

The intention was to highlight the absence of defensive null handling at the utility-method level during robustness testing.

shamka17 avatar May 17 '26 03:05 shamka17