Skip to content
  • Sean Owen's avatar
    e26dac5f
    [SPARK-21415] Triage scapegoat warnings, part 1 · e26dac5f
    Sean Owen authored
    ## What changes were proposed in this pull request?
    
    Address scapegoat warnings for:
    - BigDecimal double constructor
    - Catching NPE
    - Finalizer without super
    - List.size is O(n)
    - Prefer Seq.empty
    - Prefer Set.empty
    - reverse.map instead of reverseMap
    - Type shadowing
    - Unnecessary if condition.
    - Use .log1p
    - Var could be val
    
    In some instances like Seq.empty, I avoided making the change even where valid in test code to keep the scope of the change smaller. Those issues are concerned with performance and it won't matter for tests.
    
    ## How was this patch tested?
    
    Existing tests
    
    Author: Sean Owen <sowen@cloudera.com>
    
    Closes #18635 from srowen/Scapegoat1.
    e26dac5f
    [SPARK-21415] Triage scapegoat warnings, part 1
    Sean Owen authored
    ## What changes were proposed in this pull request?
    
    Address scapegoat warnings for:
    - BigDecimal double constructor
    - Catching NPE
    - Finalizer without super
    - List.size is O(n)
    - Prefer Seq.empty
    - Prefer Set.empty
    - reverse.map instead of reverseMap
    - Type shadowing
    - Unnecessary if condition.
    - Use .log1p
    - Var could be val
    
    In some instances like Seq.empty, I avoided making the change even where valid in test code to keep the scope of the change smaller. Those issues are concerned with performance and it won't matter for tests.
    
    ## How was this patch tested?
    
    Existing tests
    
    Author: Sean Owen <sowen@cloudera.com>
    
    Closes #18635 from srowen/Scapegoat1.
Loading