Skip to content

Commit d27b86d

Browse files
Remove deprecated StandardFonts.isDeprecated.
1 parent 1e40b54 commit d27b86d

2 files changed

Lines changed: 3 additions & 29 deletions

File tree

openpdf-core/src/main/java/org/openpdf/text/StandardFonts.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,4 @@ public Font create(int size) {
4444
return font;
4545
}
4646

47-
/**
48-
* @deprecated As of OpenPDF 2.0.0. Was only in 1.3 relevant
49-
*/
50-
@Deprecated(since = "2.0.2", forRemoval = true)
51-
public boolean isDeprecated() {
52-
return false;
53-
}
5447
}

openpdf-core/src/test/java/org/openpdf/text/StandardFontsTest.java

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ void createDocumentAllFonts() {
4141
/* step 4:*/
4242
// the 14 standard fonts in PDF: do not use this Font constructor!
4343
// this is for demonstration purposes only, use FontFactory!
44-
final List<StandardFonts> standardFonts = Arrays.stream(values())
45-
.filter(f -> !f.isDeprecated()).collect(Collectors.toList());
44+
final List<StandardFonts> standardFonts = List.of(values());
4645
for (StandardFonts standardFont : standardFonts) {
4746
// add the content
4847
Font font = standardFont.create();
@@ -57,8 +56,7 @@ void createDocumentAllFonts() {
5756
@Test
5857
void testNonDeprecatedFonts() {
5958
// given
60-
final List<StandardFonts> standardFonts = Arrays.stream(values())
61-
.filter(f -> !f.isDeprecated()).collect(Collectors.toList());
59+
final List<StandardFonts> standardFonts = List.of(values());
6260
// then
6361
assertThat(standardFonts).containsExactlyInAnyOrder(
6462
COURIER, COURIER_BOLD, COURIER_BOLDITALIC, COURIER_ITALIC,
@@ -72,29 +70,12 @@ void testNonDeprecatedFonts() {
7270
@Test
7371
void testCreateStandardFonts() throws IOException {
7472
// given
75-
final List<StandardFonts> standardFonts = Arrays.stream(values())
76-
.filter(f -> !f.isDeprecated()).collect(Collectors.toList());
73+
final List<StandardFonts> standardFonts = List.of(values());
7774
for (StandardFonts standardFont : standardFonts) {
7875
// when
7976
final Font font = standardFont.create();
8077
// then
8178
assertNotNull(font);
8279
}
8380
}
84-
85-
@Test
86-
void testCreateStandardDeprecatedFonts() {
87-
// given
88-
SoftAssertions softly = new SoftAssertions();
89-
final List<StandardFonts> deprecatedFonts = Arrays.stream(values())
90-
.filter(StandardFonts::isDeprecated).collect(Collectors.toList());
91-
// when
92-
for (StandardFonts deprecatedFont : deprecatedFonts) {
93-
// then
94-
softly.assertThatThrownBy(deprecatedFont::create)
95-
.isInstanceOf(IOException.class)
96-
.hasMessageContaining(deprecatedFont.name());
97-
}
98-
softly.assertAll();
99-
}
10081
}

0 commit comments

Comments
 (0)