BugJail class name patterns reference
FollowThis article describes the format and priority rules of class name patterns that are used in BugJail Agent and BugJail Server options.
Class name pattern formats
Literal class name
<class_name>
Class name in the format returned by Class.getName() method, i.e. inner classes are prefixed by '$' (dollar sign).
Example - Class name of a normal class and an inner class
com.foo.bar.Baz
com.foo.bar.Baz$InnerClass
Regular expression pattern
<regexp>
Regular expression specified using JDK6 format (https://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
Example - a pattern that matches all classes whose top-level package name starts with "test", and later part of the package OR class name contains the string "generated".
test.*generated.*
Trailing wildcard pattern
<package>**
Partial name of the package, starting from top-level but ending in '**' (two asterisks).
Trailing '.' (period) between the last package name and the asterisks is optional (e.g. foo** and foo.** are equal).
Example - Wildcard patterns (first two are equivalent)
com.buhjail**
com.bugjail.**
com.bugjail.processing**
com.bugjail.processing.runtime**
Tip: while using a regular expression ending with .* would provide the same match, the trailing wildcard patterns are more performant, and are resolved from most specific (most package levels) to least specific, which makes them more suitable for most uses.
Class name pattern priority
- Literal class names
- Regular expressions, in the order they are specified
- Postfix wildcards, in order from most specific (most package levels) to least specific
Comments
0 comments
Please sign in to leave a comment.