Skip to content

Commit

Permalink
Merge pull request #60 from scaldi/undolog
Browse files Browse the repository at this point in the history
Wrap <:< check in undolog fixes #51. Also minor formatting updates, n…
  • Loading branch information
dave-handy committed Jul 27, 2021
2 parents b76953e + 0999982 commit 9bac57d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 24 deletions.
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version = 3.0.0-RC6

project.git = true
maxColumn = 120
docstrings.oneline = fold

align.preset = more

Expand Down
16 changes: 0 additions & 16 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
SBT Configuration:

```sbtshell
libraryDependencies += "org.scaldi" %% "scaldi-jsr330" % "0.6.0"
libraryDependencies += "org.scaldi" %% "scaldi-jsr330" % x.y.z
```
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ licenses := Seq(

scalaVersion := "2.13.6"
crossScalaVersions := Seq("2.11.12", "2.12.14", "2.13.6")
mimaPreviousArtifacts := Set("0.6.0").map(organization.value %% name.value % _)
mimaPreviousArtifacts := Set("0.6.0", "0.6.1").map(organization.value %% name.value % _)
scalacOptions ++= Seq("-deprecation", "-feature")
crossPaths := false

libraryDependencies ++= Seq(
"org.scaldi" %% "scaldi" % "0.6.1",
"org.scaldi" %% "scaldi" % "0.6.2",
"javax.inject" % "javax.inject" % "1",
"org.scalatest" %% "scalatest" % "3.2.9" % Test,
"com.github.sbt" % "junit-interface" % "0.13.2" % Test,
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/scaldi/jsr330/AnnotationBinding.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import java.lang.annotation.Annotation
import java.lang.reflect.Constructor
import javax.inject.{Inject, Named, Qualifier, Scope, Singleton, Provider => JProvider}
import scala.reflect.runtime.universe._
import scaldi.util.ReflectionHelper._

/** Binding for JSR 330 compliant types. */
case class AnnotationBinding(
Expand Down Expand Up @@ -174,7 +175,7 @@ case class AnnotationBinding(
val (s, annotations) = symbolWithAnnotations
val it = s.typeSignature.resultType

if (it <:< typeOf[JProvider[_]]) {
if (it safe_<:< typeOf[JProvider[_]]) {
val actualType = it.typeArgs.head
val identifiers = TypeTagIdentifier(actualType) :: annotationIds(annotations)

Expand All @@ -194,8 +195,7 @@ case class AnnotationBinding(

object AnnotationBinding {

/** Extracts a list of identifiers from JSR 330 compliant type
*/
/** Extracts a list of identifiers from JSR 330 compliant type */
def extractIdentifiers(tpe: Type): List[Identifier] =
findConstructor(tpe) map (_ => TypeTagIdentifier(tpe) :: Nil) getOrElse Nil

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package scaldi.jsr330

import scaldi._

/** Injector that creates JSR 330 compliant bindings on-demand (when they are injected)
*/
/** Injector that creates JSR 330 compliant bindings on-demand (when they are injected) */
class OnDemandAnnotationInjector
extends MutableInjectorUser
with InjectorWithLifecycle[OnDemandAnnotationInjector]
Expand Down

0 comments on commit 9bac57d

Please sign in to comment.