Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13061#discussion_r63401279
  
    --- Diff: core/src/main/scala/org/apache/spark/package.scala ---
    @@ -41,7 +41,50 @@ package org.apache
      * level interfaces. These are subject to changes or removal in minor 
releases.
      */
     
    +import java.util.Properties
    +
    +import org.apache.spark.internal.Logging
    +
     package object spark {
    -  // For package docs only
    -  val SPARK_VERSION = "2.0.0-SNAPSHOT"
    +
    +  object SparkBuildInfo extends Logging {
    --- End diff --
    
    Is this object necessary? It seems you already have explicit constants for 
everything, and instead this could just initialize them directly. Something 
like:
    
    ```
    val (
        SPARK_VERSION,
        SPARK_BRANCH,
        SPARK_REVISION,
        SPARK_BUILD_USER,
        SPARK_REPO_URL,
        SPARK_BUILD_DATE) = {
      // Code to read the properties file.
    }
    ```
    
    Not super pretty, but about as pretty as your current code; iirc Scala 
doesn't really have static initializers like Java, which would make this a 
little nicer.
    
    At the very least, this object should be private. I don't see a need to 
expose it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to