Skip to content

Commit cf313e7

Browse files
AlexanderRasolkoiText-CI
authored andcommitted
Set zero or negative size log message level to INFO for drawBackground method
DEVSIX-4191
1 parent 96fadd7 commit cf313e7

File tree

6 files changed

+3
-11
lines changed

6 files changed

+3
-11
lines changed

forms/src/test/java/com/itextpdf/forms/PdfFormFieldTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,6 @@ public void choiceFieldAutoSize01Test() throws IOException, InterruptedException
13131313
}
13141314

13151315
@Test
1316-
@LogMessages(messages = {@LogMessage(messageTemplate = LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES)})
13171316
public void choiceFieldAutoSize02Test() throws IOException, InterruptedException {
13181317
String filename = destinationFolder + "choiceFieldAutoSize02Test.pdf";
13191318
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(filename));

layout/src/main/java/com/itextpdf/layout/renderer/AbstractRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ public void drawBackground(DrawContext drawContext) {
508508
Rectangle backgroundArea = getBackgroundArea(applyMargins(bBox, false));
509509
if (backgroundArea.getWidth() <= 0 || backgroundArea.getHeight() <= 0) {
510510
Logger logger = LoggerFactory.getLogger(AbstractRenderer.class);
511-
logger.warn(MessageFormatUtil.format(LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES, "background"));
511+
logger.info(MessageFormatUtil.format(LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES, "background"));
512512
} else {
513513
boolean backgroundAreaIsClipped = false;
514514
if (background != null) {
@@ -546,7 +546,7 @@ public void drawBackground(DrawContext drawContext) {
546546
}
547547
if (imageRectangle.getWidth() <= 0 || imageRectangle.getHeight() <= 0) {
548548
Logger logger = LoggerFactory.getLogger(AbstractRenderer.class);
549-
logger.warn(MessageFormatUtil.format(LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES, "background-image"));
549+
logger.info(MessageFormatUtil.format(LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES, "background-image"));
550550
} else {
551551
applyBorderBox(backgroundArea, true);
552552
drawContext.getCanvas().saveState().rectangle(backgroundArea).clip().endPath();

layout/src/test/java/com/itextpdf/layout/BlockTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,6 @@ public void blockFillAvailableArea01() throws IOException, InterruptedException
704704
}
705705

706706
@Test
707-
@LogMessages(messages = @LogMessage(messageTemplate = LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES))
708707
public void marginsBordersPaddingOverflow01() throws IOException, InterruptedException {
709708
String outFileName = destinationFolder + "marginsBordersPaddingOverflow01.pdf";
710709
String cmpFileName = sourceFolder + "cmp_marginsBordersPaddingOverflow01.pdf";

layout/src/test/java/com/itextpdf/layout/DefaultLayoutTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ public void rendererTest01() throws IOException, InterruptedException {
114114
}
115115

116116
@Test
117-
@LogMessages(messages = {
118-
@LogMessage(messageTemplate = LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES, count = 1)
119-
})
120117
public void emptyParagraphsTest01() throws IOException, InterruptedException {
121118
String outFileName = destinationFolder + "emptyParagraphsTest01.pdf";
122119
String cmpFileName = sourceFolder + "cmp_emptyParagraphsTest01.pdf";

layout/src/test/java/com/itextpdf/layout/KeepTogetherTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,9 +901,7 @@ public void keepTogetherOnInnerElementMargin02EmptyPageTest() throws IOException
901901

902902
@Test
903903
@LogMessages(messages = {
904-
@LogMessage(messageTemplate = LogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA),
905-
@LogMessage(messageTemplate = LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES),
906-
904+
@LogMessage(messageTemplate = LogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA)
907905
})
908906
public void smallFloatInsideKeptTogetherTableTest01() throws IOException, InterruptedException {
909907
String cmpFileName = sourceFolder + "cmp_smallFloatInsideKeptTogetherTableTest01.pdf";

layout/src/test/java/com/itextpdf/layout/LayoutTaggingTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,6 @@ public void tableWithCaption01() throws IOException, ParserConfigurationExceptio
956956
}
957957

958958
@Test
959-
@LogMessages(messages = {@LogMessage(messageTemplate = LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES, count = 2)})
960959
public void emptyDivTest() throws IOException, ParserConfigurationException, SAXException, InterruptedException {
961960
PdfWriter writer = new PdfWriter(destinationFolder + "emptyDivTest.pdf");
962961
PdfDocument pdf = new PdfDocument(writer);

0 commit comments

Comments
 (0)