[jira] [Commented] (ACCUMULO-4158) Investigate using Google's error-prone

2018-05-09 Thread Mark Owens (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16468771#comment-16468771
 ] 

Mark Owens commented on ACCUMULO-4158:
--

Un-assigning myself from ticket since I haven't had opportunity to spend much 
time working on it. I have made use of errorprone to enforce missing override 
annotations on ACCUMULO-2537 and generally like the tool. But I'm not sure it 
is able to handle the range of issues that Findbugs currently deals with at 
this time. I have not had time to make that detailed comparison.

> Investigate using Google's error-prone
> --
>
> Key: ACCUMULO-4158
> URL: https://issues.apache.org/jira/browse/ACCUMULO-4158
> Project: Accumulo
>  Issue Type: Improvement
>  Components: build
>Reporter: Michael Wall
>Assignee: Mark Owens
>Priority: Minor
> Attachments: ep-main.summary, ep-tests.summary
>
>
> Google has a tool at http://errorprone.info.  From that page
> {quote}
> Using Error Prone to augment the compiler’s type analysis, you can catch more 
> mistakes before they cost you time, or end up as bugs in production.
> {quote}
> It requires java 1.8.  In the top level pom, replacing
> {code:xml}
> 
>   maven-compiler-plugin
>   
> ${java.ver}
> ${java.ver}
> true
> true
> true
>   
> 
> {code}
> with
> {code:xml}
> 
>   org.apache.maven.plugins
>   maven-compiler-plugin
>   3.3
>   
> javac-with-errorprone
> true
> 
> ${java.ver}
> ${java.ver}
> 
>   -Xep:ChainingConstructorIgnoresParameter:WARN
>   -Xep:LongLiteralLowerCaseSuffix:OFF
>   -Xep:SizeGreaterThanOrEqualsZero:WARN
>   -Xep:InvalidPatternSyntax:WARN
>   -Xep:TryFailThrowable:WARN
>   -Xep:NonOverridingEquals:OFF
> 
> true
>   
>   
> 
> 
>   com.google.errorprone
>   error_prone_core
>   2.0.8
> 
> 
>   org.codehaus.plexus
>   plexus-compiler-javac-errorprone
>   2.5
> 
>   
> 
> {code}
> in the 1.6 branch and runing 'mvn compile' yielded the following. 
> {noformat}
> [INFO] Scanning for projects...
> [INFO] 
> 
> [INFO] Reactor Build Order:
> [INFO] 
> [INFO] Apache Accumulo Project
> [INFO] Apache Accumulo Trace
> [INFO] Apache Accumulo Fate
> [INFO] Apache Accumulo Start
> [INFO] Apache Accumulo Core
> [INFO] Apache Accumulo Simple Examples
> [INFO] Apache Accumulo Server Base
> [INFO] Apache Accumulo GC Server
> [INFO] Apache Accumulo Master Server
> [INFO] Apache Accumulo Monitor Server
> [INFO] Apache Accumulo Tracer Server
> [INFO] Apache Accumulo Tablet Server
> [INFO] Apache Accumulo MiniCluster
> [INFO] Apache Accumulo Native Libraries
> [INFO] Apache Accumulo Testing
> [INFO] Apache Accumulo Proxy
> [INFO] Apache Accumulo
> [INFO] Apache Accumulo Documentation
> [INFO] Apache Accumulo Maven Plugin
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Project 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Trace 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Fate 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Start 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Core 1.6.6-SNAPSHOT
> [INFO] 
> 

[jira] [Commented] (ACCUMULO-4158) Investigate using Google's error-prone

2018-01-10 Thread Jared R (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16320449#comment-16320449
 ] 

Jared R commented on ACCUMULO-4158:
---

I think the discussion here is about enforcing this error prone check, but just 
as a side note, I don't know what IDE (if any) people are using to develop but 
Intellij IDE has a nice feature where it does display a yellow or red circle at 
the top of display when a file has warnings and/or errors. Eclipse might have 
something similar and I just haven't noticed. It's really helpful personally 
when I'm developing because I try to make sure I get the green check. 

