You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See also #174, where a similar API/documentation should be provided for constructors.
Quoting from the above:
There is no guidance I could find on how to allow/disallow blocking in a constructor or static initializer. There is one test that shows how to do it for a static initializer but it would be nicer if it was easier to find. One option could be a dedicated method, e.g. allowBlockingCallsInsideConstructor(String classname), or otherwise provide guidance in the Javadoc on allowBlockingCallsInside and a mention on the Customizations page.
@rstoyanchev you suggested that additional methods would maybe increase the API too much, and suggested enums or varargs. How about a couple constants? Something like:
//in Blockhound.Builder class, or directly at root Blockhound.javapublicstaticfinalStringSTATIC_INITIALIZER = "<clinit>";
//in user codeBlockHound.install(b -> b.allowBlockingCallsInside(ClassWithStaticInit.class.getName(), BlockHound.Builder.STATIC_INITIALIZER));
The text was updated successfully, but these errors were encountered:
This commit introduces a STATIC_INITIALIZER constant in BlockHound, so
it becomes easier to discover that the features relying on the
`String methodName` parameter can work with `<clinit>` for static
initializer.
Additionally, this is documented in the customization examples and
used in the StaticInitTest.
Fixes#178.
See also #174, where a similar API/documentation should be provided for constructors.
Quoting from the above:
@rstoyanchev you suggested that additional methods would maybe increase the API too much, and suggested enums or varargs. How about a couple constants? Something like:
The text was updated successfully, but these errors were encountered: