Skip to content

[Bug] Invalid parameter type passed to Map.get #25060

@lhotari

Description

@lhotari

Search before reporting

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

User environment

master branch

Issue Description

error-prone detected issue

error: [CollectionIncompatibleType] Argument 'QueryParam.Bundle.value' should not be passed to this method; its type String is not compatible with its collection's type argument QueryParam

in this code:

@Override
public CompletableFuture<List<String>> getListAsync(String namespace, TopicDomain topicDomain,
Map<QueryParam, Object> params) {
ListTopicsOptions options = ListTopicsOptions
.builder()
.bundle((String) params.get(QueryParam.Bundle.value))
.build();
return getListAsync(namespace, topicDomain, options);
}

According to the type parameters, it should be QueryParam.Bundle instead of QueryParam.Bundle.value. It's unclear why tests didn't catch this issue.

Error messages


Reproducing the issue

See description.

Additional information

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

type/bugThe PR fixed a bug or issue reported a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions