diff --git a/thehive/app/org/thp/thehive/models/Tag.scala b/thehive/app/org/thp/thehive/models/Tag.scala index ee1264f61e..96e74923dc 100644 --- a/thehive/app/org/thp/thehive/models/Tag.scala +++ b/thehive/app/org/thp/thehive/models/Tag.scala @@ -17,10 +17,11 @@ case class Tag( ) { override def hashCode(): Int = 31 * (31 * value.## + predicate.##) + namespace.## - override def equals(obj: Any): Boolean = obj match { - case Tag(n, p, v, _, _) => n == namespace && p == predicate && v == value - case _ => false - } + override def equals(obj: Any): Boolean = + obj match { + case Tag(n, p, v, _, _) => n == namespace && p == predicate && v == value + case _ => false + } override def canEqual(that: Any): Boolean = that.isInstanceOf[Tag] @@ -34,7 +35,7 @@ object Tag { lazy val logger: Logger = Logger(getClass) val tagColour: Regex = "(.*)(#\\p{XDigit}{6})".r val namespacePredicateValue: Regex = "([^\".:=]+)[.:]([^\".=]+)=\"?([^\"]+)\"?".r - val namespacePredicate: Regex = "([^\".:=]+)[.]([^\".=]+)".r + val namespacePredicate: Regex = "([^\".:=]+)[.:]([^\".=]+)".r val PredicateValue: Regex = "([^\".:=]+)[=:]\"?([^\"]+)\"?".r val predicate: Regex = "([^\".:=]+)".r diff --git a/thehive/app/org/thp/thehive/services/CaseSrv.scala b/thehive/app/org/thp/thehive/services/CaseSrv.scala index b0556e5495..664f54104a 100644 --- a/thehive/app/org/thp/thehive/services/CaseSrv.scala +++ b/thehive/app/org/thp/thehive/services/CaseSrv.scala @@ -144,7 +144,7 @@ class CaseSrv @Inject() ( def updateTagNames(`case`: Case with Entity, tags: Set[String])(implicit graph: Graph, authContext: AuthContext): Try[Unit] = tags.toTry(tagSrv.getOrCreate).flatMap(t => updateTags(`case`, t.toSet)) - def updateTags(`case`: Case with Entity, tags: Set[Tag with Entity])(implicit graph: Graph, authContext: AuthContext): Try[Unit] = { + private def updateTags(`case`: Case with Entity, tags: Set[Tag with Entity])(implicit graph: Graph, authContext: AuthContext): Try[Unit] = { val (tagsToAdd, tagsToRemove) = get(`case`) .tags .toIterator