Skip to content

Commit

Permalink
updated syntax to Scala 3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Aug 26, 2024
1 parent c660f82 commit 28e9197
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ lazy val vampireSquid = (project in file("vampire-squid"))
"-indent",
"-rewrite",
"-unchecked",
"-Vprofile",
"-rewrite", "-source", "3.4-migration"
"-Vprofile"
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,47 @@ import org.mbari.vampiresquid.repository.jpa.entity.VideoReferenceEntity
*/
class MutableMedia:

var videoSequenceUuid: UUID = _
var videoSequenceUuid: UUID = scala.compiletime.uninitialized

var videoReferenceUuid: UUID = _
var videoReferenceUuid: UUID = scala.compiletime.uninitialized

var videoUuid: UUID = _
var videoUuid: UUID = scala.compiletime.uninitialized

var videoSequenceName: String = _
var videoSequenceName: String = scala.compiletime.uninitialized

var cameraId: String = _
var cameraId: String = scala.compiletime.uninitialized

var videoName: String = _
var videoName: String = scala.compiletime.uninitialized

var uri: URI = _
var uri: URI = scala.compiletime.uninitialized

var startTimestamp: Instant = _
var startTimestamp: Instant = scala.compiletime.uninitialized

var duration: Duration = _
var duration: Duration = scala.compiletime.uninitialized

def duration_millis: Long | Null = Option(duration).map(_.toMillis).orNull

var container: String = _
var container: String = scala.compiletime.uninitialized

var videoCodec: String = _
var videoCodec: String = scala.compiletime.uninitialized

var audioCodec: String = _
var audioCodec: String = scala.compiletime.uninitialized

var width: Int = _
var width: Int = scala.compiletime.uninitialized

var height: Int = _
var height: Int = scala.compiletime.uninitialized

var frameRate: Double = _
var frameRate: Double = scala.compiletime.uninitialized

var sizeBytes: Long = _
var sizeBytes: Long = scala.compiletime.uninitialized

var description: String = _ // VideoReference description
var description: String = scala.compiletime.uninitialized // VideoReference description

var videoSequenceDescription: String = _
var videoSequenceDescription: String = scala.compiletime.uninitialized

var videoDescription: String = _
var videoDescription: String = scala.compiletime.uninitialized

var sha512: Array[Byte] = _
var sha512: Array[Byte] = scala.compiletime.uninitialized

def endTimestamp: Option[Instant] =
if startTimestamp != null && duration != null then Some(startTimestamp.plus(duration))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class VideoReferenceEndpoints(controller: VideoReferenceController)(using ec: Ex
)
}

override val all: List[Endpoint[_, _, _, _, _]] = List(
override val all: List[Endpoint[?, ?, ?, ?, ?]] = List(
findLastUpdateForVideoReference,
findVideoReferenceByUri,
findAllUris,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class BasicJwtService(apiKey: String, issuer: String, signingSecret: String):

def this(params: JwtParams) = this(params.clientSecret, params.issuer, params.signingSecret)

private[this] val algorithm = Algorithm.HMAC512(signingSecret)
private val algorithm = Algorithm.HMAC512(signingSecret)

private[this] val verifier = JWT
private val verifier = JWT
.require(algorithm)
.withIssuer(issuer)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import scala.reflect.classTag
* @since 2016-05-06T11:18:00
*/
abstract class BaseDAO[B <: IPersistentObject: ClassTag](val entityManager: EntityManager) extends DAO[B]:
private[this] val log = LoggerFactory.getLogger(getClass)
private val log = LoggerFactory.getLogger(getClass)

if log.isInfoEnabled then
val props = entityManager.getProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ trait JPADAOFactory extends DAOFactory[VideoSequenceEntity, VideoEntity, VideoRe
* @return
*/
override def newVideoDAO(dao: DAO[?]): VideoDAO[VideoEntity] =
new VideoDAOImpl(dao.asInstanceOf[BaseDAO[_]].entityManager)
new VideoDAOImpl(dao.asInstanceOf[BaseDAO[?]].entityManager)

/**
* Create a new DAO that share the underlying connection (e.g. EntityManager)
Expand All @@ -61,7 +61,7 @@ trait JPADAOFactory extends DAOFactory[VideoSequenceEntity, VideoEntity, VideoRe
* @return
*/
override def newVideoSequenceDAO(dao: DAO[?]): VideoSequenceDAO[VideoSequenceEntity] =
new VideoSequenceDAOImpl(dao.asInstanceOf[BaseDAO[_]].entityManager)
new VideoSequenceDAOImpl(dao.asInstanceOf[BaseDAO[?]].entityManager)

/**
* Create a new DAO that share the underlying connection (e.g. EntityManager)
Expand All @@ -70,7 +70,7 @@ trait JPADAOFactory extends DAOFactory[VideoSequenceEntity, VideoEntity, VideoRe
* @return
*/
override def newVideoReferenceDAO(dao: DAO[?]): VideoReferenceDAO[VideoReferenceEntity] =
new VideoReferenceDAOImpl(dao.asInstanceOf[BaseDAO[_]].entityManager)
new VideoReferenceDAOImpl(dao.asInstanceOf[BaseDAO[?]].entityManager)

class JPADAOFactoryImpl(val entityManagerFactory: EntityManagerFactory) extends JPADAOFactory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class VideoSequenceDAOImpl(entityManager: EntityManager)
with VideoSequenceDAO[VideoSequenceEntity]:

@Transient
private[this] val log = LoggerFactory.getLogger(getClass)
private val log = LoggerFactory.getLogger(getClass)

override def findByCameraID(cameraID: String): Iterable[VideoSequenceEntity] =
findByNamedQuery("VideoSequence.findByCameraID", Map("cameraID" -> cameraID))
Expand Down

0 comments on commit 28e9197

Please sign in to comment.