From bb0297ae960bfa0ca1258eb7a3efd62376c1c254 Mon Sep 17 00:00:00 2001 From: Peter Kriens Date: Mon, 18 Mar 2024 16:56:40 +0100 Subject: [PATCH] Made sure return is always non-null --- Signed-off-by: Peter Kriens Signed-off-by: Peter Kriens --- biz.aQute.bndlib/src/aQute/bnd/build/Project.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java index 1de998ca72..fb147c90e7 100644 --- a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java +++ b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java @@ -526,11 +526,11 @@ private void traverse(Set dependencies, Project dependent, Set private File getSingleFile(String key) { String value = getProperty(key); - if (value == null) - return null; - if (value.indexOf(',') >= 0) { - error("project.%s expected one file path for prperty %s but got multiple: %s", key, key, value); - return null; + if (value == null) { + error("project.%s expected value for property %s but got null", key, key); + value = key; + } else if (value.indexOf(',') >= 0) { + error("project.%s expected one file path for property %s but got multiple: %s", key, key, value); } return getFile(value); } @@ -1932,8 +1932,7 @@ public File[] buildLocal(boolean underTest) throws Exception { if (lastModified < jar.lastModified()) { lastModified = jar.lastModified(); } - Supplier indexer = ResourceBuilder.memoize(jar, - file.toURI(), + Supplier indexer = ResourceBuilder.memoize(jar, file.toURI(), getName()); if (indexer != null) { resourceBuilders.add(indexer); @@ -1998,7 +1997,6 @@ public File[] buildLocal(boolean underTest) throws Exception { } } - boolean bfsWrite = !bfs.exists() || (lastModified > bfs.lastModified()); if (buildfiles != null) { Set removed = Create.set(buildfiles);