Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object passed for parameter instead of string #5940

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

salmansharifov
Copy link

Description

Motivation and Context

#5922

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

@vlsi
Copy link
Collaborator

vlsi commented May 21, 2023

I guess you'll need to add JMeterProperty handling to org.apache.jorphan.util.Converter#getInt(java.lang.Object), getLong, and similar relevant methods.

@salmansharifov
Copy link
Author

Like that?

 public static int getInt(JMeterProperty o) {
        Object objectValue = o.getObjectValue();
        return getInt(objectValue, 0);
    }

@vlsi
Copy link
Collaborator

vlsi commented May 21, 2023

not really. Something like

... getInt(...){
if (value instanceof JMeterProperty) {
    return value.getIntegerValue();
}

@salmansharifov
Copy link
Author

adding :src:core dependency to :src:jorphan for JMeterProperty cause cyclic dependency error. Is there way to tackle this?

@vlsi
Copy link
Collaborator

vlsi commented May 21, 2023

Oh, I did not think about it.

One of the options could be: make intproperty implement Number.

An alternative option could be adding a custom interface to jorphan that could be implemented in jmeterproperty

@salmansharifov
Copy link
Author

Sorry, but I couldn't handle the solution. Do you know any resource for interface solution?

@vlsi
Copy link
Collaborator

vlsi commented Jun 5, 2023

One of the ways would be add a converter in :src:core so it would try convert the properties first, and if the element is not a property, then delegate to the converter in jorphan.

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants