private List < Statement > getInitLocation ( MethodDeclaration node ) { List < Statement > stmts = node . getBody ( ) . getStatements ( ) ; if ( ! stmts . isEmpty ( ) && stmts . get ( 0 ) instanceof SuperConstructorInvocation ) { return stmts . subList ( 0 , 1 ) ; } // java.lang.Object supertype is null. All other types should have a super() call. assert TypeUtil . isNone ( ElementUtil . getDeclaringClass ( node . getExecutableElement ( ) ) . getSuperclass ( ) ) : "Constructor didn't have a super() call." ; return stmts . subList ( 0 , 0 ) ; }
Finds the location in a constructor where init statements should be added .