Fix in STX:LIBJAVA source representation: cared for compilation units with no type definitions
--- a/tools/java/src/stx/libjava/tools/Source.java Fri Mar 27 16:10:51 2015 +0000
+++ b/tools/java/src/stx/libjava/tools/Source.java Tue Mar 31 15:14:16 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];