Skip to content

Commit

Permalink
added AutoCloseable annotations on classes, that already implement th…
Browse files Browse the repository at this point in the history
…e close method (#831)

removed it from Document, because it inherits/implements it now transitively via DocListener
  • Loading branch information
SirLefti committed Nov 1, 2023
1 parent 70880c2 commit 2efec11
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion openpdf/src/main/java/com/lowagie/text/DocListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* @see DocWriter
*/

public interface DocListener extends ElementListener {
public interface DocListener extends ElementListener, AutoCloseable {

// methods

Expand Down
2 changes: 1 addition & 1 deletion openpdf/src/main/java/com/lowagie/text/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
* </BLOCKQUOTE>
*/

public class Document implements AutoCloseable, DocListener {
public class Document implements DocListener {

// membervariables
private static final String VERSION_PROPERTIES = "com/lowagie/text/version.properties";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* @author Joakim Sandstroem
* Created on 6.9.2006
*/
public class MappedRandomAccessFile {
public class MappedRandomAccessFile implements AutoCloseable {

private MappedByteBuffer mappedByteBuffer = null;
private FileChannel channel = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
*
* @author Paulo Soares (psoares@consiste.pt)
*/
public class PRTokeniser {
public class PRTokeniser implements AutoCloseable {

public static final int TK_NUMBER = 1;
public static final int TK_STRING = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
* @author Paulo Soares (psoares@consiste.pt)
*/
public class PdfCopyFields
implements PdfViewerPreferences, PdfEncryptionSettings {
implements PdfViewerPreferences, PdfEncryptionSettings, AutoCloseable {

private PdfCopyFieldsImp fc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* @since 2.1.5
*/
public class PdfCopyForms
implements PdfViewerPreferences, PdfEncryptionSettings {
implements PdfViewerPreferences, PdfEncryptionSettings, AutoCloseable {

/** The class with the actual implementations. */
private PdfCopyFormsImp fc;
Expand Down
2 changes: 1 addition & 1 deletion openpdf/src/main/java/com/lowagie/text/pdf/PdfStamper.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
* @author Paulo Soares (psoares@consiste.pt)
*/
public class PdfStamper
implements PdfViewerPreferences, PdfEncryptionSettings {
implements PdfViewerPreferences, PdfEncryptionSettings, AutoCloseable {
/**
* The writer
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* Metadata to a PDF Dictionary. Remark that this class doesn't cover the
* complete XMP specification.
*/
public class XmpWriter {
public class XmpWriter implements AutoCloseable {

/** A possible charset for the XMP. */
public static final String UTF8 = "UTF-8";
Expand Down

0 comments on commit 2efec11

Please sign in to comment.