Summary: | umbrello idl import crash | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Wian Potgieter <liquidbrains> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | ralf.habacker |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.8.0 | |
Attachments: | patch fixing the runtime error |
Description
Wian Potgieter
2009-08-08 16:51:56 UTC
Created attachment 66218 [details]
patch fixing the runtime error
The problem here is that the java importer crashes when a java file is imported from a location outside the regular java package hierachy.
While finding unknown classes the parser tries to step up in the package hierachy to find the package root, which fails with a runtime error when the path do not fit into the package hierachy.
Because java package hierachy is very important for the java import I suggest to add a user warning if file pathes of imported files are outside the java package hierachy.
Comment on attachment 66218 [details]
patch fixing the runtime error
sorry, this patch belongs to another bug
The first issue with the exceeded limits is fixed in r1266700. The second issue is caused by a code bug: In IDLImport::parseStmt() there is the following code with the problematic line marked with !!! if (keyword == "interface") { [1] const QString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(UMLObject::ot_Class, name, m_scope[m_scopeIndex], m_comment); !!! m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns); m_klass->setStereotype("CORBAInterface"); m_klass->setAbstract(m_isAbstract); m_isAbstract = false; m_comment.clear(); if (advance() == ";") // forward declaration return true; [2] This line is responsible for setting the current parent scope, which. Unfortunally the part between [1] and [2] handles also the interface forward declaration, which mean each forward declaration adds a new parent scope, which let at last m_scope overflow. The solution to this problem is to split !!! m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns); into the following part at the original location !!! m_klass = static_cast<UMLClassifier*>(ns); and the remaining part at [2] where real interfaces are hANDÖED:- if (advance() == ";") // forward declaration return true; m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns); (In reply to comment #3) > The solution to this problem is to split > > !!! m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns); > > into the following part at the original location > > !!! m_klass = static_cast<UMLClassifier*>(ns); > > and the remaining part at [2] where real interfaces are hmmh, submitted by browser accident .... continued ... handled. if (advance() == ";") // forward declaration return true; [2] m_scope[++m_scopeIndex] = m_klass; The same belongs to the "valuetype" keyword fixes applied to svn trunk set version-fixed-in from 4.8.0 changelog |