Skip to content

Commit 3f3f28e

Browse files
committed
Fix single line comments.
By \"[;,{}|()][ \\t]*//\" regexp DEVSIX-3314 Autoported commit. Original commit hash: [ed6b5b94e] Manual files: io/src/main/java/com/itextpdf/io/source/RandomAccessSourceFactory.java
1 parent 1134987 commit 3f3f28e

29 files changed

+264
-257
lines changed

itext.tests/itext.kernel.tests/itext/kernel/pdf/PdfFontTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,9 +1195,8 @@ public virtual void NotoSansCJKjpTest03() {
11951195
// font.setSubset(false);
11961196
PdfCanvas canvas = new PdfCanvas(page);
11971197
canvas.SaveState().SetFillColor(ColorConstants.RED).BeginText().MoveText(36, 680).SetFontAndSize(font, 12)
1198-
.ShowText("\u0BA4")
11991198
// there is no such glyph in provided cff
1200-
.EndText().RestoreState();
1199+
.ShowText("\u0BA4").EndText().RestoreState();
12011200
doc.Close();
12021201
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(filename, cmpFilename, destinationFolder,
12031202
"diff_"));

itext/itext.barcodes/itext/barcodes/BarcodeCodabar.cs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,47 +57,48 @@ public class BarcodeCodabar : Barcode1D {
5757
private const int START_STOP_IDX = 16;
5858

5959
/// <summary>The bars to generate the code.</summary>
60-
private static readonly byte[][] BARS = new byte[][] { new byte[] { 0, 0, 0, 0, 0, 1, 1 },
60+
private static readonly byte[][] BARS = new byte[][] {
6161
// 0
62-
new byte[] { 0, 0, 0, 0, 1, 1, 0 },
62+
new byte[] { 0, 0, 0, 0, 0, 1, 1 },
6363
// 1
64-
new byte[] { 0, 0, 0, 1, 0, 0, 1 },
64+
new byte[] { 0, 0, 0, 0, 1, 1, 0 },
6565
// 2
66-
new byte[] { 1, 1, 0, 0, 0, 0, 0 },
66+
new byte[] { 0, 0, 0, 1, 0, 0, 1 },
6767
// 3
68-
new byte[] { 0, 0, 1, 0, 0, 1, 0 },
68+
new byte[] { 1, 1, 0, 0, 0, 0, 0 },
6969
// 4
70-
new byte[] { 1, 0, 0, 0, 0, 1, 0 },
70+
new byte[] { 0, 0, 1, 0, 0, 1, 0 },
7171
// 5
72-
new byte[] { 0, 1, 0, 0, 0, 0, 1 },
72+
new byte[] { 1, 0, 0, 0, 0, 1, 0 },
7373
// 6
74-
new byte[] { 0, 1, 0, 0, 1, 0, 0 },
74+
new byte[] { 0, 1, 0, 0, 0, 0, 1 },
7575
// 7
76-
new byte[] { 0, 1, 1, 0, 0, 0, 0 },
76+
new byte[] { 0, 1, 0, 0, 1, 0, 0 },
7777
// 8
78-
new byte[] { 1, 0, 0, 1, 0, 0, 0 },
78+
new byte[] { 0, 1, 1, 0, 0, 0, 0 },
7979
// 9
80-
new byte[] { 0, 0, 0, 1, 1, 0, 0 },
80+
new byte[] { 1, 0, 0, 1, 0, 0, 0 },
8181
// -
82-
new byte[] { 0, 0, 1, 1, 0, 0, 0 },
82+
new byte[] { 0, 0, 0, 1, 1, 0, 0 },
8383
// $
84-
new byte[] { 1, 0, 0, 0, 1, 0, 1 },
84+
new byte[] { 0, 0, 1, 1, 0, 0, 0 },
8585
// :
86-
new byte[] { 1, 0, 1, 0, 0, 0, 1 },
86+
new byte[] { 1, 0, 0, 0, 1, 0, 1 },
8787
// /
88-
new byte[] { 1, 0, 1, 0, 1, 0, 0 },
88+
new byte[] { 1, 0, 1, 0, 0, 0, 1 },
8989
// .
90-
new byte[] { 0, 0, 1, 0, 1, 0, 1 },
90+
new byte[] { 1, 0, 1, 0, 1, 0, 0 },
9191
// +
92-
new byte[] { 0, 0, 1, 1, 0, 1, 0 },
92+
new byte[] { 0, 0, 1, 0, 1, 0, 1 },
9393
// a
94-
new byte[] { 0, 1, 0, 1, 0, 0, 1 },
94+
new byte[] { 0, 0, 1, 1, 0, 1, 0 },
9595
// b
96-
new byte[] { 0, 0, 0, 1, 0, 1, 1 },
96+
new byte[] { 0, 1, 0, 1, 0, 0, 1 },
9797
// c
98+
new byte[] { 0, 0, 0, 1, 0, 1, 1 },
99+
// d
98100
new byte[] { 0, 0, 0, 1, 1, 1, 0 } };
99101

100-
// d
101102
/// <summary>Creates a new BarcodeCodabar.</summary>
102103
/// <remarks>
103104
/// Creates a new BarcodeCodabar.

itext/itext.barcodes/itext/barcodes/BarcodeEAN.cs

Lines changed: 49 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,28 @@ public class BarcodeEAN : Barcode1D {
9494
, 60.5f };
9595

9696
/// <summary>The basic bar widths.</summary>
97-
private static readonly byte[][] BARS = new byte[][] { new byte[] { 3, 2, 1, 1 },
97+
private static readonly byte[][] BARS = new byte[][] {
9898
// 0
99-
new byte[] { 2, 2, 2, 1 },
99+
new byte[] { 3, 2, 1, 1 },
100100
// 1
101-
new byte[] { 2, 1, 2, 2 },
101+
new byte[] { 2, 2, 2, 1 },
102102
// 2
103-
new byte[] { 1, 4, 1, 1 },
103+
new byte[] { 2, 1, 2, 2 },
104104
// 3
105-
new byte[] { 1, 1, 3, 2 },
105+
new byte[] { 1, 4, 1, 1 },
106106
// 4
107-
new byte[] { 1, 2, 3, 1 },
107+
new byte[] { 1, 1, 3, 2 },
108108
// 5
109-
new byte[] { 1, 1, 1, 4 },
109+
new byte[] { 1, 2, 3, 1 },
110110
// 6
111-
new byte[] { 1, 3, 1, 2 },
111+
new byte[] { 1, 1, 1, 4 },
112112
// 7
113-
new byte[] { 1, 2, 1, 3 },
113+
new byte[] { 1, 3, 1, 2 },
114114
// 8
115+
new byte[] { 1, 2, 1, 3 },
116+
// 9
115117
new byte[] { 3, 1, 1, 2 } };
116118

117-
// 9
118119
/// <summary>The total number of bars for EAN13.</summary>
119120
private const int TOTALBARS_EAN13 = 11 + 12 * 4;
120121

@@ -137,81 +138,85 @@ public class BarcodeEAN : Barcode1D {
137138
private const int EVEN = 1;
138139

139140
/// <summary>Sequence of parities to be used with EAN13.</summary>
140-
private static readonly byte[][] PARITY13 = new byte[][] { new byte[] { ODD, ODD, ODD, ODD, ODD, ODD },
141+
private static readonly byte[][] PARITY13 = new byte[][] {
141142
// 0
142-
new byte[] { ODD, ODD, EVEN, ODD, EVEN, EVEN },
143+
new byte[] { ODD, ODD, ODD, ODD, ODD, ODD },
143144
// 1
144-
new byte[] { ODD, ODD, EVEN, EVEN, ODD, EVEN },
145+
new byte[] { ODD, ODD, EVEN, ODD, EVEN, EVEN },
145146
// 2
146-
new byte[] { ODD, ODD, EVEN, EVEN, EVEN, ODD },
147+
new byte[] { ODD, ODD, EVEN, EVEN, ODD, EVEN },
147148
// 3
148-
new byte[] { ODD, EVEN, ODD, ODD, EVEN, EVEN },
149+
new byte[] { ODD, ODD, EVEN, EVEN, EVEN, ODD },
149150
// 4
150-
new byte[] { ODD, EVEN, EVEN, ODD, ODD, EVEN },
151+
new byte[] { ODD, EVEN, ODD, ODD, EVEN, EVEN },
151152
// 5
152-
new byte[] { ODD, EVEN, EVEN, EVEN, ODD, ODD },
153+
new byte[] { ODD, EVEN, EVEN, ODD, ODD, EVEN },
153154
// 6
154-
new byte[] { ODD, EVEN, ODD, EVEN, ODD, EVEN },
155+
new byte[] { ODD, EVEN, EVEN, EVEN, ODD, ODD },
155156
// 7
156-
new byte[] { ODD, EVEN, ODD, EVEN, EVEN, ODD },
157+
new byte[] { ODD, EVEN, ODD, EVEN, ODD, EVEN },
157158
// 8
159+
new byte[] { ODD, EVEN, ODD, EVEN, EVEN, ODD },
160+
// 9
158161
new byte[] { ODD, EVEN, EVEN, ODD, EVEN, ODD } };
159162

160-
// 9
161163
/// <summary>Sequence of parities to be used with supplemental 2.</summary>
162-
private static readonly byte[][] PARITY2 = new byte[][] { new byte[] { ODD, ODD },
164+
private static readonly byte[][] PARITY2 = new byte[][] {
163165
// 0
164-
new byte[] { ODD, EVEN },
166+
new byte[] { ODD, ODD },
165167
// 1
166-
new byte[] { EVEN, ODD },
168+
new byte[] { ODD, EVEN },
167169
// 2
170+
new byte[] { EVEN, ODD },
171+
// 3
168172
new byte[] { EVEN, EVEN } };
169173

170-
// 3
171174
/// <summary>Sequence of parities to be used with supplemental 2.</summary>
172-
private static readonly byte[][] PARITY5 = new byte[][] { new byte[] { EVEN, EVEN, ODD, ODD, ODD },
175+
private static readonly byte[][] PARITY5 = new byte[][] {
173176
// 0
174-
new byte[] { EVEN, ODD, EVEN, ODD, ODD },
177+
new byte[] { EVEN, EVEN, ODD, ODD, ODD },
175178
// 1
176-
new byte[] { EVEN, ODD, ODD, EVEN, ODD },
179+
new byte[] { EVEN, ODD, EVEN, ODD, ODD },
177180
// 2
178-
new byte[] { EVEN, ODD, ODD, ODD, EVEN },
181+
new byte[] { EVEN, ODD, ODD, EVEN, ODD },
179182
// 3
180-
new byte[] { ODD, EVEN, EVEN, ODD, ODD },
183+
new byte[] { EVEN, ODD, ODD, ODD, EVEN },
181184
// 4
182-
new byte[] { ODD, ODD, EVEN, EVEN, ODD },
185+
new byte[] { ODD, EVEN, EVEN, ODD, ODD },
183186
// 5
184-
new byte[] { ODD, ODD, ODD, EVEN, EVEN },
187+
new byte[] { ODD, ODD, EVEN, EVEN, ODD },
185188
// 6
186-
new byte[] { ODD, EVEN, ODD, EVEN, ODD },
189+
new byte[] { ODD, ODD, ODD, EVEN, EVEN },
187190
// 7
188-
new byte[] { ODD, EVEN, ODD, ODD, EVEN },
191+
new byte[] { ODD, EVEN, ODD, EVEN, ODD },
189192
// 8
193+
new byte[] { ODD, EVEN, ODD, ODD, EVEN },
194+
// 9
190195
new byte[] { ODD, ODD, EVEN, ODD, EVEN } };
191196

192-
// 9
193197
/// <summary>Sequence of parities to be used with UPCE.</summary>
194-
private static readonly byte[][] PARITYE = new byte[][] { new byte[] { EVEN, EVEN, EVEN, ODD, ODD, ODD },
198+
private static readonly byte[][] PARITYE = new byte[][] {
195199
// 0
196-
new byte[] { EVEN, EVEN, ODD, EVEN, ODD, ODD },
200+
new byte[] { EVEN, EVEN, EVEN, ODD, ODD, ODD },
197201
// 1
198-
new byte[] { EVEN, EVEN, ODD, ODD, EVEN, ODD },
202+
new byte[] { EVEN, EVEN, ODD, EVEN, ODD, ODD },
199203
// 2
200-
new byte[] { EVEN, EVEN, ODD, ODD, ODD, EVEN },
204+
new byte[] { EVEN, EVEN, ODD, ODD, EVEN, ODD },
201205
// 3
202-
new byte[] { EVEN, ODD, EVEN, EVEN, ODD, ODD },
206+
new byte[] { EVEN, EVEN, ODD, ODD, ODD, EVEN },
203207
// 4
204-
new byte[] { EVEN, ODD, ODD, EVEN, EVEN, ODD },
208+
new byte[] { EVEN, ODD, EVEN, EVEN, ODD, ODD },
205209
// 5
206-
new byte[] { EVEN, ODD, ODD, ODD, EVEN, EVEN },
210+
new byte[] { EVEN, ODD, ODD, EVEN, EVEN, ODD },
207211
// 6
208-
new byte[] { EVEN, ODD, EVEN, ODD, EVEN, ODD },
212+
new byte[] { EVEN, ODD, ODD, ODD, EVEN, EVEN },
209213
// 7
210-
new byte[] { EVEN, ODD, EVEN, ODD, ODD, EVEN },
214+
new byte[] { EVEN, ODD, EVEN, ODD, EVEN, ODD },
211215
// 8
216+
new byte[] { EVEN, ODD, EVEN, ODD, ODD, EVEN },
217+
// 9
212218
new byte[] { EVEN, ODD, ODD, EVEN, ODD, EVEN } };
213219

214-
// 9
215220
/// <summary>Creates new BarcodeEAN.</summary>
216221
/// <remarks>
217222
/// Creates new BarcodeEAN.

itext/itext.barcodes/itext/barcodes/BarcodeMSI.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,28 @@ public class BarcodeMSI : Barcode1D {
6868
private static readonly byte[] BARS_END = new byte[] { 1, 0, 0, 1 };
6969

7070
/// <summary>The bars to generate the code.</summary>
71-
private static readonly byte[][] BARS = new byte[][] { new byte[] { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 },
71+
private static readonly byte[][] BARS = new byte[][] {
7272
// 0
73-
new byte[] { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 },
73+
new byte[] { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 },
7474
// 1
75-
new byte[] { 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0 },
75+
new byte[] { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 },
7676
// 2
77-
new byte[] { 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0 },
77+
new byte[] { 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0 },
7878
// 3
79-
new byte[] { 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0 },
79+
new byte[] { 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0 },
8080
// 4
81-
new byte[] { 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0 },
81+
new byte[] { 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0 },
8282
// 5
83-
new byte[] { 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0 },
83+
new byte[] { 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0 },
8484
// 6
85-
new byte[] { 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0 },
85+
new byte[] { 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0 },
8686
// 7
87-
new byte[] { 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 },
87+
new byte[] { 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0 },
8888
// 8
89+
new byte[] { 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 },
90+
// 9
8991
new byte[] { 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 } };
9092

91-
// 9
9293
/// <summary>The number of individual bars either drawn or not drawn per character of the <c>code</c></summary>
9394
private const int BARS_PER_CHARACTER = 12;
9495

itext/itext.barcodes/itext/barcodes/qrcode/BitArray.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ public bool IsRange(int start, int end, bool value) {
110110
throw new ArgumentException();
111111
}
112112
if (end == start) {
113+
// empty range matches
113114
return true;
114115
}
115-
// empty range matches
116-
end--;
117116
// will be easier to treat this as the last actually set bit -- inclusive
117+
end--;
118118
int firstInt = start >> 5;
119119
int lastInt = end >> 5;
120120
for (int i = firstInt; i <= lastInt; i++) {

itext/itext.barcodes/itext/barcodes/qrcode/Encoder.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ namespace iText.Barcodes.Qrcode {
4949
/// <author>[email protected] (Daniel Switkin) - ported from C++</author>
5050
internal sealed class Encoder {
5151
// The original table is defined in the table 5 of JISX0510:2004 (p.19).
52-
private static readonly int[] ALPHANUMERIC_TABLE = new int[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
53-
-1, -1, -1, -1, -1,
52+
private static readonly int[] ALPHANUMERIC_TABLE = new int[] {
5453
// 0x00-0x0f
5554
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5655
// 0x10-0x1f
57-
36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43,
56+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5857
// 0x20-0x2f
59-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1,
58+
36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43,
6059
// 0x30-0x3f
61-
-1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
60+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1,
6261
// 0x40-0x4f
62+
-1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
63+
// 0x50-0x5f
6364
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1 };
6465

65-
// 0x50-0x5f
6666
internal const String DEFAULT_BYTE_MODE_ENCODING = "ISO-8859-1";
6767

6868
private Encoder() {
@@ -251,8 +251,8 @@ private static bool IsOnlyDoubleByteKanji(String content) {
251251

252252
private static int ChooseMaskPattern(BitVector bits, ErrorCorrectionLevel ecLevel, int version, ByteMatrix
253253
matrix) {
254-
int minPenalty = int.MaxValue;
255254
// Lower penalty is better.
255+
int minPenalty = int.MaxValue;
256256
int bestMaskPattern = -1;
257257
// We try all mask patterns to choose the best one.
258258
for (int maskPattern = 0; maskPattern < QRCode.NUM_MASK_PATTERNS; maskPattern++) {
@@ -446,8 +446,8 @@ internal static void InterleaveWithECBytes(BitVector bits, int numTotalBytes, in
446446
}
447447
}
448448
}
449+
// Should be same.
449450
if (numTotalBytes != result.SizeInBytes()) {
450-
// Should be same.
451451
throw new WriterException("Interleaving error: " + numTotalBytes + " and " + result.SizeInBytes() + " differ."
452452
);
453453
}

itext/itext.barcodes/itext/barcodes/qrcode/FormatInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ private FormatInformation(int formatInfo) {
8181
}
8282

8383
internal static int NumBitsDiffering(int a, int b) {
84-
a ^= b;
8584
// a now has a 1 bit exactly where its bit differs with b's
85+
a ^= b;
8686
// Count bits set quickly with a series of lookups:
8787
return BITS_SET_IN_HALF_BYTE[a & 0x0F] + BITS_SET_IN_HALF_BYTE[((int)(((uint)a) >> 4) & 0x0F)] + BITS_SET_IN_HALF_BYTE
8888
[((int)(((uint)a) >> 8) & 0x0F)] + BITS_SET_IN_HALF_BYTE[((int)(((uint)a) >> 12) & 0x0F)] + BITS_SET_IN_HALF_BYTE

itext/itext.barcodes/itext/barcodes/qrcode/GF256.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ namespace iText.Barcodes.Qrcode {
5858
/// </remarks>
5959
/// <author>Sean Owen</author>
6060
internal sealed class GF256 {
61+
// x^8 + x^4 + x^3 + x^2 + 1
6162
public static readonly iText.Barcodes.Qrcode.GF256 QR_CODE_FIELD = new iText.Barcodes.Qrcode.GF256(0x011D);
6263

63-
// x^8 + x^4 + x^3 + x^2 + 1
64+
// x^8 + x^5 + x^3 + x^2 + 1
6465
public static readonly iText.Barcodes.Qrcode.GF256 DATA_MATRIX_FIELD = new iText.Barcodes.Qrcode.GF256(0x012D
6566
);
6667

67-
// x^8 + x^5 + x^3 + x^2 + 1
6868
private readonly int[] expTable;
6969

7070
private readonly int[] logTable;
@@ -85,8 +85,8 @@ private GF256(int primitive) {
8585
int x = 1;
8686
for (int i = 0; i < 256; i++) {
8787
expTable[i] = x;
88-
x <<= 1;
8988
// x = x * 2; we're assuming the generator alpha is 2
89+
x <<= 1;
9090
if (x >= 0x100) {
9191
x ^= primitive;
9292
}

itext/itext.barcodes/itext/barcodes/qrcode/MaskUtil.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ private static int ApplyMaskPenaltyRule1Internal(ByteMatrix matrix, bool isHoriz
250250
}
251251
}
252252
else {
253-
numSameBitCells = 1;
254253
// Include the cell itself.
254+
numSameBitCells = 1;
255255
prevBit = bit;
256256
}
257257
}
258+
// Clear at each row/column.
258259
numSameBitCells = 0;
259260
}
260-
// Clear at each row/column.
261261
return penalty;
262262
}
263263
}

0 commit comments

Comments
 (0)