aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-03 05:36:12 +0200
committerSven Gothel <[email protected]>2011-09-03 05:36:12 +0200
commitcb199004a35ee04d4727f466112adcc65ed7d0d4 (patch)
treec420ba18e5d0dd3933d38c822b109823f2ffd59e /src
parentcfb9e118e020707842e6b5136b07f5ab149540c1 (diff)
Fix PCPP/DumpCPP: Avoid NPE ; More descriptive exception in case of non integer opaque in struct
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/gluegen/JavaEmitter.java2
-rw-r--r--src/java/com/jogamp/gluegen/pcpp/PCPP.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java
index 18cb5b1..c7c6cc8 100644
--- a/src/java/com/jogamp/gluegen/JavaEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaEmitter.java
@@ -1390,7 +1390,7 @@ public class JavaEmitter implements GlueEmitter {
Class<?> c = javaType.getJavaClass();
if (!isIntegerType(c)) {
// FIXME
- throw new RuntimeException("Can't yet handle opaque definitions of structs' fields to non-integer types (byte, short, int, long, etc.)");
+ throw new RuntimeException("Can't yet handle opaque definitions of structs' fields to non-integer types (byte, short, int, long, etc.): type: "+fieldType+", javaType "+javaType+", javaClass "+c);
}
switch ((int) fieldType.getSize(curMachDesc)) {
case 1: return "byte";
diff --git a/src/java/com/jogamp/gluegen/pcpp/PCPP.java b/src/java/com/jogamp/gluegen/pcpp/PCPP.java
index 45a92df..59807b2 100644
--- a/src/java/com/jogamp/gluegen/pcpp/PCPP.java
+++ b/src/java/com/jogamp/gluegen/pcpp/PCPP.java
@@ -319,11 +319,11 @@ public class PCPP {
}
private String filename() {
- return state.filename();
+ return (null != state) ? state.filename() : null;
}
private int lineNumber() {
- return state.lineNumber();
+ return (null != state) ? state.lineNumber() : -1;
}
/////////////