> Investigate using Google's error-prone
> --
>
> Key: ACCUMULO-4158
> URL: https://issues.apache.org/jira/browse/ACCUMULO-4158
> Project: Accumulo
>  Issue Type: Improvement
>  Components: build
>Reporter: Michael Wall
>Assignee: Mark Owens
>Priority: Minor
> Attachments: ep-main.summary, ep-tests.summary
>
>
> Google has a tool at http://errorprone.info.  From that page
> {quote}
> Using Error Prone to augment the compiler’s type analysis, you can catch more 
> mistakes before they cost you time, or end up as bugs in production.
> {quote}
> It requires java 1.8.  In the top level pom, replacing
> {code:xml}
> 
>   maven-compiler-plugin
>   
> ${java.ver}
> ${java.ver}
> true
> true
> true
>   
> 
> {code}
> with
> {code:xml}
> 
>   org.apache.maven.plugins
>   maven-compiler-plugin
>   3.3
>   
> javac-with-errorprone
> true
> 
> ${java.ver}
> ${java.ver}
> 
>   -Xep:ChainingConstructorIgnoresParameter:WARN
>   -Xep:LongLiteralLowerCaseSuffix:OFF
>   -Xep:SizeGreaterThanOrEqualsZero:WARN
>   -Xep:InvalidPatternSyntax:WARN
>   -Xep:TryFailThrowable:WARN
>   -Xep:NonOverridingEquals:OFF
> 
> true
>   
>   
> 
> 
>   com.google.errorprone
>   error_prone_core
>   2.0.8
> 
> 
>   org.codehaus.plexus
>   plexus-compiler-javac-errorprone
>   2.5
> 
>   
> 
> {code}
> in the 1.6 branch and runing 'mvn compile' yielded the following. 
> {noformat}
> [INFO] Scanning for projects...
> [INFO] 
> 
> [INFO] Reactor Build Order:
> [INFO] 
> [INFO] Apache Accumulo Project
> [INFO] Apache Accumulo Trace
> [INFO] Apache Accumulo Fate
> [INFO] Apache Accumulo Start
> [INFO] Apache Accumulo Core
> [INFO] Apache Accumulo Simple Examples
> [INFO] Apache Accumulo Server Base
> [INFO] Apache Accumulo GC Server
> [INFO] Apache Accumulo Master Server
> [INFO] Apache Accumulo Monitor Server
> [INFO] Apache Accumulo Tracer Server
> [INFO] Apache Accumulo Tablet Server
> [INFO] Apache Accumulo MiniCluster
> [INFO] Apache Accumulo Native Libraries
> [INFO] Apache Accumulo Testing
> [INFO] Apache Accumulo Proxy
> [INFO] Apache Accumulo
> [INFO] Apache Accumulo Documentation
> [INFO] Apache Accumulo Maven Plugin
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Project 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Trace 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Fate 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Start 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Core 1.6.6-SNAPSHOT

[jira] [Commented] (ACCUMULO-4158) Investigate using Google's error-prone

2018-01-10 Thread Mark Owens (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16320329#comment-16320329
 ] 

Mark Owens commented on ACCUMULO-4158:
--

[~ctubbsii], I agree that it would best be used as a development tool. I was 
interested in seeing what types of issues it would discover. I created a new 
maven profile to run error-prone displaying all findings as warnings. I created 
a couple of summary files displaying the results that I'll attach in case 
anyone is interested in viewing them. There was no editing of bug-issues in 
these runs. All issues that error-prone thinks should be examined are displayed.

Some of the warnings such are LongLiteralLowerCaseSuffix, i.e., using capital 
'L' for longs, aren't critical but they do add to consistentcy in the look of 
the code base. Additionally, for older guys such as myself, whose eyesight is 
not what is used to be, using a capital does make parsing the code much easier 
:)

If we decided to use an error-prone profile as a dev tool we could come to a 
consensus as to how to manage the error-prone bug list. There are options to 
display everything as a warning rather than an error, as well as options to 
turn off any particular bug-check completely. You can also convert any warning 
to error, or vice-versa. It can also be set to ignore issues in generated code.

There is also a feature that allows error-prone to create patches that can be 
used to update the code with selected fixes. For instance, for testing 
purposes, I ran a patch to add all missing Override annotations to the code. An 
error-prone profile could be used to enforce this convention in future code as 
this can be flagged as an error, see 
(https://issues.apache.org/jira/browse/ACCUMULO-2537).

I've heard of Spotbugs but have not taken a look as of yet. I'll look into it.


> Investigate using Google's error-prone
> --
>
> Key: ACCUMULO-4158
> URL: https://issues.apache.org/jira/browse/ACCUMULO-4158
> Project: Accumulo
>  Issue Type: Improvement
>  Components: build
>Reporter: Michael Wall
>Assignee: Mark Owens
>Priority: Minor
>
> Google has a tool at http://errorprone.info.  From that page
> {quote}
> Using Error Prone to augment the compiler’s type analysis, you can catch more 
> mistakes before they cost you time, or end up as bugs in production.
> {quote}
> It requires java 1.8.  In the top level pom, replacing
> {code:xml}
> 
>   maven-compiler-plugin
>   
> ${java.ver}
> ${java.ver}
> true
> true
> true
>   
> 
> {code}
> with
> {code:xml}
> 
>   org.apache.maven.plugins
>   maven-compiler-plugin
>   3.3
>   
> javac-with-errorprone
> true
> 
> ${java.ver}
> ${java.ver}
> 
>   -Xep:ChainingConstructorIgnoresParameter:WARN
>   -Xep:LongLiteralLowerCaseSuffix:OFF
>   -Xep:SizeGreaterThanOrEqualsZero:WARN
>   -Xep:InvalidPatternSyntax:WARN
>   -Xep:TryFailThrowable:WARN
>   -Xep:NonOverridingEquals:OFF
> 
> true
>   
>   
> 
> 
>   com.google.errorprone
>   error_prone_core
>   2.0.8
> 
> 
>   org.codehaus.plexus
>   plexus-compiler-javac-errorprone
>   2.5
> 
>   
> 
> {code}
> in the 1.6 branch and runing 'mvn compile' yielded the following. 
> {noformat}
> [INFO] Scanning for projects...
> [INFO] 
> 
> [INFO] Reactor Build Order:
> [INFO] 
> [INFO] Apache Accumulo Project
> [INFO] Apache Accumulo Trace
> [INFO] Apache Accumulo Fate
> [INFO] Apache Accumulo Start
> [INFO] Apache Accumulo Core
> [INFO] Apache Accumulo Simple Examples
> [INFO] Apache Accumulo Server Base
> [INFO] Apache Accumulo GC Server
> [INFO] Apache Accumulo Master Server
> [INFO] Apache Accumulo Monitor Server
> [INFO] Apache Accumulo Tracer Server
> [INFO] Apache Accumulo Tablet Server
> [INFO] Apache Accumulo MiniCluster
> [INFO] Apache Accumulo Native Libraries
> [INFO] Apache Accumulo Testing
> [INFO] Apache Accumulo Proxy
> [INFO] Apache Accumulo
> [INFO] Apache Accumulo Documentation
> [INFO] Apache Accumulo Maven Plugin
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Project 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]  

