aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-03-19 15:21:22 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-03-19 15:21:22 +0100
commit7b4c960768ec18711c48c540f3150d05780ac92e (patch)
tree7d6fa8cd9401e4c13eff31d32babd8706cc528bd /src
parent92b0386b0c83b9815eda5bebe2f2a48ae47f6eaa (diff)
downloaddokka-7b4c960768ec18711c48c540f3150d05780ac92e.tar.gz
dokka-7b4c960768ec18711c48c540f3150d05780ac92e.tar.bz2
dokka-7b4c960768ec18711c48c540f3150d05780ac92e.zip
protect against compiler exceptions in resolveKDocLink():
/Users/yole/jetbrains/kotlin/libraries/build-docs.xml:13: java.lang.IllegalArgumentException: invalid identifier: at org.jetbrains.kotlin.name.Name.identifier(Name.java:56) at org.jetbrains.kotlin.name.Name.guess(Name.java:86) at org.jetbrains.kotlin.name.FqNameUnsafe.compute(FqNameUnsafe.java:77) at org.jetbrains.kotlin.name.FqNameUnsafe.shortName(FqNameUnsafe.java:151) at org.jetbrains.kotlin.name.FqName.shortName(FqName.java:108) at org.jetbrains.kotlin.descriptors.impl.SubpackagesScope.getDescriptors(SubpackagesScope.kt:44) at org.jetbrains.kotlin.resolve.scopes.ChainedScope.getDescriptors(ChainedScope.kt:65) at org.jetbrains.kotlin.resolve.scopes.JetScope$$TImpl.getDescriptors$default(JetScope.kt:53) at org.jetbrains.kotlin.idea.kdoc.KdocPackage$KDocReference$7d64cd50.resolveKDocLink(KDocReference.kt:94) at org.jetbrains.kotlin.idea.kdoc.KdocPackage.resolveKDocLink(KDocReference.kt:1) at org.jetbrains.dokka.DocumentationBuilder.resolveContentLink(DocumentationBuilder.kt:174)
Diffstat (limited to 'src')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 18a1e74c..e193817a 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -171,8 +171,13 @@ class DocumentationBuilder(val session: ResolveSession,
}
fun resolveContentLink(descriptor: DeclarationDescriptor, href: String): ContentBlock {
- val symbols = resolveKDocLink(session, descriptor, null, href.split('.').toList())
- val symbol = findTargetSymbol(symbols)
+ val symbol = try {
+ val symbols = resolveKDocLink(session, descriptor, null, href.split('.').toList())
+ findTargetSymbol(symbols)
+ } catch(e: Exception) {
+ null
+ }
+
// don't include unresolved links in generated doc
// assume that if an href doesn't contain '/', it's not an attempt to reference an external file
if (symbol != null) {