core/src/main/java/com/google/errorprone/bugpatterns/checkreturnvalue/ProtoRules.java
private static boolean isGetterOfSubmessageBuilder(String name) {
      // TODO(glorioso): Any other naming conventions to check?
      // TODO(glorioso): Maybe worth making this a regex instead? But think about performance
      return name.startsWith("get") && name.endsWith("Builder") && !name.endsWith("OrBuilder");
    }
// fooBuilder.getBarBuilder() mutates the builder such that foo.hasBar() is now true.
fooBuilder.getBarBuilder() mutates the builder such that foo.hasBar() is now true.
fooBuilder . getBarBuilder () mutates the builder such that foo . hasBar () is now true .
private static boolean isGetterOfSubmessageBuilder(String name) {
      return name.startsWith("get") && name.endsWith("Builder") && !name.endsWith("OrBuilder");
    }
private static boolean isGetterOfSubmessageBuilder ( String name ) { return name . startsWith ( "get" ) && name . endsWith ( "Builder" ) && ! name . endsWith ( "OrBuilder" ) ; }
fooBuilder.getBarBuilder() mutates the builder such that foo.hasBar() is now true.
fooBuilder . getBarBuilder () mutates the builder such that foo . hasBar () is now true .
// TODO(glorioso): Any other naming conventions to check? // TODO(glorioso): Maybe worth making this a regex instead? But think about performance