Skip to content

Commit

Permalink
use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Oct 21, 2024
1 parent 6979696 commit 029ba25
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions common/src/main/scala/org/apache/comet/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@ package object comet {
* information is included to aid in future debugging efforts for releases.
*/
private object CometBuildInfo extends Logging {
private val GIT_INFO_PROPS_FILENAME = "comet-git-info.properties"

val props: Properties = {
val props = new Properties()
val resourceStream = Thread
.currentThread()
.getContextClassLoader
.getResourceAsStream("comet-git-info.properties")
.getResourceAsStream(GIT_INFO_PROPS_FILENAME)
if (resourceStream != null) {
try {
props.load(resourceStream)
} catch {
case e: Exception =>
logError("Error loading properties from comet-git-info.properties", e)
logError(s"Error loading properties from $GIT_INFO_PROPS_FILENAME", e)
} finally {
if (resourceStream != null) {
try {
Expand All @@ -65,7 +66,7 @@ package object comet {
}
}
} else {
logWarning("Could not find comet-git-info.properties")
logWarning(s"Could not find $GIT_INFO_PROPS_FILENAME")
}
props
}
Expand Down

0 comments on commit 029ba25

Please sign in to comment.