Skip to content

Commit fe161d1

Browse files
committed
more cleanup and refactoring
1 parent 3d5aa03 commit fe161d1

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/util/CustomClassMapper.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -661,18 +661,10 @@ private static class BeanMapper<T> {
661661
+ method.getName());
662662
}
663663

664-
// OK to add since existingPropertyName == propertyName.
665-
properties.put(propertyName.toLowerCase(Locale.US), propertyName);
666-
667-
// Handle `setter` update.
668664
Method existingSetter = setters.get(propertyName);
669-
if (existingSetter == null) {
670-
method.setAccessible(true);
671-
setters.put(propertyName, method);
672-
applySetterAnnotations(method);
673-
} else if (!isSetterOverride(method, existingSetter)) {
674-
// We require that setters with conflicting property names are
675-
// overrides from a base class
665+
666+
// Raise exception if a conflict between setters is found.
667+
if (existingSetter != null && !isSetterOverride(method, existingSetter)) {
676668
if (currentClass == clazz) {
677669
// TODO: Should we support overloads?
678670
throw new RuntimeException(
@@ -692,6 +684,13 @@ private static class BeanMapper<T> {
692684
+ ")");
693685
}
694686
}
687+
688+
// Make it accessible and process annotations if not yet.
689+
if (existingSetter == null) {
690+
method.setAccessible(true);
691+
setters.put(propertyName, method);
692+
applySetterAnnotations(method);
693+
}
695694
}
696695

697696
for (Field field : currentClass.getDeclaredFields()) {

firebase-firestore/src/main/java/com/google/firebase/firestore/util/DocumentId.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.lang.annotation.Target;
2424

2525
/**
26-
<<<<<<< HEAD
2726
* Annotation used to mark a POJO property to be automatically populated with the document's ID when
2827
* the POJO is created from a Firestore document (e.g. via {@link DocumentSnapshot#toObject}).
2928
*

0 commit comments

Comments
 (0)