confirm instanceof on check parameter from web service

Description

org.idempiere.adinterface.Process.fillParameter

WDYT?

Environment

None

Activity

Show:
Deepak Pansheriya
August 30, 2019, 11:47 AM

@hiep Please mention which revision are you referring as I an bit abke ti find line 513 code in release 6.2

Deepak Pansheriya
August 30, 2019, 12:24 PM
Edited

Hiep,
As per code in release 6.2, below is code block from line 493. And you can see that if Datafield is presents, it is immediately initialized.

It sounds I may not understanding your questions.

Hiep Lq
August 31, 2019, 7:38 AM

my code base is default branch, but it’s ok for release 6.2, this file hasn’t change.

my question about don’t need to check data type of variable “value”

line 553-558. value always is String. don’t need to verify value instanceof BigDecimal and value instanceof Integer

Carlos Ruiz
September 9, 2019, 10:50 AM

Hi , agree that is unnecessary at this moment, but as the variable value is declared as an Object and not as a String, I think that bit of "defensive programming" doesn't hurt and protects in case somebody in future adds a different assignment to that Object.

Regards,

Carlos Ruiz

Assignee

Carlos Ruiz

Reporter

Hiep Lq

Labels

None

Tested By

None

Priority

Major
Configure