Skip to content

Commit 029c7da

Browse files
committed
Expand single-line Javadocs to multi-line
Addresses the checkstyle 'single-line Javadoc comment should be multi-line' rule on the new openpdf-core renderer code. Affects ten one-line Javadocs across OpenPdfCorePageRenderer and one in OpenPdfCoreRenderer; behavior unchanged.
1 parent 5c7f0af commit 029c7da

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

openpdf-renderer/src/main/java/org/openpdf/renderer/core/OpenPdfCorePageRenderer.java

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ final class OpenPdfCorePageRenderer {
101101

102102
private static final Logger LOG = Logger.getLogger(OpenPdfCorePageRenderer.class.getName());
103103

104-
/** Default user-space resolution of a PDF, in DPI. */
104+
/**
105+
* Default user-space resolution of a PDF, in DPI.
106+
*/
105107
private static final float PDF_USER_SPACE_DPI = 72f;
106108

107109
// ExtGState dictionary keys not pre-defined as PdfName constants in openpdf-core.
@@ -273,7 +275,9 @@ private static byte[] stripInlineImages(byte[] content) {
273275
return out.toByteArray();
274276
}
275277

276-
/** Finds the offset of a two-byte token (e.g. {@code "BI"}) bounded by whitespace. */
278+
/**
279+
* Finds the offset of a two-byte token (e.g. {@code "BI"}) bounded by whitespace.
280+
*/
277281
private static int findToken(byte[] buf, int from, char c1, char c2) {
278282
for (int i = from; i < buf.length - 1; i++) {
279283
if (buf[i] != c1 || buf[i + 1] != c2) {
@@ -288,7 +292,9 @@ private static int findToken(byte[] buf, int from, char c1, char c2) {
288292
return -1;
289293
}
290294

291-
/** Returns the index just past the closing {@code EI} of an inline image starting after {@code BI}. */
295+
/**
296+
* Returns the index just past the closing {@code EI} of an inline image starting after {@code BI}.
297+
*/
292298
private static int findEndInlineImage(byte[] buf, int from) {
293299
for (int i = from; i < buf.length - 1; i++) {
294300
if (buf[i] != 'E' || buf[i + 1] != 'I') {
@@ -307,7 +313,9 @@ private static boolean isPdfWhitespace(byte b) {
307313
return b == ' ' || b == '\t' || b == '\n' || b == '\r' || b == '\f' || b == 0;
308314
}
309315

310-
/** Dispatches one operator. Operands include the trailing operator literal at index size-1. */
316+
/**
317+
* Dispatches one operator. Operands include the trailing operator literal at index size-1.
318+
*/
311319
private void dispatch(String op, List<PdfObject> operands) throws IOException {
312320
switch (op) {
313321
// --- Graphics state ---
@@ -865,7 +873,9 @@ private static boolean hasFilter(PdfObject filterObj, PdfName name) {
865873
return false;
866874
}
867875

868-
/** Decodes DCT/JPX-encoded image streams via the JRE's {@link ImageIO}. */
876+
/**
877+
* Decodes DCT/JPX-encoded image streams via the JRE's {@link ImageIO}.
878+
*/
869879
private BufferedImage decodeViaImageIO(PRStream stream) {
870880
try {
871881
byte[] raw = PdfReader.getStreamBytesRaw(stream);
@@ -920,7 +930,9 @@ private BufferedImage decodeRawRaster(PRStream stream, int width, int height) {
920930
}
921931
}
922932

923-
/** Returns the number of color components for a {@code /ColorSpace} entry, or 0 if unsupported. */
933+
/**
934+
* Returns the number of color components for a {@code /ColorSpace} entry, or 0 if unsupported.
935+
*/
924936
private static int imageComponents(PdfObject csObj) {
925937
if (csObj instanceof PRIndirectReference ind) {
926938
csObj = PdfReader.getPdfObject(ind);
@@ -1158,7 +1170,9 @@ private static Color rgb(float r, float g, float b) {
11581170
return new Color(clamp01(r), clamp01(g), clamp01(b));
11591171
}
11601172

1161-
/** Naive CMYK to sRGB approximation: r = (1-c)(1-k), g = (1-m)(1-k), b = (1-y)(1-k). */
1173+
/**
1174+
* Naive CMYK to sRGB approximation: r = (1-c)(1-k), g = (1-m)(1-k), b = (1-y)(1-k).
1175+
*/
11621176
private static Color cmyk(float c, float m, float y, float k) {
11631177
float cc = clamp01(c);
11641178
float mm = clamp01(m);
@@ -1204,7 +1218,9 @@ private static Color defaultColorFor(ColorSpaceKind kind) {
12041218
return kind == ColorSpaceKind.CMYK ? cmyk(0, 0, 0, 1f) : Color.BLACK;
12051219
}
12061220

1207-
/** Picks numeric operands matching the active color space; non-numeric operands (e.g. pattern names) yield default. */
1221+
/**
1222+
* Picks numeric operands matching the active color space; non-numeric operands (e.g. pattern names) yield default.
1223+
*/
12081224
private static Color colorFromOperands(ColorSpaceKind kind, List<PdfObject> operands) {
12091225
int numericCount = 0;
12101226
for (int i = 0; i < operands.size() - 1; i++) {
@@ -1256,7 +1272,9 @@ private static float clamp01(float v) {
12561272

12571273
private enum ColorSpaceKind { GRAY, RGB, CMYK, UNKNOWN }
12581274

1259-
/** Mutable per-graphics-state snapshot. Not thread-safe. */
1275+
/**
1276+
* Mutable per-graphics-state snapshot. Not thread-safe.
1277+
*/
12601278
private static final class GState {
12611279
Color fillColor = Color.BLACK;
12621280
Color strokeColor = Color.BLACK;

openpdf-renderer/src/main/java/org/openpdf/renderer/core/OpenPdfCoreRenderer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474
*/
7575
public class OpenPdfCoreRenderer implements Closeable {
7676

77-
/** Default user-space resolution of a PDF, in DPI. */
77+
/**
78+
* Default user-space resolution of a PDF, in DPI.
79+
*/
7880
private static final float PDF_USER_SPACE_DPI = 72f;
7981

8082
private final PdfReader reader;

0 commit comments

Comments
 (0)