Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Friendseeker committed Sep 27, 2024
1 parent f65787e commit fa99c37
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object SourceInfos {
}
}

private[inc] final class MSourceInfos(val allInfos: Map[VirtualFileRef, SourceInfo])
private final class MSourceInfos(val allInfos: Map[VirtualFileRef, SourceInfo])
extends SourceInfos {

def ++(o: SourceInfos) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class TestCallback extends AnalysisCallback3 {

override def getPickleJarPair = Optional.empty()

override def getSourceInfos: ReadSourceInfos = null
override def getSourceInfos: ReadSourceInfos = new TestSourceInfos
}

object TestCallback {
Expand Down
23 changes: 23 additions & 0 deletions internal/zinc-testing/src/main/scala/xsbti/TestSourceInfo.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

package xsbti

import xsbti.compile.analysis.SourceInfo

class TestSourceInfo extends SourceInfo {

override def getReportedProblems: Array[Problem] = Array.empty[Problem]

override def getUnreportedProblems: Array[Problem] = Array.empty[Problem]

override def getMainClasses: Array[String] = Array.empty[String]
}
24 changes: 24 additions & 0 deletions internal/zinc-testing/src/main/scala/xsbti/TestSourceInfos.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

package xsbti

import xsbti.compile.analysis.{ ReadSourceInfos, SourceInfo }

import java.util

class TestSourceInfos extends ReadSourceInfos {

override def get(sourceFile: VirtualFileRef): SourceInfo = new TestSourceInfo

override def getAllSourceInfos: util.Map[VirtualFileRef, SourceInfo] =
new util.HashMap[VirtualFileRef, SourceInfo]()
}

0 comments on commit fa99c37

Please sign in to comment.