[jira] [Commented] (ACCUMULO-4158) Investigate using Google's error-prone

2018-01-10 Thread Christopher Tubbs (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16319963#comment-16319963
 ] 

Christopher Tubbs commented on ACCUMULO-4158:
-

FWIW, Error Prone's own documentation mentions that it overlaps heavily with 
that found by Findbugs, which we already use.

Also, one thing to check for while investigating is that Error Prone has the 
ability to filter out false positives. That's invaluable with Findbugs today.

It may also be worth investigating Spotbugs, the replacement for Findbugs.

If we do end up using Error Prone, I think we should only use it as a 
CI/Developer tool. We should stick to a mainstream compiler like Oracle JDK or 
OpenJDK's javac when building release artifacts. Mainstream means more 
reproducibility and fewer surprises if there's any issues with the binaries as 
a result of the compiler we used.

> Investigate using Google's error-prone
> --
>
> Key: ACCUMULO-4158
> URL: https://issues.apache.org/jira/browse/ACCUMULO-4158
> Project: Accumulo
>  Issue Type: Improvement
>  Components: build
>Reporter: Michael Wall
>Assignee: Mark Owens
>Priority: Minor
>
> Google has a tool at http://errorprone.info.  From that page
> {quote}
> Using Error Prone to augment the compiler’s type analysis, you can catch more 
> mistakes before they cost you time, or end up as bugs in production.
> {quote}
> It requires java 1.8.  In the top level pom, replacing
> {code:xml}
> 
>   maven-compiler-plugin
>   
> ${java.ver}
> ${java.ver}
> true
> true
> true
>   
> 
> {code}
> with
> {code:xml}
> 
>   org.apache.maven.plugins
>   maven-compiler-plugin
>   3.3
>   
> javac-with-errorprone
> true
> 
> ${java.ver}
> ${java.ver}
> 
>   -Xep:ChainingConstructorIgnoresParameter:WARN
>   -Xep:LongLiteralLowerCaseSuffix:OFF
>   -Xep:SizeGreaterThanOrEqualsZero:WARN
>   -Xep:InvalidPatternSyntax:WARN
>   -Xep:TryFailThrowable:WARN
>   -Xep:NonOverridingEquals:OFF
> 
> true
>   
>   
> 
> 
>   com.google.errorprone
>   error_prone_core
>   2.0.8
> 
> 
>   org.codehaus.plexus
>   plexus-compiler-javac-errorprone
>   2.5
> 
>   
> 
> {code}
> in the 1.6 branch and runing 'mvn compile' yielded the following. 
> {noformat}
> [INFO] Scanning for projects...
> [INFO] 
> 
> [INFO] Reactor Build Order:
> [INFO] 
> [INFO] Apache Accumulo Project
> [INFO] Apache Accumulo Trace
> [INFO] Apache Accumulo Fate
> [INFO] Apache Accumulo Start
> [INFO] Apache Accumulo Core
> [INFO] Apache Accumulo Simple Examples
> [INFO] Apache Accumulo Server Base
> [INFO] Apache Accumulo GC Server
> [INFO] Apache Accumulo Master Server
> [INFO] Apache Accumulo Monitor Server
> [INFO] Apache Accumulo Tracer Server
> [INFO] Apache Accumulo Tablet Server
> [INFO] Apache Accumulo MiniCluster
> [INFO] Apache Accumulo Native Libraries
> [INFO] Apache Accumulo Testing
> [INFO] Apache Accumulo Proxy
> [INFO] Apache Accumulo
> [INFO] Apache Accumulo Documentation
> [INFO] Apache Accumulo Maven Plugin
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Project 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Trace 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Fate 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]
>  
> [INFO] 
> 
> [INFO] Building Apache Accumulo Start 1.6.6-SNAPSHOT
> [INFO] 
> 
> ...
> [INFO]