Skip to content

Fix stream leaks and default-charset use in CLI tools - #1

Open
bact wants to merge 2 commits into
masterfrom
fix-stream-handling
Open

bact wants to merge 2 commits into
masterfrom
fix-stream-handling

Conversation

@bact

@bact bact commented Sep 18, 2026

Copy link
Copy Markdown
Owner
  • Use try-with-resources in SpdxConverter and the RdfSchemaTo* tools
  • Read license and JSON files as UTF-8 (BOM-aware, legacy fallback)
  • Stop SpdxViewer closing System.out
  • Add tests for viewer, RDF schema tools and encodings

- Use try-with-resources in SpdxConverter and the RdfSchemaTo* tools
- Read license and JSON files as UTF-8 (BOM-aware, legacy fallback)
- Stop SpdxViewer closing System.out
- Add tests for viewer, RDF schema tools and encodings

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added the bug Something isn't working label Sep 18, 2026
}

private static File writeTemp(byte[] content) throws Exception {
File file = File.createTempFile("readall", ".txt");
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
// primaryPackagePurpose is new in 2.3, so the 2.2 schema rejects it and the 2.3 schema accepts it
ObjectNode doc = (ObjectNode) new ObjectMapper().readTree(new File(JSON_V2_2_FILE_PATH));
((ObjectNode) doc.get("packages").get(0)).put("primaryPackagePurpose", "LIBRARY");
File file = File.createTempFile("verify-v22-", ".spdx.json");
}

public void testMalformedRdfFileIsAVerificationException() throws Exception {
File file = File.createTempFile("verify-bad-", ".rdf.xml");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants