Skip to content

Commit 4b3ba5c

Browse files
Use unicode-characters in strings encoded to make sure they work correctly with odd encodings
Adjust java code in order to fix some autoporting issues. DEVSIX-5706
1 parent b78e1d6 commit 4b3ba5c

File tree

7 files changed

+7
-50
lines changed

7 files changed

+7
-50
lines changed

commons/src/main/java/com/itextpdf/commons/actions/processors/DefaultITextProductEventProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ public String getUsageType() {
6161

6262
@Override
6363
public String getProducer() {
64-
return "iText® ${usedProducts:P V (T 'version')} ©${copyrightSince}-${copyrightTo} iText Group NV";
64+
return "iText\u00ae ${usedProducts:P V (T 'version')} \u00a9${copyrightSince}-${copyrightTo} iText Group NV";
6565
}
6666
}

commons/src/main/java/com/itextpdf/commons/exceptions/ITextException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class ITextException extends RuntimeException {
3333
* Creates a new ITextException with no error message and cause.
3434
*/
3535
public ITextException() {
36-
super();
36+
super(CommonsExceptionMessageConstant.UNKNOWN_ITEXT_EXCEPTION);
3737
}
3838

3939
/**

commons/src/main/java/com/itextpdf/commons/utils/Base64.java

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,3 @@
1-
/*
2-
3-
This file is part of the iText (R) project.
4-
Copyright (c) 1998-2021 iText Group NV
5-
Authors: Bruno Lowagie, Paulo Soares, et al.
6-
7-
This program is free software; you can redistribute it and/or modify
8-
it under the terms of the GNU Affero General Public License version 3
9-
as published by the Free Software Foundation with the addition of the
10-
following permission added to Section 15 as permitted in Section 7(a):
11-
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
12-
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
13-
OF THIRD PARTY RIGHTS
14-
15-
This program is distributed in the hope that it will be useful, but
16-
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17-
or FITNESS FOR A PARTICULAR PURPOSE.
18-
See the GNU Affero General Public License for more details.
19-
You should have received a copy of the GNU Affero General Public License
20-
along with this program; if not, see http://www.gnu.org/licenses or write to
21-
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22-
Boston, MA, 02110-1301 USA, or download the license from the following URL:
23-
http://itextpdf.com/terms-of-use/
24-
25-
The interactive user interfaces in modified source and object code versions
26-
of this program must display Appropriate Legal Notices, as required under
27-
Section 5 of the GNU Affero General Public License.
28-
29-
In accordance with Section 7(b) of the GNU Affero General Public License,
30-
a covered work must retain the producer line in every PDF that is created
31-
or manipulated using iText.
32-
33-
You can be released from the requirements of the license by purchasing
34-
a commercial license. Buying such a license is mandatory as soon as you
35-
develop commercial activities involving the iText software without
36-
disclosing the source code of your own applications.
37-
These activities include: offering paid services to customers as an ASP,
38-
serving PDFs on the fly in a web application, shipping iText with a closed
39-
source product.
40-
41-
For more information, please contact iText Software Corp. at this
42-
43-
*/
441
package com.itextpdf.commons.utils;
452

463
/**

commons/src/test/java/com/itextpdf/commons/actions/AbstractITextConfigurationEventTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void addProcessorTest() {
5252

5353
Map<String, ITextProductEventProcessor> processors = ProductEventHandler.INSTANCE.getProcessors();
5454
Assert.assertEquals(1, processors.size());
55-
Assert.assertTrue(processors.containsValue(processor));
55+
Assert.assertTrue(processors.values().contains(processor));
5656
}
5757

5858
@Test

commons/src/test/java/com/itextpdf/commons/actions/producer/ProducerBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ public void emptyEventsProducerLineTest() {
5757
junitExpectedException.expect(IllegalArgumentException.class);
5858
junitExpectedException.expectMessage(CommonsExceptionMessageConstant.NO_EVENTS_WERE_REGISTERED_FOR_THE_DOCUMENT);
5959

60-
ProducerBuilder.modifyProducer(Collections.emptyList(), null);
60+
ProducerBuilder.modifyProducer(Collections.<AbstractProductProcessITextEvent>emptyList(), null);
6161
}
6262

6363
@Test
6464
public void nullEventsProducerLineTest() {
6565
junitExpectedException.expect(IllegalArgumentException.class);
6666
junitExpectedException.expectMessage(CommonsExceptionMessageConstant.NO_EVENTS_WERE_REGISTERED_FOR_THE_DOCUMENT);
6767

68-
ProducerBuilder.modifyProducer(null, null);
68+
ProducerBuilder.modifyProducer((List<AbstractProductProcessITextEvent>)null, null);
6969
}
7070

7171
@Test

commons/src/test/java/com/itextpdf/commons/exceptions/ITextExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void noParametersConstructorTest() {
3535
Exception exception = Assert.assertThrows(ITextException.class, () -> {
3636
throw new ITextException();
3737
});
38-
Assert.assertNull(exception.getMessage());
38+
Assert.assertEquals(CommonsExceptionMessageConstant.UNKNOWN_ITEXT_EXCEPTION, exception.getMessage());
3939
}
4040

4141
@Test

kernel/src/main/java/com/itextpdf/kernel/actions/events/FlushPdfDocumentEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected void doAction() {
7676
return;
7777
}
7878

79-
final Set<String> products = new HashSet<>(events.size());
79+
final Set<String> products = new HashSet<>();
8080
for (final AbstractProductProcessITextEvent event : events) {
8181
if (event.getConfirmationType() == EventConfirmationType.ON_CLOSE) {
8282
EventManager.getInstance().onEvent(new ConfirmEvent(pdfDocument.getDocumentIdWrapper(), event));

0 commit comments

Comments
 (0)