Skip to content

Commit 84b542e

Browse files
committed
address PR feedback
1 parent dc3a66b commit 84b542e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/google/api/generator/gapic/model/HttpBindings.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ public static HttpBinding create(String name, boolean isOptional) {
3939
return new AutoValue_HttpBindings_HttpBinding(name, isOptional);
4040
}
4141

42+
// Do not forget to keep it in sync with equals() implementation.
4243
@Override
4344
public int compareTo(HttpBinding o) {
44-
return name().compareTo(o.name());
45+
int res = name().compareTo(o.name());
46+
return res == 0 ? Boolean.compare(isOptional(), o.isOptional()) : res;
4547
}
4648
}
4749

0 commit comments

Comments
 (0)