Commit c3ddf333 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Bug 583958 - Class diagrams and class hierarchy don't work for java generic classes

Bug 631675 - Java inheritance of instantiated generics not recognized.
parent 7d9d4320
...@@ -249,7 +249,7 @@ void ClassDefImpl::init(const char *defFileName, const char *name, ...@@ -249,7 +249,7 @@ void ClassDefImpl::init(const char *defFileName, const char *name,
{ {
isLocal=FALSE; isLocal=FALSE;
} }
isGeneric = lang==SrcLangExt_CSharp && QCString(name).find('<')!=-1; isGeneric = (lang==SrcLangExt_CSharp || lang==SrcLangExt_Java) && QCString(name).find('<')!=-1;
isAnonymous = QCString(name).find('@')!=-1; isAnonymous = QCString(name).find('@')!=-1;
} }
......
...@@ -1347,11 +1347,12 @@ static void addClassToContext(EntryNav *rootNav) ...@@ -1347,11 +1347,12 @@ static void addClassToContext(EntryNav *rootNav)
cd->insertUsedFile(fd); cd->insertUsedFile(fd);
// add class to the list // add class to the list
//printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); //printf("ClassDict.insert(%s)\n",fullName.data());
Doxygen::classSDict->append(fullName,cd); Doxygen::classSDict->append(fullName,cd);
if (cd->isGeneric()) // generics are also stored in a separate dictionary for fast lookup of instantions if (cd->isGeneric()) // generics are also stored in a separate dictionary for fast lookup of instantions
{ {
//printf("inserting generic '%s' cd=%p\n",fullName.data(),cd);
Doxygen::genericsDict->insert(fullName,cd); Doxygen::genericsDict->insert(fullName,cd);
} }
} }
...@@ -4113,7 +4114,9 @@ static ClassDef *findClassWithinClassContext(Definition *context,ClassDef *cd,co ...@@ -4113,7 +4114,9 @@ static ClassDef *findClassWithinClassContext(Definition *context,ClassDef *cd,co
{ {
result = getClass(name); result = getClass(name);
} }
if (result==0 && cd && cd->getLanguage()==SrcLangExt_CSharp && name.find('<')!=-1) if (result==0 && cd &&
(cd->getLanguage()==SrcLangExt_CSharp || cd->getLanguage()==SrcLangExt_Java) &&
name.find('<')!=-1)
{ {
result = Doxygen::genericsDict->find(name); result = Doxygen::genericsDict->find(name);
} }
...@@ -4638,14 +4641,13 @@ static bool findClassRelation( ...@@ -4638,14 +4641,13 @@ static bool findClassRelation(
int i=baseClassName.find('<'); int i=baseClassName.find('<');
int si=baseClassName.findRev("::",i==-1 ? baseClassName.length() : i); int si=baseClassName.findRev("::",i==-1 ? baseClassName.length() : i);
if (si==-1) si=0; if (si==-1) si=0;
if (baseClass==0 && i!=-1) if (baseClass==0 && (root->lang==SrcLangExt_CSharp || root->lang==SrcLangExt_Java))
// base class has template specifiers
{
if (root->lang == SrcLangExt_CSharp)
{ {
baseClass = Doxygen::genericsDict->find(baseClassName); baseClass = Doxygen::genericsDict->find(baseClassName);
//printf("looking for '%s' result=%p\n",baseClassName.data(),baseClass);
} }
else if (baseClass==0 && i!=-1)
// base class has template specifiers
{ {
// TODO: here we should try to find the correct template specialization // TODO: here we should try to find the correct template specialization
// but for now, we only look for the unspecializated base class. // but for now, we only look for the unspecializated base class.
...@@ -4667,7 +4669,6 @@ static bool findClassRelation( ...@@ -4667,7 +4669,6 @@ static bool findClassRelation(
// baseClass,baseClassName.data(),templSpec.data()); // baseClass,baseClassName.data(),templSpec.data());
} }
} }
}
else if (baseClass && !templSpec.isEmpty()) // we have a known class, but also else if (baseClass && !templSpec.isEmpty()) // we have a known class, but also
// know it is a template, so see if // know it is a template, so see if
// we can also link to the explicit // we can also link to the explicit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment