Skip to content

Commit

Permalink
fix #542
Browse files Browse the repository at this point in the history
  • Loading branch information
Luro02 committed Jul 1, 2024
1 parent 6f797bb commit 41e3ede
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ public static boolean isUtilityClass(CtClass<?> ctClass) {
&& !ctClass.getMethods().isEmpty()
// all methods should be static
&& ctClass.getMethods().stream().allMatch(CtMethod::isStatic)
// all fields should be static and effectively final (no assignments)
&& ctClass.getFields().stream().allMatch(
ctField -> ctField.isStatic() && SpoonUtil.isEffectivelyFinal(ctField)
)
// all fields should be static
&& ctClass.getFields().stream().allMatch(CtModifiable::isStatic)
// the class should not extend anything
&& ctClass.getSuperclass() == null
// the class should not implement anything
Expand Down

0 comments on commit 41e3ede

Please sign in to comment.