Skip to content

TitaniumJsonLd context caching loads document on every call #4232

Closed
@ricardas-buc

Description

@ricardas-buc

Bug Report

Describe the Bug

A mixup of orElse VS orElseGet causes document to be loaded every time, even though cache is being hit.

return Optional.ofNullable(documentCache.get(uri))
.orElse(loader.loadDocument(uri, options));

Expected Behavior

Cached document should not be loaded again.

Context Information

  • Used version EDC 0.7

Detailed Description

If applicable, add screenshots and logs to help explain your problem.

Possible Implementation

Switching to orElseGet solves the issue. This does save extra 2-5ms per execution.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions