[fixes #3814] Ignore missing UNKNOWN type tag

This commit is contained in:
Rawi01 committed 2025-03-06 23:35:38 +01:00
1 parent 94e6a38b0a
commit 2e7e61372a
2 files changed
+13 -4

No files matched your search

+11 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2024 The Project Lombok Authors.
* Copyright (C) 2009-2025 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -184,7 +184,16 @@ public class Javac {
public static final TypeTag CTC_NONE = typeTag("NONE");
public static final TypeTag CTC_BOT = typeTag("BOT");
public static final TypeTag CTC_ERROR = typeTag("ERROR");
public static final TypeTag CTC_UNKNOWN = typeTag("UNKNOWN");
public static final TypeTag CTC_UNKNOWN; // Removed in JDK24
static {
TypeTag unknonwTypeTag = null;
try {
unknonwTypeTag = typeTag("UNKNOWN");
} catch (Exception e) {
if (!(e instanceof NoSuchFieldException)) throw Javac.sneakyThrow(e);
}
CTC_UNKNOWN = unknonwTypeTag;
}
public static final TypeTag CTC_UNDETVAR = typeTag("UNDETVAR");
public static final TypeTag CTC_CLASS = typeTag("CLASS");
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2021 The Project Lombok Authors.
* Copyright (C) 2010-2025 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -105,7 +105,7 @@ public class TreeMirrorMaker extends TreeCopier<Void> {
boolean wipeSymAndType = copy.type.isErroneous();
if (!wipeSymAndType) {
TypeTag typeTag = TypeTag.typeTag(copy.type);
wipeSymAndType = (CTC_NONE.equals(typeTag) || CTC_ERROR.equals(typeTag) || CTC_UNKNOWN.equals(typeTag) || CTC_UNDETVAR.equals(typeTag));
wipeSymAndType = (typeTag.equals(CTC_NONE) || typeTag.equals(CTC_ERROR) || typeTag.equals(CTC_UNKNOWN) || typeTag.equals(CTC_UNDETVAR));
}
if (wipeSymAndType) {