1 /*xml 2 <module name="Checker"> 3 <module name="TreeWalker"> 4 <module name="HideUtilityClassConstructor"/> 5 </module> 6 </module> 7 */ 8 9 package com.puppycrawl.tools.checkstyle.checks.design.hideutilityclassconstructor; 10 11 // xdoc section -- start 12 class Example1 { // violation 13 14 public Example1() { 15 } 16 17 public static void fun() { 18 } 19 } 20 21 class Foo { // OK 22 23 private Foo() { 24 } 25 26 static int n; 27 } 28 29 class Bar { // OK 30 31 protected Bar() { 32 // prevents calls from subclass 33 throw new UnsupportedOperationException(); 34 } 35 } 36 37 class UtilityClass { // violation 38 39 static float f; 40 } 41 // xdoc section -- end