@@ -44,6 +44,7 @@ This file is part of the iText (R) project.
44
44
package com .itextpdf .layout .renderer ;
45
45
46
46
import com .itextpdf .io .LogMessageConstant ;
47
+ import com .itextpdf .io .util .NumberUtil ;
47
48
import com .itextpdf .kernel .color .Color ;
48
49
import com .itextpdf .kernel .font .PdfFont ;
49
50
import com .itextpdf .kernel .geom .AffineTransform ;
@@ -363,8 +364,7 @@ public TransparentColor getPropertyAsTransparentColor(int property) {
363
364
* @return a {@link Float}
364
365
*/
365
366
public Float getPropertyAsFloat (int property ) {
366
- Number value = this .<Number >getProperty (property );
367
- return value != null ? value .floatValue () : null ;
367
+ return NumberUtil .asFloat (this .<Object >getProperty (property ));
368
368
}
369
369
370
370
/**
@@ -375,8 +375,7 @@ public Float getPropertyAsFloat(int property) {
375
375
* @return a {@link Float}
376
376
*/
377
377
public Float getPropertyAsFloat (int property , Float defaultValue ) {
378
- Number value = this .<Number >getProperty (property , defaultValue );
379
- return value != null ? value .floatValue () : null ;
378
+ return NumberUtil .asFloat (this .<Object >getProperty (property , defaultValue ));
380
379
}
381
380
382
381
/**
@@ -396,8 +395,7 @@ public Boolean getPropertyAsBoolean(int property) {
396
395
* @return a {@link Integer}
397
396
*/
398
397
public Integer getPropertyAsInteger (int property ) {
399
- Number value = getProperty (property );
400
- return value != null ? value .intValue () : null ;
398
+ return NumberUtil .asInteger (this .<Object >getProperty (property ));
401
399
}
402
400
403
401
/**
0 commit comments