Skip to content

[Fix-16382]Fix the bug of duplicate error reporting of procedure parameters#16420

Closed
wangxj3 wants to merge 0 commit intoapache:devfrom
wangxj3:dev
Closed

[Fix-16382]Fix the bug of duplicate error reporting of procedure parameters#16420
wangxj3 wants to merge 0 commit intoapache:devfrom
wangxj3:dev

Conversation

@wangxj3
Copy link
Contributor

@wangxj3 wangxj3 commented Aug 6, 2024

Purpose of the pull request

fix #16382

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@SbloodyS SbloodyS added this to the 3.3.0 milestone Aug 6, 2024
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 6, 2024

Comment on lines +107 to +114
if (!varPool.isEmpty()) {
for (Property info : varPool) {
if (pop.equals(info.getProp())) {
varPool.remove(info);
break;
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should fix this in AbstractParameters since this is used by more than just one task type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other task type use the mothod of AbstractParameters.dealOutParam .only procedure task handle output parameters in this way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is remove duplicated value of varPool in AbstractParameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is remove duplicated value of varPool in AbstractParameters.

图片
this is the method merge the out params in AbstractParameters, the inputparams of this method is varpool and outProperty,This is sequential. It will be inserted into the map according to the order of varpool and then outProperty. The map will filter out duplicate values, and because outProperty is behind, it will overwrite the duplicate values of varpool.Do you mean this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the mergeVarPool of AbstractParameters does not need to be modified

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After I take a deep look at it, I think we should make the following changes.

  1. Deduplication should be performed at the place where varpool was initialized.
  2. Add duplicate check at the front-end.
  3. Add duplicate check at the backend-end api.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think parameter updates should be a normal business scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A duplicate key property error occurs when defining two tasks with the same OUT parameter name in a process

2 participants