Skip to content

Commit 382a98b

Browse files
committed
PDFBOX-5660: Sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1935295 13f79535-47bb-0310-9956-ffa450edef68
1 parent 7439965 commit 382a98b

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/PDButtonTest.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static org.junit.jupiter.api.Assertions.assertNotNull;
2323
import static org.junit.jupiter.api.Assertions.assertThrows;
2424
import static org.junit.jupiter.api.Assertions.assertTrue;
25-
import static org.junit.jupiter.api.Assertions.fail;
2625

2726
import java.io.File;
2827
import java.io.IOException;
@@ -102,9 +101,11 @@ void createRadioButton()
102101
* Test a radio button with options.
103102
* This was causing an ArrayIndexOutOfBoundsException when trying to set to "Off", as this
104103
* wasn't treated to be a valid option.
104+
*
105+
* @throws IOException
105106
*/
106107
@Test
107-
void testRadioButtonWithOptions()
108+
void testRadioButtonWithOptions() throws IOException
108109
{
109110
File file = new File(TARGET_PDF_DIR, "PDFBOX-3656.pdf");
110111

@@ -116,10 +117,6 @@ void testRadioButtonWithOptions()
116117
assertEquals(COSName.Off, widget.getCOSObject().getItem(COSName.AS),
117118
"The widget should be set to Off"));
118119
}
119-
catch (IOException e)
120-
{
121-
fail("Unexpected IOException " + e.getMessage());
122-
}
123120
}
124121

125122
/**
@@ -129,9 +126,10 @@ void testRadioButtonWithOptions()
129126
* Special handling for a radio button with /Opt and the On state not being named
130127
* after the index.
131128
*
129+
* @throws IOException
132130
*/
133131
@Test
134-
void testOptionsAndNamesNotNumbers()
132+
void testOptionsAndNamesNotNumbers() throws IOException
135133
{
136134
File file = new File(TARGET_PDF_DIR, "PDFBOX-3682.pdf");
137135
try (PDDocument pdfDocument = Loader.loadPDF(file))
@@ -152,10 +150,6 @@ void testOptionsAndNamesNotNumbers()
152150
radioButton.getWidgets().get(2).getCOSObject().getNameAsString(COSName.AS),
153151
"This shall be c");
154152
}
155-
catch (IOException e)
156-
{
157-
fail("Unexpected IOException " + e.getMessage());
158-
}
159153
}
160154

161155
@Test

0 commit comments

Comments
 (0)