You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/05/16 15:17:57 UTC
[commons-imaging] 12/14: Encapsulate PngChunkZtxt
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git
commit 06b092615530efbd16b0299bada1c9d81a4c4f65
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 16 10:52:19 2023 -0400
Encapsulate PngChunkZtxt
---
.../apache/commons/imaging/formats/png/PngImageParser.java | 2 +-
.../commons/imaging/formats/png/chunks/PngChunkZtxt.java | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
index 5f8d6e79..225f2e17 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
@@ -452,7 +452,7 @@ public class PngImageParser extends ImageParser<PngImagingParameters> implement
}
for (final PngChunk zTXt : zTXts) {
final PngChunkZtxt pngChunkzTXt = (PngChunkZtxt) zTXt;
- comments.add(pngChunkzTXt.keyword + ": " + pngChunkzTXt.text);
+ comments.add(pngChunkzTXt.getKeyword() + ": " + pngChunkzTXt.getText());
textChunks.add(pngChunkzTXt.getContents());
}
for (final PngChunk iTXt : iTXts) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java b/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java
index 6cc3827a..53fe00c3 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java
@@ -31,8 +31,8 @@ import org.apache.commons.imaging.formats.png.PngText;
public class PngChunkZtxt extends PngTextChunk {
- public final String keyword;
- public final String text;
+ private final String keyword;
+ private final String text;
public PngChunkZtxt(final int length, final int chunkType, final int crc, final byte[] bytes)
throws ImagingException, IOException {
@@ -67,7 +67,9 @@ public class PngChunkZtxt extends PngTextChunk {
}
/**
- * @return Returns the keyword.
+ * Gets the keyword.
+ *
+ * @return the keyword.
*/
@Override
public String getKeyword() {
@@ -75,7 +77,9 @@ public class PngChunkZtxt extends PngTextChunk {
}
/**
- * @return Returns the text.
+ * Gets the text.
+ *
+ * @return the text.
*/
@Override
public String getText() {