diff options
author | Mathieu Féry <[email protected]> | 2023-06-16 10:34:20 +0200 |
---|---|---|
committer | Mathieu Féry <[email protected]> | 2023-06-16 10:51:50 +0200 |
commit | e1d5b49ecd9b180b6a80ad4d0ab63e0807682621 (patch) | |
tree | 87853c89094101cb4254a22595ae941baa52412e | |
parent | 88309192b450e09ba16e9d72adac178c4ce47dc3 (diff) |
feat(CompoundType): Improve error log on CompoundType.addField and CompoundType.setBodyParsed when body is already parsed
-rw-r--r-- | src/java/com/jogamp/gluegen/cgram/types/CompoundType.java | 8 |
1 files changed, 6 insertions, 2 deletions
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<Field>(); @@ -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; } |