Skip to content

Commit 179d099

Browse files
committed
Cosmetic changes
1 parent efa80d7 commit 179d099

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

layout/src/main/java/com/itextpdf/layout/element/BlockElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public abstract class BlockElement<T extends IElement> extends AbstractElement<T
6262
/**
6363
* Creates a BlockElement.
6464
*/
65-
public BlockElement() {
65+
protected BlockElement() {
6666
}
6767

6868
/**

layout/src/main/java/com/itextpdf/layout/element/Cell.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ public Cell clone(boolean includeContent) {
199199
}
200200

201201
@Override
202-
public <T> T getDefaultProperty(Property property) {
202+
public <T1> T1 getDefaultProperty(Property property) {
203203
switch (property) {
204204
case BORDER:
205-
return (T) DEFAULT_BORDER;
205+
return (T1) DEFAULT_BORDER;
206206
case PADDING_BOTTOM:
207207
case PADDING_LEFT:
208208
case PADDING_RIGHT:
209209
case PADDING_TOP:
210-
return (T) Float.valueOf(2);
210+
return (T1) Float.valueOf(2);
211211
default:
212212
return super.getDefaultProperty(property);
213213
}

layout/src/main/java/com/itextpdf/layout/element/Image.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,13 @@ public Image setFixedPosition(int pageNumber, float x, float y) {
404404
}
405405

406406
@Override
407-
public <T> T getDefaultProperty(Property property) {
407+
public <T1> T1 getDefaultProperty(Property property) {
408408
switch (property) {
409409
case AUTO_SCALE:
410-
return (T) Boolean.valueOf(false);
410+
return (T1) Boolean.valueOf(false);
411411
case HORIZONTAL_SCALING:
412412
case VERTICAL_SCALING:
413-
return (T) Float.valueOf(1);
413+
return (T1) Float.valueOf(1);
414414
default:
415415
return super.getDefaultProperty(property);
416416
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public void stylesTest01() {
1818
Style myStyle = new Style();
1919
myStyle.setFontColor(Color.RED);
2020

21-
Paragraph p = new Paragraph("text");
22-
p.addStyle(myStyle);
23-
p.setFontColor(Color.GREEN);
21+
Paragraph p = new Paragraph("text")
22+
.addStyle(myStyle)
23+
.setFontColor(Color.GREEN);
2424

2525
Assert.assertEquals(Color.GREEN, p.getRenderer().getProperty(Property.FONT_COLOR));
2626
}
@@ -30,8 +30,7 @@ public void stylesTest02() {
3030
Style myStyle = new Style();
3131
myStyle.setFontColor(Color.RED);
3232

33-
Paragraph p = new Paragraph("text");
34-
p.addStyle(myStyle);
33+
Paragraph p = new Paragraph("text").addStyle(myStyle);
3534

3635
Assert.assertEquals(Color.RED, p.getRenderer().getProperty(Property.FONT_COLOR));
3736
}

0 commit comments

Comments
 (0)