switched code to use nicer iteration over Map
This commit is contained in:
@@ -44,10 +44,8 @@ abstract class Tag(val name : String) : Element() {
|
||||
builder.append("<")
|
||||
builder.append(name)
|
||||
if (!attributes.isEmpty()) {
|
||||
for (e in attributes.entrySet()) {
|
||||
if (e != null) {
|
||||
builder.append(" ${e.getKey()}=\"${e.getValue()}\"")
|
||||
}
|
||||
for (e in attributes) {
|
||||
builder.append(" ${e.key}=\"${e.value}\"")
|
||||
}
|
||||
}
|
||||
if (children.isEmpty()) {
|
||||
|
||||
@@ -70,20 +70,15 @@ class KDocConfig() {
|
||||
* Resolves a link to the given class name
|
||||
*/
|
||||
fun resolveLink(packageName: String): String {
|
||||
// TODO should be able to do something like
|
||||
// for (e in packageUrls.filterNotNull()) {
|
||||
val entrySet = packagePrefixToUrls.entrySet()
|
||||
if (entrySet != null) {
|
||||
for (e in entrySet) {
|
||||
val p = e?.getKey()
|
||||
val url = e?.getValue()
|
||||
if (p != null && url != null) {
|
||||
if (packageName.startsWith(p)) {
|
||||
return url
|
||||
}
|
||||
for (e in packagePrefixToUrls) {
|
||||
val p = e.key
|
||||
val url = e.value
|
||||
if (p != null && url != null) {
|
||||
if (packageName.startsWith(p)) {
|
||||
return url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (missingPackageUrls.add(packageName)) {
|
||||
println("Warning: could not find external link to package: $packageName")
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -96,8 +96,8 @@ ${stylesheets()}
|
||||
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">Extensions</FONT>
|
||||
<FONT CLASS="FrameItemFont">
|
||||
<BR>""")
|
||||
for (e in map.entrySet()) {
|
||||
val c = e?.getKey()
|
||||
for (e in map) {
|
||||
val c = e.key
|
||||
if (c != null) {
|
||||
println("""<A HREF="${extensionsHref(pkg, c)}" title="extensions functions on class ${c.name} from ${pkg.name}" target="classFrame"><I>${c.name}</I></A>
|
||||
<BR>""")
|
||||
|
||||
Vendored
+6
-6
@@ -136,9 +136,9 @@ ${pkg.detailedDescription(this)}
|
||||
""")
|
||||
|
||||
val groupMap = pkg.groupClassMap()
|
||||
for (e in groupMap.entrySet()) {
|
||||
val group = e?.getKey() ?: "Other"
|
||||
val list = e?.getValue()
|
||||
for (e in groupMap) {
|
||||
val group = e.key ?: "Other"
|
||||
val list = e.value
|
||||
if (list != null) {
|
||||
println(""" <h3>$group</h3>
|
||||
|
||||
@@ -275,13 +275,13 @@ Copyright © 2010-2012. All Rights Reserved.
|
||||
<B>Extensions Summary</B></FONT></TH>
|
||||
</TR>""")
|
||||
|
||||
for (e in map.entrySet()) {
|
||||
val c = e?.getKey()
|
||||
for (e in map) {
|
||||
val c = e.key
|
||||
if (c != null) {
|
||||
println("""<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="${extensionsHref(pkg, c)}" title="extensions on ${pkg.name}">${c.name}</A></B></TD>
|
||||
<TD>""")
|
||||
val list = e?.getValue()
|
||||
val list = e.value
|
||||
if (list != null) {
|
||||
val functions = filterDuplicateNames(list)
|
||||
for (f in functions) {
|
||||
|
||||
Reference in New Issue
Block a user