Add Checkstyle rule to avoid statically importing copyOf and valueOf
<property name="message" value="Math.toIntExact should only be used with static imports" />
</module>
<module name="RegexpSingleline">
- <property name="format" value="^import static .*\.of;$" />
- <property name="message" value="Methods named &quot;of&quot; should never be statically imported" />
+ <property name="format" value="^import static .*\.(of|copyOf|valueOf);$" />
+ <property name="message" value="The following methods may not be statically imported: of, copyOf, valueOf" />
</module>
<module name="RegexpMultiline">
<property name="format" value="^[ \t]*import com.google.common.base.MoreObjects;$" />
