Scarab commit: svn commit: r10657 - trunk/src/java/org/tigris/scarab/om/MITListItem.java

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2008-12-05 16:03:54-0800
New Revision: 10657

Modified:
   trunk/src/java/org/tigris/scarab/om/MITListItem.java

Log:
[HD]: created a workaround for a NPE during cross module queries. Needs further investigation.

Modified: trunk/src/java/org/tigris/scarab/om/MITListItem.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/om/MITListItem.java?view=diff&pathrev=10657&r1=10656&r2=10657
==============================================================================
--- trunk/src/java/org/tigris/scarab/om/MITListItem.java	(original)
+++ trunk/src/java/org/tigris/scarab/om/MITListItem.java	2008-12-05 16:03:54-0800
@@ -235,8 +235,25 @@
                "method should not be called on an item " +
                "including issue types");
         }
-        return getModule()
-           .getRModuleAttribute(attribute, getIssueType())
-           .getDisplayValue();
+        Module module = getModule();
+        IssueType issueType = getIssueType();
+        RModuleAttribute rma = module.getRModuleAttribute(attribute, issueType);
+        String displayValue;
+        
+        // FIXME: When would the rma be null ? I got this error today, while performing a cross module
+        //        query. But i couldn't find the cause.
+        //        It may be related to an inconsistent submodule definition ...
+        //        In order to debug this behaviour, i added a generic displayValue here. Now the NPE
+        //        is away, but the generic displayValues don't appear either on the GUI. So whatever happens
+        //        here, the associated items seem to be irrelevant on the GUI... To be further examined!
+        if(rma != null)
+        {
+        	displayValue = rma.getDisplayValue();
+        }
+        else
+        {
+        	displayValue = "" + attribute.getName() + ":" + issueType.getName();
+        }
+        return displayValue;
     }
 }

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=980405
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.