Skip to content

Commit

Permalink
Do not silently ignore catastrophic problem
Browse files Browse the repository at this point in the history
Co-authored-by: Werner Dietl <wdietl@gmail.com>
  • Loading branch information
mernst and wmdietl authored Mar 15, 2024
1 parent acf0fea commit 38a69dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1091,10 +1091,6 @@ public static List<? extends Element> getRecordComponents(TypeElement element) {
* @return true if the element is a compact canonical constructor of a record
*/
public static boolean isCompactCanonicalRecordConstructor(Element elt) {
if (!(elt instanceof Symbol)) {
return false;
}

return elt.getKind() == ElementKind.CONSTRUCTOR
&& (((Symbol) elt).flags() & Flags_COMPACT_RECORD_CONSTRUCTOR) != 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,11 @@ public static boolean isCompactCanonicalRecordConstructor(MethodTree method) {
*/
public static boolean isAutoGeneratedRecordMember(Tree member) {
Element e = elementFromTree(member);
return e != null && ElementUtils.isAutoGeneratedRecordMember(e);
if (e == null) {
throw new BugInCF(
"TreeUtils.isAutoGeneratedRecordMember: null element for member tree: " + member);
}
return ElementUtils.isAutoGeneratedRecordMember(e);
}

/**
Expand Down

0 comments on commit 38a69dd

Please sign in to comment.