You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/10/01 06:05:37 UTC

svn commit: r292913 - /beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java

Author: rich
Date: Fri Sep 30 21:05:32 2005
New Revision: 292913

URL: http://svn.apache.org/viewcvs?rev=292913&view=rev
Log:
Fixed several potential NPEs when compiling a file with an unknown type (i.e., a type is used but its import is missing).

tests: bvt in netui (WinXP)
BB: bvt in netui (linux)


Modified:
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java?rev=292913&r1=292912&r2=292913&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java Fri Sep 30 21:05:32 2005
@@ -1013,7 +1013,8 @@
     
     public static TypeDeclaration getDeclaration( DeclaredType type )
     {
-        return type != null ? type.getDeclaration() : ERROR_TYPE_DECLARATION;
+        TypeDeclaration decl = type != null ? type.getDeclaration() : null;
+        return decl != null ? decl : ERROR_TYPE_DECLARATION;
     }
     
     private static class ErrorTypeInstance