instanceCreation ================ .. include:: /ref/targets/autogen/descriptions/instancecreation.txt .. contents:: Configuration options --------------------- type ~~~~ Checks the type of the object that will be constructed. .. code-block:: yaml search: instanceCreation: type: "HttpCookie" .. code-block:: java :emphasize-lines: 2 public void example() { HttpCookie cookie = new HttpCookie(); } .. seealso:: The examples above use shorthands, see :doc:`type` target for more advanced configurations args ~~~~ Checks the arguments of the instance creation. This option is configured as a list of :doc:`argument` targets. There is a possibility to specifically match a certain argument (based on the position) or to choose the ``any`` match. .. code-block:: yaml search: instanceCreation: args: 1: value: "SESSION_ID" .. code-block:: java :emphasize-lines: 2 public HttpCookie createSessionCookie(String randomToken) { HttpCookie cookie = new HttpCookie("SESSION_ID", randomToken); return cookie; } argCount ~~~~~~~~ Checks the number of arguments. .. code-block:: yaml search: instanceCreation: argCount: 2 .. code-block:: java :emphasize-lines: 2 public HttpCookie createSessionCookie(String randomToken) { HttpCookie cookie = new HttpCookie("SESSION_ID", randomToken); return cookie; } .. seealso:: The examples above use shorthands, see :doc:`integer` target for more advanced configurations .. include:: /ref/targets/partials/objectcreator.txt