Skip to content

Commit

Permalink
Add support for storing properties of type Double
Browse files Browse the repository at this point in the history
This update depends on new versions of the SPDX core library (1.0.0-RC2
or later) and the SPDX 3 Model (1.0.0-RC2 or later)

Fixes #273
  • Loading branch information
goneall committed Jan 7, 2025
1 parent ca634e6 commit 5111af3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@
<dependency>
<groupId>org.spdx</groupId>
<artifactId>spdx-java-core</artifactId>
<version>1.0.0-RC1</version>
<version>1.0.0-RC2</version>
</dependency>
<dependency>
<groupId>org.spdx</groupId>
<artifactId>spdx-java-model-3_0</artifactId>
<version>1.0.0-RC1</version>
<version>1.0.0-RC2</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spdx/storage/simple/InMemSpdxStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public void leaveCriticalSection(IModelStoreLock lock) {
}

@Override
public Optional<String> getCaseSensisitiveId(String nameSpace, String caseInsensisitiveId) {
public Optional<String> getCaseSensitiveId(String nameSpace, String caseInsensisitiveId) {
Objects.requireNonNull(nameSpace, "Namespace can not be null");
Objects.requireNonNull(caseInsensisitiveId, "CaseInsensisitiveId can not be null");
String objectUri = nameSpace + "#" + caseInsensisitiveId;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/spdx/storage/simple/StoredTypedItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public void setValue(PropertyDescriptor propertyDescriptor, Object value) throws
!String.class.isAssignableFrom(value.getClass()) &&
!Boolean.class.isAssignableFrom(value.getClass()) &&
!Integer.class.isAssignableFrom(value.getClass()) &&
!Double.class.isAssignableFrom(value.getClass()) &&
!Float.class.isAssignableFrom((value.getClass())) &&
!TypedValue.class.isAssignableFrom(value.getClass()) &&
!(value instanceof IndividualUriValue)) {
throw new SpdxInvalidTypeException(value.getClass() +" is not a supported class to be stored.");
Expand Down

0 comments on commit 5111af3

Please sign in to comment.