Skip to content

Commit

Permalink
Fix minor IDE warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ledsoft committed Mar 18, 2024
1 parent 88c41ea commit 3946630
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public URI generateDerivedIdentifier(URI baseUri, String namespaceSeparator, Str

/**
* Generates a synthetic identifier using the specified base URL.
*
* <p>
* This particular implementation uses the current system time in millis to generate the locally unique part of the identifier.
*
* @param base URL base
Expand Down
17 changes: 9 additions & 8 deletions src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void getSubTermsLoadsSubTermsOfParentTerm() throws Exception {
final MvcResult mvcResult = mockMvc
.perform(get(PATH + VOCABULARY_NAME + "/terms/" + TERM_NAME + "/subterms"))
.andExpect(status().isOk()).andReturn();
final List<Term> result = readValue(mvcResult, new TypeReference<List<Term>>() {
final List<Term> result = readValue(mvcResult, new TypeReference<>() {
});
assertEquals(children.size(), result.size());
assertTrue(children.containsAll(result));
Expand Down Expand Up @@ -367,13 +367,14 @@ void getAllExportsTermsToExcelWhenAcceptMediaTypeIsExcel() throws Exception {
}

private TypeAwareByteArrayResource prepareExcel() throws Exception {
final XSSFWorkbook wb = new XSSFWorkbook();
final XSSFSheet s = wb.createSheet("test");
s.createRow(0).createCell(0).setCellValue("test");
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
wb.write(bos);
return new TypeAwareByteArrayResource(bos.toByteArray(), ExportFormat.EXCEL.getMediaType(),
ExportFormat.EXCEL.getFileExtension());
try (final XSSFWorkbook wb = new XSSFWorkbook()) {
final XSSFSheet s = wb.createSheet("test");
s.createRow(0).createCell(0).setCellValue("test");
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
wb.write(bos);
return new TypeAwareByteArrayResource(bos.toByteArray(), ExportFormat.EXCEL.getMediaType(),
ExportFormat.EXCEL.getFileExtension());
}
}

@Test
Expand Down

0 comments on commit 3946630

Please sign in to comment.