Skip to content

[Bug] Firestore: credentials_provider_desktop.h shadows members of superclass #729

Closed
@dconeybe

Description

@dconeybe

When importing the C++ SDK into google3, the following warning surfaced, which looks legitimate:

non-static data member 'change_listener_' of 'FirebaseCppCredentialsProvider' shadows member inherited from type 'CredentialsProvider<firebase::firestore::credentials::AuthToken, firebase::firestore::credentials::User>'

third_party/firebase/ios/Releases/FirebaseFirestore/core/src/credentials/credentials_provider.h:82:39: declared here

The superclass, CredentialsProvider<AuthToken, User>, defines the following two protected data members:

CredentialChangeListener<ValueType> change_listener_;
bool force_refresh_ = false;

https://github.com/firebase/firebase-ios-sdk/blob/04b7555228b537a6cbebbc432f1f45d28336ba3d/Firestore/core/src/credentials/credentials_provider.h#L82-L84

The subclass, FirebaseCppCredentialsProvider, defines the following two private data members:

bool force_refresh_token_ = false;
firestore::credentials::CredentialChangeListener<firestore::credentials::User> change_listener_;

bool force_refresh_token_ = false;
// Provided by the user code; may be an empty function.
firestore::credentials::CredentialChangeListener<firestore::credentials::User>
change_listener_;

It appears that these data members in the subclass can simply be removed in favor of the ones defined in the superclass. It just so happens that one of their names collides. We should audit the other subclasses of CredentialsProvider to see if they also could benefit from this deduplication of member variables.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions