Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for storing properties of type Double #274

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public NamespaceMap convertAndStore(org.spdx.library.model.v2.ExternalDocumentRe
NamespaceMap toNamespaceMap = (NamespaceMap)SpdxModelClassFactoryV3.getModelObject(toModelStore,
toObjectUri, SpdxConstantsV3.CORE_NAMESPACE_MAP, copyManager, true, defaultUriPrefix);
toNamespaceMap.setPrefix(externalDocRef.getId());
toNamespaceMap.setNamespace(externalDocRef.getSpdxDocumentNamespace());
toNamespaceMap.setNamespace(externalDocRef.getSpdxDocumentNamespace() + "#");
return toNamespaceMap;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/spdx/storage/simple/InMemSpdxStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ public void leaveCriticalSection(IModelStoreLock lock) {
}

@Override
public Optional<String> getCaseSensisitiveId(String nameSpace, String caseInsensisitiveId) {
public Optional<String> getCaseSensitiveId(String nameSpace, String caseInsensitiveId) {
Objects.requireNonNull(nameSpace, "Namespace can not be null");
Objects.requireNonNull(caseInsensisitiveId, "CaseInsensisitiveId can not be null");
String objectUri = nameSpace + "#" + caseInsensisitiveId;
Objects.requireNonNull(caseInsensitiveId, "CaseInsensitiveId can not be null");
String objectUri = nameSpace + "#" + caseInsensitiveId;
StoredTypedItem item = typedValueMap.get(objectUri.toLowerCase());
if (Objects.isNull(item)) {
return Optional.empty();
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
Loading