summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-04-28 19:36:59 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-08-14 18:40:39 (GMT)
commitc3ddf3331239fb3f41e502a8337eee786ceaad06 (patch)
tree4ba8a522c371fb3b5b24666d3358b05560fa4eef
parent7d9d4320f5d183c4e1ebc87a316589c36f0afeed (diff)
downloadDoxygen-c3ddf3331239fb3f41e502a8337eee786ceaad06.zip
Doxygen-c3ddf3331239fb3f41e502a8337eee786ceaad06.tar.gz
Doxygen-c3ddf3331239fb3f41e502a8337eee786ceaad06.tar.bz2
Bug 583958 - Class diagrams and class hierarchy don't work for java generic classes
Bug 631675 - Java inheritance of instantiated generics not recognized.
-rw-r--r--src/classdef.cpp2
-rw-r--r--src/doxygen.cpp53
2 files changed, 28 insertions, 27 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index b32d5a8..c36a83f 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -249,7 +249,7 @@ void ClassDefImpl::init(const char *defFileName, const char *name,
{
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;
}
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 9260571..a31b559 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -1347,11 +1347,12 @@ static void addClassToContext(EntryNav *rootNav)
cd->insertUsedFile(fd);
// 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);
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);
}
}
@@ -4113,7 +4114,9 @@ static ClassDef *findClassWithinClassContext(Definition *context,ClassDef *cd,co
{
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);
}
@@ -4638,34 +4641,32 @@ static bool findClassRelation(
int i=baseClassName.find('<');
int si=baseClassName.findRev("::",i==-1 ? baseClassName.length() : i);
if (si==-1) si=0;
+ if (baseClass==0 && (root->lang==SrcLangExt_CSharp || root->lang==SrcLangExt_Java))
+ {
+ baseClass = Doxygen::genericsDict->find(baseClassName);
+ //printf("looking for '%s' result=%p\n",baseClassName.data(),baseClass);
+ }
if (baseClass==0 && i!=-1)
// base class has template specifiers
{
- if (root->lang == SrcLangExt_CSharp)
- {
- baseClass = Doxygen::genericsDict->find(baseClassName);
- }
- else
+ // TODO: here we should try to find the correct template specialization
+ // but for now, we only look for the unspecializated base class.
+ int e=findEndOfTemplate(baseClassName,i+1);
+ //printf("baseClass==0 i=%d e=%d\n",i,e);
+ if (e!=-1) // end of template was found at e
{
- // TODO: here we should try to find the correct template specialization
- // but for now, we only look for the unspecializated base class.
- int e=findEndOfTemplate(baseClassName,i+1);
- //printf("baseClass==0 i=%d e=%d\n",i,e);
- if (e!=-1) // end of template was found at e
- {
- templSpec=removeRedundantWhiteSpace(baseClassName.mid(i,e-i));
- baseClassName=baseClassName.left(i)+baseClassName.right(baseClassName.length()-e);
- baseClass=getResolvedClass(explicitGlobalScope ? Doxygen::globalScope : context,
- cd->getFileDef(),
- baseClassName,
- &baseClassTypeDef,
- 0, //&templSpec,
- mode==Undocumented,
- TRUE
- );
- //printf("baseClass=%p -> baseClass=%s templSpec=%s\n",
- // baseClass,baseClassName.data(),templSpec.data());
- }
+ templSpec=removeRedundantWhiteSpace(baseClassName.mid(i,e-i));
+ baseClassName=baseClassName.left(i)+baseClassName.right(baseClassName.length()-e);
+ baseClass=getResolvedClass(explicitGlobalScope ? Doxygen::globalScope : context,
+ cd->getFileDef(),
+ baseClassName,
+ &baseClassTypeDef,
+ 0, //&templSpec,
+ mode==Undocumented,
+ TRUE
+ );
+ //printf("baseClass=%p -> baseClass=%s templSpec=%s\n",
+ // baseClass,baseClassName.data(),templSpec.data());
}
}
else if (baseClass && !templSpec.isEmpty()) // we have a known class, but also