Skip to content

Commit

Permalink
Update Classes.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Nov 30, 2023
1 parent 1517af3 commit f1d1782
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ trait ClassW extends PimpedType[Class[_]] {
hasSigHelper(value)
}

def isScalaObject: Boolean = getModuleField.nonEmpty
def isScalaObject: Boolean = findModuleField.isSuccess

def getModuleField: Option[Field] = {
Try(value.getField("MODULE$")).toOption
}
def getModuleField: Option[Field] = findModuleField.toOption

private def findModuleField: Try[Field] = Try(value.getField("MODULE$"))
}

object ClassW {
Expand Down

0 comments on commit f1d1782

Please sign in to comment.