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

Cannot call public methods in com.google.cloud.firestore.UpdateBuilder via reflection #3580

Closed
pmoriarty opened this issue Aug 18, 2018 · 0 comments
Assignees
Labels
api: firestore Issues related to the Firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@pmoriarty
Copy link

The com.google.cloud.firestore.Transaction and WriteBatch classes are
public but they extend a package-private abstract class
UpdateBuilder. The public methods inherited from
UpdateBuilder cannot be invoked via the Java reflection API due to
long-standing bugs such as JDK-4283544.

This is a serious problem for alternative JVM languages which use
reflection to discover Java methods. For example, Clojure uses
reflection in its compiler, and it cannot invoke these methods at all.

I know at least UpdateBuilder is affected. There may be other
instances of this pattern that I haven't found.

Possible Solution
For this specific case, making UpdateBuilder public will fix the
problem. This should have no impact on other code. The class will
still not be instantiable because it is also abstract.

If there are other package-private classes extended by public API
classes, they would also need to be declared public.

Version: google-cloud-firestore-0.52.0-beta
Java: Oracle JDK 1.8.0_152

@JustinBeckwith JustinBeckwith added the triage me I really want to be triaged. label Aug 19, 2018
@yihanzhen yihanzhen added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p2 Moderately-important priority. Fix may not be included in next release. api: firestore Issues related to the Firestore API. labels Aug 20, 2018
@JustinBeckwith JustinBeckwith removed the triage me I really want to be triaged. label Aug 20, 2018
@sduskis sduskis removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the Firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

5 participants