public static JCMethodInvocation firstConstructorCall ( JCTree tree ) { if ( ! tree . hasTag ( METHODDEF ) ) return null ; JCMethodDecl md = ( JCMethodDecl ) tree ; Names names = md . name . table . names ; if ( md . name != names . init ) return null ; if ( md . body == null ) return null ; List < JCStatement > stats = md . body . stats ; // Synthetic initializations can appear before the super call. while ( stats . nonEmpty ( ) && isSyntheticInit ( stats . head ) ) stats = stats . tail ; if ( stats . isEmpty ( ) ) return null ; if ( ! stats . head . hasTag ( EXEC ) ) return null ; JCExpressionStatement exec = ( JCExpressionStatement ) stats . head ; if ( ! exec . expr . hasTag ( APPLY ) ) return null ; return ( JCMethodInvocation ) exec . expr ; }
Return the first call in a constructor definition .