Posts

Showing posts with the label static-analysis

fruitless type test: a value of type Option[akka.actor.ActorSystem] cannot also be a akka.actor.ActorSystem

fruitless type test: a value of type Option[akka.actor.ActorSystem] cannot also be a akka.actor.ActorSystem I am using scapegoat for static code analysis i am getting a warning message fruitless type test: a value of type Option[akka.actor.ActorSystem] cannot also be a akka.actor.ActorSystem here is my code object ActorSystemSetting extends ActorSystemSettingTrait{ val config = ConfigFactory.load() val log = LoggerFactory.getLogger(this.getClass) var actorSystem : Option[ActorSystem] = None def createActorSystem: Option[ActorSystem] = { actorSystem = Option(ActorSystem("ArteciateActorSystem", config)) actorSystem } def getActorSystem : Option[ActorSystem] ={ if (actorSystem == None){ createActorSystem } else{ log.debug("ActorSystem is not null") } actorSystem } } In this section i am getting warning message on the line case Some(system: ActorSystem) => Option(ActorSystemSetting.getActorSystem) mat...