[Mobies-commit] [commit] r4046 - in UDM/trunk/src: UML GME/Interpreter Udm

ksmyth at redhat1.isis.vanderbilt.edu ksmyth at redhat1.isis.vanderbilt.edu
Tue May 29 13:59:11 CDT 2012


Author: ksmyth
Date: Tue May 29 13:59:11 2012
New Revision: 4046

Log:
Fix bug with GReAT transform where a Diagram is the same name as the RootFolder (which gets generated into the crosslinks diagram)

Modified:
   UDM/trunk/src/UML GME/Interpreter/BONComponent.cpp
   UDM/trunk/src/Udm/DiagramGen.cpp

Modified: UDM/trunk/src/UML GME/Interpreter/BONComponent.cpp
==============================================================================
--- UDM/trunk/src/UML GME/Interpreter/BONComponent.cpp	Tue May 29 13:58:59 2012	(r4045)
+++ UDM/trunk/src/UML GME/Interpreter/BONComponent.cpp	Tue May 29 13:59:11 2012	(r4046)
@@ -258,6 +258,10 @@
 				package->CheckInheritance();
 				package->BuildCompositions();
 				package->BuildAssociations();
+				if (package->GetNameorAlias() == name)
+				{
+					throw int_exception("Error: package " + package->GetNameorAlias() + " must have a different name than the root folder");
+				}
 
 				::Uml::Diagram dgr = ::Uml::Diagram::Cast(pr.GetDataNetwork((LPCTSTR) (package->GetNameorAlias() + ".xml")).GetRootObject());
 
@@ -297,12 +301,12 @@
 	}
 	catch (int_exception &e)
 	{
-		if (param & GME_SILENT_MODE) return;
-
-		std::string str  = e.what();
+		std::string err = e.what();
 		//do we have stg to say?
-		if (str.length())
-			AfxMessageBox(e.what().c_str());
+		if (!(param & GME_SILENT_MODE))
+			AfxMessageBox(err.c_str());
+		else
+			std::cerr << err << std::endl;
 	}
 	catch (udm_exception &e)
 	{
@@ -311,6 +315,7 @@
 		GMEConsole::Console::Error::WriteLine(err.c_str());
 		if (!(param & GME_SILENT_MODE))
 			AfxMessageBox(err.c_str());
+		GMEConsole::Console::ReleaseConsole();
 	}
 }
 

Modified: UDM/trunk/src/Udm/DiagramGen.cpp
==============================================================================
--- UDM/trunk/src/Udm/DiagramGen.cpp	Tue May 29 13:58:59 2012	(r4045)
+++ UDM/trunk/src/Udm/DiagramGen.cpp	Tue May 29 13:59:11 2012	(r4046)
@@ -248,6 +248,9 @@
 					if (!jj->first.empty())
 					{
 						::Uml::Namespace ns_from = ::Uml::namespaceByPath(dgr_from, jj->first, ":");
+						if (!ns_from)
+							throw udm_exception(std::string("Couldn't find ") + jj->first + " in namespace "
+								+ static_cast<std::string>(dgr_from.name()));
 						NamespaceGen ngen(ns_from, gen);
 						ngen.Process(cross_diagram, p_is, false);
 						decl.begin_ns.insert(decl.begin_ns.end(), ngen.begin_ns.begin(), ngen.begin_ns.end());


More information about the Mobies-commit mailing list