[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimport
Andi Fischer
andi.fischer at hispeed.ch
Sat May 1 12:01:46 UTC 2010
SVN commit 1121487 by fischer:
Crash and endless loop fixed.
M +7 -2 javaimport.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/javaimport.cpp #1121486:1121487
@@ -4,7 +4,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2006-2009 *
+ * copyright (C) 2006-2010 *
* Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
@@ -67,6 +67,7 @@
QString JavaImport::joinTypename(const QString& typeName)
{
QString typeNameRet(typeName);
+ if (m_srcIndex + 1 < m_source.size()) {
if (m_source[m_srcIndex + 1] == "<" ||
m_source[m_srcIndex + 1] == "[") {
int start = ++m_srcIndex;
@@ -76,8 +77,9 @@
typeNameRet += m_source[i];
}
}
+ }
// to handle multidimensional arrays, call recursively
- if (m_source[m_srcIndex + 1] == "[") {
+ if ((m_srcIndex + 1 < m_source.size()) && (m_source[m_srcIndex + 1] == "[")) {
typeNameRet = joinTypename( typeNameRet );
}
return typeNameRet;
@@ -559,7 +561,10 @@
name += nextToken; // add possible array dimensions to `name'
}
nextToken = advance();
+ if (nextToken == QString()) {
+ break;
}
+ }
// try to resolve the class type, or create a placeholder if that fails
UMLObject *type = resolveClass( typeName );
UMLObject *o;
More information about the umbrello-devel
mailing list