Skip to content

Commit b171418

Browse files
committed
🎨 make legacy property name consistent with the new style
1 parent 65df854 commit b171418

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ There are a couple of static classes that help common usage scenarios:
4040
`Spdx-Java-Library` can be configured using either Java system properties or a Java properties file located in the runtime CLASSPATH at `/resources/spdx-java-library.properties`.
4141

4242
The library has these configuration options:
43-
1. `SPDXParser.OnlyUseLocalLicenses` - a boolean that controls whether the (potentially out of date) listed license information bundled inside the JAR is used (true), vs the library downloading the latest files from the SPDX website (false). Default is false (always download the latest files from the SPDX website).
43+
1. `org.spdx.useJARLicenseInfoOnly` - a boolean that controls whether the (potentially out of date) listed license information bundled inside the JAR is used (true), vs the library downloading the latest files from the SPDX website (false). Default is false (always download the latest files from the SPDX website).
4444
2. `org.spdx.downloadCacheEnabled` - a boolean that enables or disables the download cache. Defaults to `false` (the cache is disabled). The cache location is determined as per the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) (i.e. `${XDG_CACHE_HOME}/Spdx-Java-Library` or `${HOME}/.cache/Spdx-Java-Library`).
4545
3. `org.spdx.downloadCacheCheckIntervalSecs` - a long that controls how often each cache entry is rechecked for staleness, in units of seconds. Defaults to 86,400 seconds (24 hours). Set to 0 (zero) to have each cache entry checked every time (note: this will result in a lot more network I/O and negatively impact performance, albeit there is still a substantial performance saving vs not using the cache at all).
4646

resources/spdx-java-library.properties.sample

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# if true, only use license information from the set of licenses stored within the JAR file at release time, rather than
2-
# downloading the latest versions from the SPDX website
3-
SPDXParser.OnlyUseLocalLicenses=false
1+
# if true, only use license information stored within the JAR file at release time, rather than downloading the latest
2+
# versions from the SPDX website
3+
org.spdx.useJARLicenseInfoOnly=false
44

55
# if true, enable the download cache
66
org.spdx.downloadCacheEnabled=false

src/main/java/org/spdx/library/model/license/ListedLicenses.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public class ListedLicenses {
5959
* This constructor should only be called by the getListedLicenses method
6060
*/
6161
private ListedLicenses() {
62-
// Note: this code confusingly uses different property values depending on the source (Java system property vs properties file),
63-
// so we have to check both names in order to not break downstream consumers' legacy configurations. This is _NOT_ recommended for
64-
// any new code that leverages the Configuration class.
65-
onlyUseLocalLicenses = Boolean.parseBoolean(Configuration.getInstance().getProperty("SPDXParser.OnlyUseLocalLicenses",
66-
Configuration.getInstance().getProperty("OnlyUseLocalLicenses", "false")));
62+
// Note: this code is confusing as this property changed names several times over time, and we want to preserve
63+
// backwards compatibility for those downstream library users who are using the old/deprecated names
64+
onlyUseLocalLicenses = Boolean.parseBoolean(Configuration.getInstance().getProperty("org.spdx.useJARLicenseInfoOnly",
65+
Configuration.getInstance().getProperty("SPDXParser.OnlyUseLocalLicenses",
66+
Configuration.getInstance().getProperty("OnlyUseLocalLicenses", "false"))));
6767
initializeLicenseModelStore();
6868
}
6969

0 commit comments

Comments
 (0)