File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -475,18 +475,19 @@ class DependencyRecorder {
475
475
}
476
476
}
477
477
478
- val depFile = dep.toClass.associatedFile
478
+ val depClass = dep.toClass
479
+ val depFile = depClass.associatedFile
479
480
if depFile != null then {
480
481
// Cannot ignore inheritance relationship coming from the same source (see sbt/zinc#417)
481
482
def allowLocal = dep.context == DependencyByInheritance || dep.context == LocalDependencyByInheritance
482
483
if depFile.hasTastyExtension then
483
- processExternalDependency(depFile, dep.toClass .binaryClassName, convertTasty = true )
484
+ processExternalDependency(depFile, depClass .binaryClassName, convertTasty = true )
484
485
else if depFile.hasClassExtension then
485
- processExternalDependency(depFile, dep.toClass .binaryClassName, convertTasty = false )
486
+ processExternalDependency(depFile, depClass .binaryClassName, convertTasty = false )
486
487
else if allowLocal || depFile != sourceFile.file then
487
488
// We cannot ignore dependencies coming from the same source file because
488
489
// the dependency info needs to propagate. See source-dependencies/trait-trait-211.
489
- val toClassName = classNameAsString(dep.toClass )
490
+ val toClassName = classNameAsString(depClass )
490
491
cb.classDependency(toClassName, fromClassName, dep.context)
491
492
}
492
493
}
Original file line number Diff line number Diff line change @@ -97,8 +97,10 @@ abstract class AbstractFile extends Iterable[AbstractFile] {
97
97
/** Returns the path of this abstract file in a canonical form. */
98
98
def canonicalPath : String = if (jpath == null ) path else jpath.normalize.toString
99
99
100
- /** Checks extension case insensitively. */
100
+ /** Checks extension case insensitively. TODO: change to enum */
101
101
def hasExtension (other : String ): Boolean = extension == other.toLowerCase
102
+
103
+ /** Returns the extension of this abstract file. TODO: store as an enum to avoid costly comparisons */
102
104
val extension : String = Path .extension(name)
103
105
104
106
/** The absolute file, if this is a relative file. */
You can’t perform that action at this time.
0 commit comments