--- a/tools/java/src/stx/libjava/tools/Source.java Wed Apr 15 04:51:37 2015 +0100
+++ b/tools/java/src/stx/libjava/tools/Source.java Sun Apr 19 18:43:26 2015 +0100
@@ -108,7 +108,12 @@
public void setName() {
Parser p = new Parser();
CompilationUnitDeclaration cu = p.parse(this, true);
- typename = cu.types[0].name;
+ if ( cu.types != null && cu.types.length > 0 ) {
+ typename = cu.types[0].name;
+ } else {
+ typename = new char[0];
+ }
+
if (cu.currentPackage == null) {
// no package?
packagename = new char[0][0];