fixed up compile errors after recent visibility rule changes
This commit is contained in:
@@ -34,7 +34,7 @@ import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
||||
/** Generates the Kotlin Documentation for the model */
|
||||
class KDoc() : KModelCompilerPlugin() {
|
||||
|
||||
override fun processModel(model: KModel) {
|
||||
protected override fun processModel(model: KModel) {
|
||||
// TODO allow this to be configured; maybe we use configuration on the KotlinModule
|
||||
// to define what doclets to use?
|
||||
val generator = JavadocStyleHtmlDoclet()
|
||||
|
||||
@@ -20,7 +20,7 @@ fun main(args: Array<String?>): Unit {
|
||||
*/
|
||||
class KDocCompiler() : KotlinCompiler() {
|
||||
|
||||
override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?, errStream : PrintStream?) {
|
||||
protected override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?, errStream : PrintStream?) {
|
||||
super.configureEnvironment(environment, arguments, errStream)
|
||||
val coreEnvironment = environment?.getEnvironment()
|
||||
if (coreEnvironment != null) {
|
||||
@@ -38,11 +38,11 @@ class KDocCompiler() : KotlinCompiler() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun createArguments() : CompilerArguments? {
|
||||
protected override fun createArguments() : CompilerArguments? {
|
||||
return KDocArguments()
|
||||
}
|
||||
|
||||
override fun usage(target : PrintStream?) {
|
||||
protected override fun usage(target : PrintStream?) {
|
||||
target?.println("Usage: KDocCompiler -docOutput <docOutputDir> [-output <outputDir>|-jar <jarFileName>] [-stdlib <path to runtime.jar>] [-src <filename or dirname>|-module <module file>] [-includeRuntime]");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,11 +99,11 @@ class KDocConfig() {
|
||||
}
|
||||
|
||||
private class LongestFirstStringComparator() : Comparator<String> {
|
||||
override fun compare(s1: String?, s2: String?): Int {
|
||||
public override fun compare(s1: String?, s2: String?): Int {
|
||||
return compareBy(s1, s2, { (s: String) -> s.length() }, { (s: String) -> s })
|
||||
}
|
||||
|
||||
override fun equals(obj : Any?) : Boolean {
|
||||
public override fun equals(obj : Any?) : Boolean {
|
||||
return obj is LongestFirstStringComparator
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ import org.jetbrains.jet.compiler.CompilerPluginContext
|
||||
*/
|
||||
class HtmlCompilerPlugin: CompilerPlugin {
|
||||
|
||||
override fun processFiles(context: CompilerPluginContext?) {
|
||||
public override fun processFiles(context: CompilerPluginContext?) {
|
||||
if (context != null) {
|
||||
val bindingContext = context.getContext()
|
||||
val files = context.getFiles()
|
||||
|
||||
+6
-7
@@ -8,28 +8,27 @@ import com.intellij.psi.PsiComment
|
||||
|
||||
class HtmlKotlinVisitor: JetTreeVisitor<StringBuilder>() {
|
||||
|
||||
override fun visitFile(file: PsiFile?) {
|
||||
public override fun visitFile(file: PsiFile?) {
|
||||
if (file is JetFile) {
|
||||
val data = StringBuilder()
|
||||
visitJetFile(file, data)
|
||||
}
|
||||
}
|
||||
override fun visitJetFile(file: JetFile?, data: StringBuilder?): Void? {
|
||||
public override fun visitJetFile(file: JetFile?, data: StringBuilder?): Void? {
|
||||
if (file != null) {
|
||||
println("============ Jet File ${file.getName()}")
|
||||
val data = StringBuilder()
|
||||
acceptChildren(file, data)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
override fun visitClassObject(classObject: JetClassObject?, data: StringBuilder?): Void? {
|
||||
public override fun visitClassObject(classObject: JetClassObject?, data: StringBuilder?): Void? {
|
||||
println("============ class $classObject data $data")
|
||||
return super.visitClassObject(classObject, data)
|
||||
}
|
||||
|
||||
override fun visitClass(klass: JetClass?, data: StringBuilder?): Void? {
|
||||
public override fun visitClass(klass: JetClass?, data: StringBuilder?): Void? {
|
||||
println("============ class $klass")
|
||||
if (klass != null) {
|
||||
acceptChildren(klass, data)
|
||||
@@ -40,13 +39,13 @@ class HtmlKotlinVisitor: JetTreeVisitor<StringBuilder>() {
|
||||
}
|
||||
|
||||
|
||||
override fun visitClassBody(classBody: JetClassBody?, data: StringBuilder?): Void? {
|
||||
public override fun visitClassBody(classBody: JetClassBody?, data: StringBuilder?): Void? {
|
||||
println("============ class body $classBody data $data")
|
||||
return super.visitClassBody(classBody, data)
|
||||
}
|
||||
|
||||
|
||||
override fun visitFunctionType(fnType: JetFunctionType?, data: StringBuilder?): Void? {
|
||||
public override fun visitFunctionType(fnType: JetFunctionType?, data: StringBuilder?): Void? {
|
||||
println("======================= function Type $fnType")
|
||||
return super.visitFunctionType(fnType, data)
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ abstract class KModelCompilerPlugin: CompilerPlugin {
|
||||
public open var config: KDocConfig = KDocConfig()
|
||||
|
||||
|
||||
override fun processFiles(context: CompilerPluginContext?) {
|
||||
public override fun processFiles(context: CompilerPluginContext?) {
|
||||
if (context != null) {
|
||||
val bindingContext = context.getContext()
|
||||
val sources = context.getFiles()
|
||||
@@ -23,5 +23,5 @@ abstract class KModelCompilerPlugin: CompilerPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
abstract fun processModel(model: KModel): Unit
|
||||
protected abstract fun processModel(model: KModel): Unit
|
||||
}
|
||||
@@ -564,7 +564,7 @@ class KModel(var context: BindingContext, val config: KDocConfig) {
|
||||
|
||||
class TemplateLinkRenderer(val annotated: KAnnotated, val template: KDocTemplate): LinkRenderer() {
|
||||
|
||||
override fun render(node: WikiLinkNode?): Rendering? {
|
||||
public override fun render(node: WikiLinkNode?): Rendering? {
|
||||
val answer = super.render(node)
|
||||
if (answer != null) {
|
||||
val text = answer.text
|
||||
@@ -668,15 +668,15 @@ class TemplateLinkRenderer(val annotated: KAnnotated, val template: KDocTemplate
|
||||
*/
|
||||
}
|
||||
|
||||
override fun render(node: RefLinkNode?, url: String?, title: String?, text: String?): Rendering? {
|
||||
public override fun render(node: RefLinkNode?, url: String?, title: String?, text: String?): Rendering? {
|
||||
return super.render(node, url, title, text)
|
||||
}
|
||||
|
||||
override fun render(node: AutoLinkNode?): Rendering? {
|
||||
public override fun render(node: AutoLinkNode?): Rendering? {
|
||||
return super.render(node)
|
||||
}
|
||||
|
||||
override fun render(node: ExpLinkNode?, text: String?): Rendering? {
|
||||
public override fun render(node: ExpLinkNode?, text: String?): Rendering? {
|
||||
return super.render(node, text)
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ abstract class KAnnotated(val model: KModel, val declarationDescriptor: Declarat
|
||||
|
||||
abstract class KNamed(val name: String, model: KModel, declarationDescriptor: DeclarationDescriptor): KAnnotated(model, declarationDescriptor), Comparable<KNamed> {
|
||||
|
||||
override fun compareTo(other: KNamed): Int = name.compareTo(other.name)
|
||||
public override fun compareTo(other: KNamed): Int = name.compareTo(other.name)
|
||||
|
||||
open fun equals(other: KPackage) = name == other.name
|
||||
|
||||
@@ -718,7 +718,7 @@ class KPackage(model: KModel, val descriptor: NamespaceDescriptor,
|
||||
val name: String,
|
||||
var local: Boolean = false): KClassOrPackage(model, descriptor), Comparable<KPackage> {
|
||||
|
||||
override fun compareTo(other: KPackage): Int = name.compareTo(other.name)
|
||||
public override fun compareTo(other: KPackage): Int = name.compareTo(other.name)
|
||||
|
||||
fun equals(other: KPackage) = name == other.name
|
||||
|
||||
@@ -839,7 +839,7 @@ class KClass(val pkg: KPackage, val descriptor: ClassDescriptor,
|
||||
var nestedClasses: List<KClass> = arrayList<KClass>(),
|
||||
var sourceLine: Int = 2): KClassOrPackage(pkg.model, descriptor), Comparable<KClass> {
|
||||
|
||||
override fun compareTo(other: KClass): Int = name.compareTo(other.name)
|
||||
public override fun compareTo(other: KClass): Int = name.compareTo(other.name)
|
||||
|
||||
fun equals(other: KClass) = name == other.name
|
||||
|
||||
@@ -924,7 +924,7 @@ class KFunction(val descriptor: CallableDescriptor, val owner: KClassOrPackage,
|
||||
|
||||
public val parameterTypeText: String = parameters.map{ it.aType.name }.makeString(", ")
|
||||
|
||||
override fun compareTo(other: KFunction): Int {
|
||||
public override fun compareTo(other: KFunction): Int {
|
||||
var answer = name.compareTo(other.name)
|
||||
if (answer == 0) {
|
||||
answer = parameterTypeText.compareTo(other.parameterTypeText)
|
||||
@@ -952,7 +952,7 @@ class KFunction(val descriptor: CallableDescriptor, val owner: KClassOrPackage,
|
||||
class KProperty(val owner: KClassOrPackage, val descriptor: PropertyDescriptor, val name: String,
|
||||
val returnType: KType, val extensionClass: KClass?): KAnnotated(owner.model, descriptor), Comparable<KProperty> {
|
||||
|
||||
override fun compareTo(other: KProperty): Int = name.compareTo(other.name)
|
||||
public override fun compareTo(other: KProperty): Int = name.compareTo(other.name)
|
||||
|
||||
public val link: String = "$name"
|
||||
|
||||
|
||||
@@ -32,22 +32,22 @@ class PegdownTest() : TestCase() {
|
||||
|
||||
class CustomLinkRenderer() : LinkRenderer() {
|
||||
|
||||
override fun render(node : WikiLinkNode?) : Rendering? {
|
||||
public override fun render(node : WikiLinkNode?) : Rendering? {
|
||||
println("LinkRenderer.render(WikiLinkNode): $node")
|
||||
return super.render(node)
|
||||
}
|
||||
|
||||
override fun render(node : RefLinkNode?, url : String?, title : String?, text : String?) : Rendering? {
|
||||
public override fun render(node : RefLinkNode?, url : String?, title : String?, text : String?) : Rendering? {
|
||||
println("LinkRenderer.render(RefLinkNode): $node url: $url title: $title text: $text")
|
||||
return super.render(node, url, title, text)
|
||||
}
|
||||
|
||||
override fun render(node : AutoLinkNode?) : Rendering? {
|
||||
public override fun render(node : AutoLinkNode?) : Rendering? {
|
||||
println("LinkRenderer.render(AutoLinkNode): $node")
|
||||
return super.render(node)
|
||||
}
|
||||
|
||||
override fun render(node : ExpLinkNode?, text : String?) : Rendering? {
|
||||
public override fun render(node : ExpLinkNode?, text : String?) : Rendering? {
|
||||
println("LinkRenderer.render(ExpLinkNode): $node text: $text")
|
||||
return super.render(node, text)
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@ import junit.framework.TestCase
|
||||
import junit.framework.Assert.*
|
||||
|
||||
class EmailTemplate(var name: String = "James", var time: Date = Date()) : TextTemplate() {
|
||||
override fun render() {
|
||||
public override fun render() {
|
||||
print("Hello there $name and how are you? Today is $time. Kotlin rocks")
|
||||
}
|
||||
}
|
||||
|
||||
class MoreDryTemplate(var name: String = "James", var time: Date = Date()) : TextTemplate() {
|
||||
override fun render() {
|
||||
public override fun render() {
|
||||
+"Hey there $name and how are you? Today is $time. Kotlin rocks"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ import java.util.List
|
||||
fun ResultSet.iterator() : Iterator<ResultSet> {
|
||||
val rs = this
|
||||
return object : Iterator<ResultSet>{
|
||||
override val hasNext : Boolean
|
||||
public override val hasNext : Boolean
|
||||
get() = rs.next()
|
||||
|
||||
override fun next() : ResultSet = rs
|
||||
public override fun next() : ResultSet = rs
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user