[FR] Improvement: Change updateChildren parameter to Map<String, ?>

Open
#917 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
databases

Research direction

Search for the DatabaseRef#updateChildren and updateChildrenAsync entry points, then inspect their declarations and any related tests. Confirm that the methods accept Map<String, ?> without changing their existing update behavior, and run the relevant Java test suite.

Written by the indexing model from the issue text.

Description

needs-triage type: feature request

Is your feature request related to a problem? Please describe.
Various builders (e.g., Map.of) and language features (e.g., Groovy and Kotlin inline maps) create Map instances whose V bound is more strict than Object. Currently, the DatabaseRef#updateChildren[Async] interface won't accept these instances because it is defined as accepting Map<String, Object>.

Describe the solution you'd like
Since these method consume the map and do not modify it, they could be defined as Map<String, ?> to accept a map with any generic value type with no backwards incompatibility or other code changes.

Describe alternatives you've considered
Otherwise, passing in maps usually requires an explicit type declaration instead of var or an inline builder.

Dominant language
Java
Stars
620
Forks
305
Avg merge
3h 23m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/firebase-admin-java

All issues in firebase/firebase-admin-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.