Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove warnings #2015

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1485,6 +1485,8 @@ class InferringGravsearchTypeInspector(nextInspector: Option[GravsearchTypeInspe
rightEntity = rightIriRef,
usageIndex = usageIndex
)

case _ => throw GravsearchException(s"An invalid `rightEntity` with value: $rightEntity was used.")
}

case _ =>
Expand Down
Expand Up @@ -216,7 +216,7 @@ class CkanResponderV1(responderData: ResponderData) extends Responder(responderD

result = limit match {
case Some(n) if n > 0 => bilder.take(n)
case None => bilder
case _ => bilder
}

} yield result
Expand Down Expand Up @@ -344,7 +344,7 @@ class CkanResponderV1(responderData: ResponderData) extends Responder(responderD

result = limit match {
case Some(n) if n > 0 => booksWithPages.take(n)
case None => booksWithPages
case _ => booksWithPages
}

} yield result
Expand Down Expand Up @@ -412,7 +412,7 @@ class CkanResponderV1(responderData: ResponderData) extends Responder(responderD
resIri = resourcesResponseRows.groupBy(_.rowMap("s")).keys.toVector
result = limit match {
case Some(n) if n > 0 => resIri.take(n)
case None => resIri
case _ => resIri
}
} yield result

Expand Down
Expand Up @@ -1752,7 +1752,7 @@ class ResourcesResponderV2(responderData: ResponderData) extends ResponderWithSt
}
}

case None =>
case _ =>
throw InconsistentRepositoryDataException(
s"Resource $gravsearchTemplateIri has no property ${OntologyConstants.KnoraBase.HasTextFileValue}"
)
Expand Down Expand Up @@ -1828,7 +1828,7 @@ class ResourcesResponderV2(responderData: ResponderData) extends ResponderWithSt
)
}

case None => throw BadRequestException(s"$textProperty is expected to occur once on $resourceIri")
case _ => throw BadRequestException(s"$textProperty is expected to occur once on $resourceIri")
}

/**
Expand Down
Expand Up @@ -224,9 +224,9 @@ class StandoffResponderV2(responderData: ResponderData) extends Responder(respon
}
}

case None =>
case _ =>
throw InconsistentRepositoryDataException(
s"${OntologyConstants.KnoraBase.XSLTransformation} has no property ${OntologyConstants.KnoraBase.HasTextFileValue}"
s"${OntologyConstants.KnoraBase.XSLTransformation} has no or more than one property ${OntologyConstants.KnoraBase.HasTextFileValue}"
)
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ class StoreRouteADM(routeData: KnoraRouteData)
post {
/* ResetTriplestoreContent */
entity(as[Seq[RdfDataObject]]) { apiRequest =>
parameter('prependdefaults.as[Boolean] ? true) { prependDefaults => requestContext =>
parameter(Symbol("prependdefaults").as[Boolean] ? true) { prependDefaults => requestContext =>
val msg = ResetTriplestoreContentRequestADM(
rdfDataObjects = apiRequest,
prependDefaults = prependDefaults,
Expand Down
Expand Up @@ -28,7 +28,7 @@ class CkanRouteV1(routeData: KnoraRouteData) extends KnoraRoute(routeData) with
featureFactoryConfig = featureFactoryConfig
)
params = requestContext.request.uri.query().toMap
project: Option[Seq[String]] = params.get("project").map(_.split(","))
project: Option[Seq[String]] = params.get("project").map(_.split(",").toSeq)
limit: Option[Int] = params.get("limit").map(_.toInt)
info: Boolean = params.getOrElse("info", false) == true
} yield CkanRequestV1(
Expand Down
Expand Up @@ -1135,7 +1135,7 @@ class ResourcesRouteV1(routeData: KnoraRouteData) extends KnoraRoute(routeData)
timeVal,
throw BadRequestException(s"Invalid decimal value in element '${node.label}: '$timeVal'")
)
}
}.toSeq

CreateResourceValueV1(interval_value = Some(tVals))

Expand Down
Expand Up @@ -83,7 +83,7 @@ class AuthenticationRouteV2(routeData: KnoraRouteData)
}
} ~
post { // called by html login interface (necessary for IIIF Authentication API support)
formFields('username, 'password) { (username, password) => requestContext =>
formFields(Symbol("username"), Symbol("password")) { (username, password) => requestContext =>
{
requestContext.complete {
doLoginV2(
Expand Down
Expand Up @@ -268,6 +268,7 @@ class ValuesV1R2RSpec extends R2RSpec {

val (mostRecentVersion, originalVersion) = versionHistory match {
case JsArray(Vector(mostRecent, original)) => (mostRecent.asJsObject.fields, original.asJsObject.fields)
case _ => fail("expected an array, but got something else.")
}

assert(
Expand Down