From e1d5b49ecd9b180b6a80ad4d0ab63e0807682621 Mon Sep 17 00:00:00 2001 From: Mathieu Féry Date: Fri, 16 Jun 2023 10:34:20 +0200 Subject: feat(CompoundType): Improve error log on CompoundType.addField and CompoundType.setBodyParsed when body is already parsed --- src/java/com/jogamp/gluegen/cgram/types/CompoundType.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java index fea2446..0620104 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java @@ -192,7 +192,9 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable /** Adds a field to this type. */ public void addField(final Field f) { if (bodyParsed) { - throw new IllegalStateException("Body of this CompoundType has been already closed"); + throw new IllegalStateException(String.format( + "Body of this CompoundType (%s) has been already closed (Field supplied %s)", this, f + )); } if (fields == null) { fields = new ArrayList(); @@ -208,7 +210,9 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable */ public void setBodyParsed() throws IllegalStateException { if (bodyParsed) { - throw new IllegalStateException("Body of this CompoundType has been already closed"); + throw new IllegalStateException(String.format( + "Body of this CompoundType (%s) has been already closed", this + )); } bodyParsed = true; } -- cgit v1.2.3