public static boolean isConstructor(MethodGen mg) {
    if (mg.getName().equals("")) {
      throw new Error("method name cannot be empty");
    }
    return mg.getName().equals("<init>");
  }
public static boolean isConstructor(MethodGen mg) {
    if (mg.getName().equals("")) {
      throw new Error("method name cannot be empty");
    }
    return mg.getName().equals("<init>");
  }
public static boolean isConstructor ( MethodGen mg ) { if ( mg . getName ( ) . equals ( "" ) ) { throw new Error ( "method name cannot be empty" ) ; } return mg . getName ( ) . equals ( "<init>" ) ; }
Returns whether or not the method is a constructor.

@param mg the MethodGen to test
@return true iff the method is a constructor
Returns whether or not the method is a constructor .