Skip to content

[Cosmos v4] Possible infinite recursive call in getters #9096

@anuchandy

Description

@anuchandy

The following two methods will result in infinite recursion:

ref

public final class SqlParameterList implements List<SqlParameter> {
    private final List<SqlParameter> parameters;
    // ....

    @Override
    public ListIterator<SqlParameter> listIterator() {
        return this.listIterator();
    }

    @Override
    public ListIterator<SqlParameter> listIterator(int index) {
        return this.listIterator(index);
    }

    // ..

}

I think it is suppose to use parameters.listIterator() and parameters.listIterator(index).

Same with below getProperties

ref.

public class CosmosAsyncConflictResponse extends CosmosResponse<CosmosConflictProperties> {
    CosmosAsyncConflictResponse(ResourceResponse<Conflict> response, CosmosAsyncContainer container) {
        super(response);
        // ..
        if (StringUtils.isEmpty(bodyAsString)) {
            super.setProperties(null);
            // ..
        } else {
            CosmosConflictProperties props = new CosmosConflictProperties(bodyAsString);
            super.setProperties(props);
            // ..
        }
    }
    
    // ..

    public CosmosConflictProperties getProperties() {
        return this.getProperties();
    }
}

I guess it is supposed to use super.getProperties() instead.

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Cosmoscosmos:v4-itemIndicates this feature will be shipped as part of V4 release train

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions