Skip to content

Commit d939788

Browse files
committed
Move remaining fun references to property references
1 parent 2532510 commit d939788

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

shared/src/main/kotlin/org/javacs/kt/classpath/CachedClassPathResolver.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ internal class CachedClassPathResolver(private val wrapped: ClassPathResolver, p
3939
return newClasspath
4040
}
4141

42-
override fun getCurrentBuildFileVersion(): Long = wrapped.getCurrentBuildFileVersion()
42+
override val currentBuildFileVersion: Long get() = wrapped.currentBuildFileVersion
4343

4444
private fun updateClasspathCache(newClasspathCache: ClasspathCache) {
4545
storage?.setObject("cachedClasspath", newClasspathCache)
46-
storage?.setObject("cachedBuildFileVersion", getCurrentBuildFileVersion())
46+
storage?.setObject("cachedBuildFileVersion", currentBuildFileVersion)
4747
cachedClassPath = newClasspathCache
4848
}
4949

5050
private fun updateBuildScriptClasspathCache(newClasspath: Set<Path>) {
5151
storage?.setObject("cachedBuildScriptClassPath", newClasspath, SetOfPathsAsStringSerializer)
52-
storage?.setObject("cachedBuildFileVersion", getCurrentBuildFileVersion())
52+
storage?.setObject("cachedBuildFileVersion", currentBuildFileVersion)
5353
cachedBuildScriptClassPath = newClasspath
5454
}
5555

5656
private fun dependenciesChanged(): Boolean {
57-
return storage?.getObject<Long>("cachedBuildFileVersion") ?: 0 < wrapped.getCurrentBuildFileVersion()
57+
return storage?.getObject<Long>("cachedBuildFileVersion") ?: 0 < wrapped.currentBuildFileVersion
5858
}
5959
}
6060

shared/src/main/kotlin/org/javacs/kt/classpath/ClassPathResolver.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal class UnionClassPathResolver(val lhs: ClassPathResolver, val rhs: Class
6666
override val buildScriptClasspath get() = lhs.buildScriptClasspath + rhs.buildScriptClasspath
6767
override val buildScriptClasspathOrEmpty get() = lhs.buildScriptClasspathOrEmpty + rhs.buildScriptClasspathOrEmpty
6868
override val classpathWithSources get() = lhs.classpathWithSources + rhs.classpathWithSources
69-
override fun getCurrentBuildFileVersion(): Long = max(lhs.getCurrentBuildFileVersion(), rhs.getCurrentBuildFileVersion())
69+
override val currentBuildFileVersion: Long get() = max(lhs.currentBuildFileVersion, rhs.currentBuildFileVersion)
7070
}
7171

7272
internal class FirstNonEmptyClassPathResolver(val lhs: ClassPathResolver, val rhs: ClassPathResolver) : ClassPathResolver {
@@ -76,5 +76,5 @@ internal class FirstNonEmptyClassPathResolver(val lhs: ClassPathResolver, val rh
7676
override val buildScriptClasspath get() = lhs.buildScriptClasspath.takeIf { it.isNotEmpty() } ?: rhs.buildScriptClasspath
7777
override val buildScriptClasspathOrEmpty get() = lhs.buildScriptClasspathOrEmpty.takeIf { it.isNotEmpty() } ?: rhs.buildScriptClasspathOrEmpty
7878
override val classpathWithSources get() = lhs.classpathWithSources.takeIf { it.isNotEmpty() } ?: rhs.classpathWithSources
79-
override fun getCurrentBuildFileVersion(): Long = max(lhs.getCurrentBuildFileVersion(), rhs.getCurrentBuildFileVersion())
79+
override val currentBuildFileVersion: Long get() = max(lhs.currentBuildFileVersion, rhs.currentBuildFileVersion)
8080
}

shared/src/main/kotlin/org/javacs/kt/classpath/GradleClassPathResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal class GradleClassPathResolver(private val path: Path, private val inclu
3434
}
3535
}
3636

37-
override fun getCurrentBuildFileVersion(): Long = path.toFile().lastModified()
37+
override val currentBuildFileVersion: Long get() = path.toFile().lastModified()
3838

3939
companion object {
4040
/** Create a Gradle resolver if a file is a pom. */

shared/src/main/kotlin/org/javacs/kt/classpath/MavenClassPathResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ internal class MavenClassPathResolver private constructor(private val pom: Path)
5353
}.toSet()
5454
}
5555

56-
override fun getCurrentBuildFileVersion(): Long = pom.toFile().lastModified()
56+
override val currentBuildFileVersion: Long get() = pom.toFile().lastModified()
5757

5858
companion object {
5959
/** Create a maven resolver if a file is a pom. */

shared/src/main/kotlin/org/javacs/kt/classpath/WithStdlibResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal class WithStdlibResolver(private val wrapped: ClassPathResolver) : Clas
1010
override val buildScriptClasspath: Set<Path> get() = wrapWithStdlib(wrapped.buildScriptClasspath)
1111
override val buildScriptClasspathOrEmpty: Set<Path> get() = wrapWithStdlib(wrapped.buildScriptClasspathOrEmpty)
1212
override val classpathWithSources: Set<ClassPathEntry> get() = wrapWithStdlibEntries(wrapped.classpathWithSources)
13-
override fun getCurrentBuildFileVersion(): Long = wrapped.getCurrentBuildFileVersion()
13+
override val currentBuildFileVersion: Long get() = wrapped.currentBuildFileVersion
1414
}
1515

1616
private fun wrapWithStdlibEntries(paths: Set<ClassPathEntry>): Set<ClassPathEntry> {

0 commit comments

Comments
 (0)