Skip to content

Commit

Permalink
Revert "Fix loading primitive classes + support primitive classes in …
Browse files Browse the repository at this point in the history
…annotations (#11537)"

This reverts commit 3e2ae3f. and keep the test
  • Loading branch information
sdelamo committed Jan 31, 2025
1 parent 48bcb55 commit 281bf82
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
public class JavaModelUtils {

public static final Map<String, String> NAME_TO_TYPE_MAP = new HashMap<>();
public static final Map<String, Type> NAME_TO_REAL_TYPE_MAP = new HashMap<>();
private static final ElementKind RECORD_KIND = ReflectionUtils.findDeclaredField(ElementKind.class, "RECORD").flatMap(field -> {
try {
return Optional.of((ElementKind) field.get(ElementKind.class));
Expand All @@ -63,15 +62,6 @@ public class JavaModelUtils {
JavaModelUtils.NAME_TO_TYPE_MAP.put("double", "D");
JavaModelUtils.NAME_TO_TYPE_MAP.put("float", "F");
JavaModelUtils.NAME_TO_TYPE_MAP.put("short", "S");
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("void", Type.VOID_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("boolean", Type.BOOLEAN_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("char", Type.CHAR_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("int", Type.INT_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("byte", Type.BYTE_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("long", Type.LONG_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("double", Type.DOUBLE_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("float", Type.FLOAT_TYPE);
JavaModelUtils.NAME_TO_REAL_TYPE_MAP.put("short", Type.SHORT_TYPE);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,19 +628,6 @@ public Object visitType(TypeMirror t, Object o) {
String className = JavaModelUtils.getClassName(element);
resolvedValue = new AnnotationClassValue<>(className);
}
} else {
resolvedValue = switch (t.getKind()) {
case BOOLEAN -> new AnnotationClassValue<>(boolean.class);
case BYTE -> new AnnotationClassValue<>(byte.class);
case SHORT -> new AnnotationClassValue<>(short.class);
case INT -> new AnnotationClassValue<>(int.class);
case LONG -> new AnnotationClassValue<>(long.class);
case CHAR -> new AnnotationClassValue<>(char.class);
case FLOAT -> new AnnotationClassValue<>(float.class);
case DOUBLE -> new AnnotationClassValue<>(double.class);
case VOID -> new AnnotationClassValue<>(void.class);
default -> null;
};
}
return null;
}
Expand Down

0 comments on commit 281bf82

Please sign in to comment.