formatting

This commit is contained in:
ftiercelin 2024-10-22 13:55:32 +01:00
parent 475288d4c4
commit 506e865457
2 changed files with 5 additions and 3 deletions

View file

@ -176,11 +176,11 @@ final class PDF417HighLevelEncoder {
} }
if (Compaction.TEXT == compaction) { if (Compaction.TEXT == compaction) {
checkCharset(msg,127,"Consider specifying Compaction.AUTO instead of Compaction.TEXT"); checkCharset(msg, 127, "Consider specifying Compaction.AUTO instead of Compaction.TEXT");
} }
if (encoding == null && !autoECI) { if (encoding == null && !autoECI) {
checkCharset(msg,255,"Consider specifying EncodeHintType.PDF417_AUTO_ECI and/or EncodeTypeHint.CHARACTER_SET."); checkCharset(msg, 255, "Consider specifying EncodeHintType.PDF417_AUTO_ECI and/or EncodeTypeHint.CHARACTER_SET");
} }
//the codewords 0..928 are encoded as Unicode characters //the codewords 0..928 are encoded as Unicode characters
@ -290,7 +290,7 @@ final class PDF417HighLevelEncoder {
* @param errorMessage the message to explain the error * @param errorMessage the message to explain the error
* @throws WriterException exception highlighting the offending character and a suggestion to avoid the error * @throws WriterException exception highlighting the offending character and a suggestion to avoid the error
*/ */
protected static void checkCharset(String input,int max, String errorMessage) throws WriterException { protected static void checkCharset(String input, int max, String errorMessage) throws WriterException {
for (int i = 0; i < input.length(); i++) { for (int i = 0; i < input.length(); i++) {
if (input.charAt(i) > max) { if (input.charAt(i) > max) {
throw new WriterException("Non-encodable character detected: " + input.charAt(i) + " (Unicode: " + throw new WriterException("Non-encodable character detected: " + input.charAt(i) + " (Unicode: " +

View file

@ -35,7 +35,9 @@ import org.junit.Test;
* Tests {@link PDF417HighLevelEncoder}. * Tests {@link PDF417HighLevelEncoder}.
*/ */
public final class PDF417EncoderTestCase extends Assert { public final class PDF417EncoderTestCase extends Assert {
private static final String PDF417PFX = "\u039f\u001A\u0385"; private static final String PDF417PFX = "\u039f\u001A\u0385";
@Test @Test
public void testEncodeAuto() throws Exception { public void testEncodeAuto() throws Exception {
String input = "ABCD"; String input = "ABCD";