File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
pdfbox/src/test/java/org/apache/pdfbox/pdmodel/fdf Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,15 @@ void testAnnotationWidth() throws IOException
109109
110110 ByteArrayInputStream inputStream = new ByteArrayInputStream (xfdf .getBytes (StandardCharsets .UTF_8 ));
111111
112- FDFDocument fdfDoc = Loader .loadXFDF (inputStream );
113- List <FDFAnnotation > fdfAnnots = fdfDoc .getCatalog ().getFDF ().getAnnotations ();
114- assertEquals (1 , fdfAnnots .size ());
115-
116- FDFAnnotation annot = fdfAnnots .get (0 );
117- assertNotNull (annot .getBorderStyle ());
118- assertEquals (0f , annot .getBorderStyle ().getWidth (), 0.01f );
112+ try (FDFDocument fdfDoc = Loader .loadXFDF (inputStream ))
113+ {
114+ List <FDFAnnotation > fdfAnnots = fdfDoc .getCatalog ().getFDF ().getAnnotations ();
115+ assertEquals (1 , fdfAnnots .size ());
116+
117+ FDFAnnotation annot = fdfAnnots .get (0 );
118+ assertNotNull (annot .getBorderStyle ());
119+ assertEquals (0f , annot .getBorderStyle ().getWidth (), 0.01f );
120+ }
119121 }
120122
121123}
You can’t perform that action at this time.
0 commit comments