Skip to content

Commit 50f3c37

Browse files
committed
Tidy Util for modifiers and format
1 parent e0fdd27 commit 50f3c37

File tree

1 file changed

+6
-9
lines changed
  • validator-generator/src/main/java/io/avaje/validation/generator

1 file changed

+6
-9
lines changed

validator-generator/src/main/java/io/avaje/validation/generator/Util.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
final class Util {
1818

1919
private static final String NULLABLE = "Nullable";
20-
static final Set<String> BASIC_TYPES = Set.of("java.lang.String", "java.math.BigDecimal");
20+
private static final Set<String> BASIC_TYPES = Set.of("java.lang.String", "java.math.BigDecimal");
2121

2222
private Util() {}
2323

@@ -28,16 +28,14 @@ static boolean isValid(Element e) {
2828
}
2929

3030
/** Return true if the element has a Nullable annotation. */
31-
public static boolean isNullable(Element p) {
32-
31+
static boolean isNullable(Element p) {
3332
if (ProcessorUtils.hasAnnotationWithName(p, NULLABLE)) {
3433
return true;
3534
}
36-
3735
var type =
38-
p instanceof ExecutableElement ex
39-
? UType.parse(ex.getReturnType())
40-
: UType.parse(p.asType());
36+
p instanceof ExecutableElement ex
37+
? UType.parse(ex.getReturnType())
38+
: UType.parse(p.asType());
4139

4240
for (final AnnotationMirror mirror : type.annotations()) {
4341
if (NULLABLE.equalsIgnoreCase(shortName(mirror.getAnnotationType().toString()))) {
@@ -158,7 +156,6 @@ static boolean isPublic(Element element) {
158156
if (mods.contains(Modifier.PRIVATE) || mods.contains(Modifier.PROTECTED)) {
159157
return false;
160158
}
161-
var isImported = ProcessingContext.isImported(element);
162-
return !isImported;
159+
return !ProcessingContext.isImported(element);
163160
}
164161
}

0 commit comments

Comments
 (0)