Skip to content

Commit 9768e46

Browse files
Eugene BochiloBezrukovM
authored andcommitted
Fix sonarqube issues for new_lcns_base branch
DEVSIX-5570
1 parent 114bca1 commit 9768e46

File tree

76 files changed

+526
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+526
-167
lines changed

barcodes/src/main/java/com/itextpdf/barcodes/BarcodeCodabar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ public static byte[] getBarsCodabar(String text) {
178178
for (int k = 0; k < len; ++k) {
179179
int idx = CHARS.indexOf(text.charAt(k));
180180
if (idx >= START_STOP_IDX && k > 0 && k < len - 1) {
181-
throw new IllegalArgumentException(
182-
BarcodeExceptionMessageConstant.IN_CODABAR_START_STOP_CHARACTERS_ARE_ONLY_ALLOWED_AT_THE_EXTREMES);
181+
throw new IllegalArgumentException(BarcodeExceptionMessageConstant.
182+
IN_CODABAR_START_STOP_CHARACTERS_ARE_ONLY_ALLOWED_AT_THE_EXTREMES);
183183
}
184184
if (idx < 0) {
185185
throw new IllegalArgumentException(

commons/src/main/java/com/itextpdf/commons/actions/AbstractContextBasedEventHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public abstract class AbstractContextBasedEventHandler implements IBaseEventHand
3737
*
3838
* @param onUnknownContext is a fallback for events within unknown context
3939
*/
40-
public AbstractContextBasedEventHandler(IContext onUnknownContext) {
40+
protected AbstractContextBasedEventHandler(IContext onUnknownContext) {
4141
super();
4242
this.defaultContext = onUnknownContext;
4343
}

commons/src/main/java/com/itextpdf/commons/actions/AbstractContextBasedITextEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public abstract class AbstractContextBasedITextEvent extends AbstractProductITex
3838
* @param productData is a description of the product which has generated an event
3939
* @param metaInfo is an auxiliary meta info
4040
*/
41-
public AbstractContextBasedITextEvent(ProductData productData, IMetaInfo metaInfo) {
41+
protected AbstractContextBasedITextEvent(ProductData productData, IMetaInfo metaInfo) {
4242
super(productData);
4343
this.metaInfo = metaInfo;
4444
}

commons/src/main/java/com/itextpdf/commons/actions/AbstractEventWrapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public abstract class AbstractEventWrapper extends AbstractProductProcessITextEv
3737
* @param event is a {@link AbstractProductProcessITextEvent} to wrap
3838
* @param confirmationType event confirmation type
3939
*/
40-
public AbstractEventWrapper(AbstractProductProcessITextEvent event, EventConfirmationType confirmationType) {
40+
protected AbstractEventWrapper(AbstractProductProcessITextEvent event, EventConfirmationType confirmationType) {
4141
super(event.getSequenceId(), event.getProductData(), event.getMetaInfo(), confirmationType);
4242
this.event = event;
4343
}
@@ -50,7 +50,8 @@ public AbstractEventWrapper(AbstractProductProcessITextEvent event, EventConfirm
5050
* @param event is a {@link AbstractProductProcessITextEvent} to wrap
5151
* @param confirmationType event confirmation type
5252
*/
53-
public AbstractEventWrapper(SequenceId updatedSequenceId, AbstractProductProcessITextEvent event, EventConfirmationType confirmationType) {
53+
protected AbstractEventWrapper(SequenceId updatedSequenceId,
54+
AbstractProductProcessITextEvent event, EventConfirmationType confirmationType) {
5455
super(updatedSequenceId, event.getProductData(), event.getMetaInfo(), confirmationType);
5556
this.event = event;
5657
}

commons/src/main/java/com/itextpdf/commons/actions/AbstractITextEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public abstract class AbstractITextEvent implements IBaseEvent {
4040
/**
4141
* Creates an instance of abstract iText event. Only for internal usage.
4242
*/
43-
public AbstractITextEvent() {
43+
protected AbstractITextEvent() {
4444
boolean isUnknown = true;
4545
for (String namespace : INTERNAL_PACKAGES.keySet()) {
4646
if (this.getClass().getName().startsWith(namespace)) {

commons/src/main/java/com/itextpdf/commons/actions/AbstractProductITextEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public abstract class AbstractProductITextEvent extends AbstractITextEvent {
3737
*
3838
* @param productData is a description of the product which has generated an event
3939
*/
40-
public AbstractProductITextEvent(ProductData productData) {
40+
protected AbstractProductITextEvent(ProductData productData) {
4141
super();
4242
if (productData == null) {
4343
// IllegalStateException is thrown because AbstractProductITextEvent for internal usage

commons/src/main/java/com/itextpdf/commons/actions/AbstractProductProcessITextEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public abstract class AbstractProductProcessITextEvent extends AbstractContextBa
4545
* @param confirmationType defines when the event should be confirmed to notify that the
4646
* associated process has finished successfully
4747
*/
48-
public AbstractProductProcessITextEvent(SequenceId sequenceId, ProductData productData, IMetaInfo metaInfo,
48+
protected AbstractProductProcessITextEvent(SequenceId sequenceId, ProductData productData, IMetaInfo metaInfo,
4949
EventConfirmationType confirmationType) {
5050
super(productData, metaInfo);
5151

@@ -61,7 +61,7 @@ public AbstractProductProcessITextEvent(SequenceId sequenceId, ProductData produ
6161
* @param confirmationType defines when the event should be confirmed to notify that the
6262
* associated process has finished successfully
6363
*/
64-
public AbstractProductProcessITextEvent(ProductData productData, IMetaInfo metaInfo,
64+
protected AbstractProductProcessITextEvent(ProductData productData, IMetaInfo metaInfo,
6565
EventConfirmationType confirmationType) {
6666
this(null, productData, metaInfo, confirmationType);
6767
}

commons/src/main/java/com/itextpdf/commons/actions/AbstractStatisticsEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public abstract class AbstractStatisticsEvent extends AbstractProductITextEvent
3838
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractStatisticsEvent.class);
3939

4040
/**
41-
* @see AbstractProductITextEvent#AbstractProductITextEvent(ProductData).
41+
* @see AbstractProductITextEvent#AbstractProductITextEvent(ProductData)
4242
*/
4343
protected AbstractStatisticsEvent(ProductData productData) {
4444
super(productData);

commons/src/main/java/com/itextpdf/commons/actions/EventManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public void onEvent(IBaseEvent event) {
7676

7777
if (caughtExceptions.size() == 1) {
7878
throw caughtExceptions.get(0);
79-
} else if (! caughtExceptions.isEmpty()) {
79+
}
80+
if (!caughtExceptions.isEmpty()) {
8081
throw new AggregatedException(AggregatedException.ERROR_DURING_EVENT_PROCESSING, caughtExceptions);
8182
}
8283
}

commons/src/main/java/com/itextpdf/commons/actions/IBaseEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This file is part of the iText (R) project.
2525
/**
2626
* Base marker interface for any generated event of any source.
2727
*
28-
* TODO: DEVSIX-5311 rename it IEvent when the oldest mechanism is deleted
28+
* <p>TODO: DEVSIX-5311 rename it IEvent when the oldest mechanism is deleted
2929
*/
3030
public interface IBaseEvent {
3131
}

0 commit comments

Comments
 (0)