[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-08-16 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16908985#comment-16908985
 ] 

Hadoop QA commented on OOZIE-3468:
--


Testing JIRA OOZIE-3468

Cleaning local git workspace



{color:green}+1 PATCH_APPLIES{color}
{color:green}+1 CLEAN{color}
{color:red}-1 RAW_PATCH_ANALYSIS{color}
.{color:green}+1{color} the patch does not introduce any @author tags
.{color:green}+1{color} the patch does not introduce any tabs
.{color:green}+1{color} the patch does not introduce any trailing spaces
.{color:green}+1{color} the patch does not introduce any star imports
.{color:green}+1{color} the patch does not introduce any line longer than 
132
.{color:red}-1{color} the patch does not add/modify any testcase
{color:green}+1 RAT{color}
.{color:green}+1{color} the patch does not seem to introduce new RAT 
warnings
{color:green}+1 JAVADOC{color}
.{color:green}+1{color} Javadoc generation succeeded with the patch
.{color:green}+1{color} the patch does not seem to introduce new Javadoc 
warning(s)
{color:green}+1 COMPILE{color}
.{color:green}+1{color} HEAD compiles
.{color:green}+1{color} patch compiles
.{color:green}+1{color} the patch does not seem to introduce new javac 
warnings
{color:green}+1{color} There are no new bugs found in total.
.{color:green}+1{color} There are no new bugs found in [core].
.{color:green}+1{color} There are no new bugs found in 
[fluent-job/fluent-job-api].
.{color:green}+1{color} There are no new bugs found in [tools].
.{color:green}+1{color} There are no new bugs found in [server].
.{color:green}+1{color} There are no new bugs found in [docs].
.{color:green}+1{color} There are no new bugs found in [webapp].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive].
.{color:green}+1{color} There are no new bugs found in [sharelib/distcp].
.{color:green}+1{color} There are no new bugs found in [sharelib/streaming].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive2].
.{color:green}+1{color} There are no new bugs found in [sharelib/spark].
.{color:green}+1{color} There are no new bugs found in [sharelib/git].
.{color:green}+1{color} There are no new bugs found in [sharelib/oozie].
.{color:green}+1{color} There are no new bugs found in [sharelib/sqoop].
.{color:green}+1{color} There are no new bugs found in [sharelib/pig].
.{color:green}+1{color} There are no new bugs found in [sharelib/hcatalog].
.{color:green}+1{color} There are no new bugs found in [client].
.{color:green}+1{color} There are no new bugs found in [examples].
{color:green}+1 BACKWARDS_COMPATIBILITY{color}
.{color:green}+1{color} the patch does not change any JPA 
Entity/Colum/Basic/Lob/Transient annotations
.{color:green}+1{color} the patch does not modify JPA files
{color:green}+1 TESTS{color}
.Tests run: 3175
{color:green}+1 DISTRO{color}
.{color:green}+1{color} distro tarball builds with the patch 


{color:red}*-1 Overall result, please check the reported -1(s)*{color}


The full output of the test-patch run is available at

. https://builds.apache.org/job/PreCommit-OOZIE-Build/1205/



> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch, OOZIE-3468-06.patch, 
> OOZIE-3468-07.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> 

[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-08-16 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16908880#comment-16908880
 ] 

Hadoop QA commented on OOZIE-3468:
--

PreCommit-OOZIE-Build started


> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch, OOZIE-3468-06.patch, 
> OOZIE-3468-07.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-08-07 Thread Julia Kinga Marton (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16902065#comment-16902065
 ] 

Julia Kinga Marton commented on OOZIE-3468:
---

[~asalamon74], I have some small comments related the actual patch:
 * in the modernizer script the PATCHFILE option is not used. can you please 
remove it?
 * _"REPORT+=("\{color:red}-1\{color} the patch introduces ${newErrorInClass} 
new warnings in ${class_name}")",_ please replace warning with warning(s).

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch, OOZIE-3468-06.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-08-05 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16899950#comment-16899950
 ] 

Hadoop QA commented on OOZIE-3468:
--


Testing JIRA OOZIE-3468

Cleaning local git workspace



{color:green}+1 PATCH_APPLIES{color}
{color:green}+1 CLEAN{color}
{color:red}-1 RAW_PATCH_ANALYSIS{color}
.{color:green}+1{color} the patch does not introduce any @author tags
.{color:green}+1{color} the patch does not introduce any tabs
.{color:green}+1{color} the patch does not introduce any trailing spaces
.{color:green}+1{color} the patch does not introduce any star imports
.{color:green}+1{color} the patch does not introduce any line longer than 
132
.{color:red}-1{color} the patch does not add/modify any testcase
{color:green}+1 RAT{color}
.{color:green}+1{color} the patch does not seem to introduce new RAT 
warnings
{color:green}+1 JAVADOC{color}
.{color:green}+1{color} Javadoc generation succeeded with the patch
.{color:green}+1{color} the patch does not seem to introduce new Javadoc 
warning(s)
{color:green}+1 COMPILE{color}
.{color:green}+1{color} HEAD compiles
.{color:green}+1{color} patch compiles
.{color:green}+1{color} the patch does not seem to introduce new javac 
warnings
{color:green}+1{color} There are no new bugs found in total.
.{color:green}+1{color} There are no new bugs found in [client].
.{color:green}+1{color} There are no new bugs found in [server].
.{color:green}+1{color} There are no new bugs found in 
[fluent-job/fluent-job-api].
.{color:green}+1{color} There are no new bugs found in [webapp].
.{color:green}+1{color} There are no new bugs found in [examples].
.{color:green}+1{color} There are no new bugs found in [core].
.{color:green}+1{color} There are no new bugs found in [docs].
.{color:green}+1{color} There are no new bugs found in [tools].
.{color:green}+1{color} There are no new bugs found in [sharelib/distcp].
.{color:green}+1{color} There are no new bugs found in [sharelib/oozie].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive].
.{color:green}+1{color} There are no new bugs found in [sharelib/spark].
.{color:green}+1{color} There are no new bugs found in [sharelib/pig].
.{color:green}+1{color} There are no new bugs found in [sharelib/hcatalog].
.{color:green}+1{color} There are no new bugs found in [sharelib/sqoop].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive2].
.{color:green}+1{color} There are no new bugs found in [sharelib/git].
.{color:green}+1{color} There are no new bugs found in [sharelib/streaming].
{color:green}+1 BACKWARDS_COMPATIBILITY{color}
.{color:green}+1{color} the patch does not change any JPA 
Entity/Colum/Basic/Lob/Transient annotations
.{color:green}+1{color} the patch does not modify JPA files
{color:green}+1 TESTS{color}
.Tests run: 3175
.{color:orange}Tests failed at first run:{color}
TestCoordActionsKillXCommand#testActionKillCommandActionNumbers
TestCoordActionsKillXCommand#testActionKillCommandDate
.For the complete list of flaky tests, see TEST-SUMMARY-FULL files.
{color:green}+1 DISTRO{color}
.{color:green}+1{color} distro tarball builds with the patch 


{color:red}*-1 Overall result, please check the reported -1(s)*{color}


The full output of the test-patch run is available at

. https://builds.apache.org/job/PreCommit-OOZIE-Build/1202/



> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch, OOZIE-3468-06.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> 

[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-08-05 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16899838#comment-16899838
 ] 

Hadoop QA commented on OOZIE-3468:
--

PreCommit-OOZIE-Build started


> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch, OOZIE-3468-06.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-08-05 Thread Andras Salamon (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16899828#comment-16899828
 ] 

Andras Salamon commented on OOZIE-3468:
---

I've tested the plugin using jenkins, here are a few sample outputs:

https://issues.apache.org/jira/browse/OOZIE-3496?focusedCommentId=16898239=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16898239

https://issues.apache.org/jira/browse/OOZIE-3496?focusedCommentId=16897986=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16897986

 

 

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch, OOZIE-3468-06.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-24 Thread Julia Kinga Marton (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16891862#comment-16891862
 ] 

Julia Kinga Marton commented on OOZIE-3468:
---

[~asalamon74] can you please check tour code with ShellCheck and fix the 
reported issues?

 

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-08 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16880347#comment-16880347
 ] 

Hadoop QA commented on OOZIE-3468:
--


Testing JIRA OOZIE-3468

Cleaning local git workspace



{color:green}+1 PATCH_APPLIES{color}
{color:green}+1 CLEAN{color}
{color:red}-1 RAW_PATCH_ANALYSIS{color}
.{color:green}+1{color} the patch does not introduce any @author tags
.{color:green}+1{color} the patch does not introduce any tabs
.{color:green}+1{color} the patch does not introduce any trailing spaces
.{color:green}+1{color} the patch does not introduce any star imports
.{color:green}+1{color} the patch does not introduce any line longer than 
132
.{color:red}-1{color} the patch does not add/modify any testcase
{color:green}+1 RAT{color}
.{color:green}+1{color} the patch does not seem to introduce new RAT 
warnings
{color:green}+1 JAVADOC{color}
.{color:green}+1{color} Javadoc generation succeeded with the patch
.{color:green}+1{color} the patch does not seem to introduce new Javadoc 
warning(s)
{color:green}+1 COMPILE{color}
.{color:green}+1{color} HEAD compiles
.{color:green}+1{color} patch compiles
.{color:green}+1{color} the patch does not seem to introduce new javac 
warnings
{color:green}+1{color} There are no new bugs found in total.
.{color:green}+1{color} There are no new bugs found in 
[fluent-job/fluent-job-api].
.{color:green}+1{color} There are no new bugs found in [docs].
.{color:green}+1{color} There are no new bugs found in [examples].
.{color:green}+1{color} There are no new bugs found in [webapp].
.{color:green}+1{color} There are no new bugs found in [tools].
.{color:green}+1{color} There are no new bugs found in [client].
.{color:green}+1{color} There are no new bugs found in [server].
.{color:green}+1{color} There are no new bugs found in [core].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive2].
.{color:green}+1{color} There are no new bugs found in [sharelib/streaming].
.{color:green}+1{color} There are no new bugs found in [sharelib/pig].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive].
.{color:green}+1{color} There are no new bugs found in [sharelib/oozie].
.{color:green}+1{color} There are no new bugs found in [sharelib/spark].
.{color:green}+1{color} There are no new bugs found in [sharelib/git].
.{color:green}+1{color} There are no new bugs found in [sharelib/hcatalog].
.{color:green}+1{color} There are no new bugs found in [sharelib/sqoop].
.{color:green}+1{color} There are no new bugs found in [sharelib/distcp].
{color:green}+1 BACKWARDS_COMPATIBILITY{color}
.{color:green}+1{color} the patch does not change any JPA 
Entity/Colum/Basic/Lob/Transient annotations
.{color:green}+1{color} the patch does not modify JPA files
{color:green}+1 TESTS{color}
.Tests run: 3163
{color:green}+1 DISTRO{color}
.{color:green}+1{color} distro tarball builds with the patch 


{color:red}*-1 Overall result, please check the reported -1(s)*{color}


The full output of the test-patch run is available at

. https://builds.apache.org/job/PreCommit-OOZIE-Build/1166/



> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> 

[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-08 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16880240#comment-16880240
 ] 

Hadoop QA commented on OOZIE-3468:
--

PreCommit-OOZIE-Build started


> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-08 Thread Andras Salamon (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16880235#comment-16880235
 ] 

Andras Salamon commented on OOZIE-3468:
---

I've cleanup up the code and fied the long lines.

[~kmarton] Is it possible to test this script in the precommit environment?

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch, OOZIE-3468-04.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-05 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16879270#comment-16879270
 ] 

Hadoop QA commented on OOZIE-3468:
--


Testing JIRA OOZIE-3468

Cleaning local git workspace



{color:green}+1 PATCH_APPLIES{color}
{color:green}+1 CLEAN{color}
{color:red}-1 RAW_PATCH_ANALYSIS{color}
.{color:green}+1{color} the patch does not introduce any @author tags
.{color:green}+1{color} the patch does not introduce any tabs
.{color:green}+1{color} the patch does not introduce any trailing spaces
.{color:green}+1{color} the patch does not introduce any star imports
.{color:red}-1{color} the patch contains 4 line(s) longer than 132 
characters
.{color:red}-1{color} the patch does not add/modify any testcase
{color:green}+1 RAT{color}
.{color:green}+1{color} the patch does not seem to introduce new RAT 
warnings
{color:green}+1 JAVADOC{color}
.{color:green}+1{color} Javadoc generation succeeded with the patch
.{color:green}+1{color} the patch does not seem to introduce new Javadoc 
warning(s)
{color:green}+1 COMPILE{color}
.{color:green}+1{color} HEAD compiles
.{color:green}+1{color} patch compiles
.{color:green}+1{color} the patch does not seem to introduce new javac 
warnings
{color:green}+1{color} There are no new bugs found in total.
.{color:green}+1{color} There are no new bugs found in 
[fluent-job/fluent-job-api].
.{color:green}+1{color} There are no new bugs found in [tools].
.{color:green}+1{color} There are no new bugs found in [sharelib/oozie].
.{color:green}+1{color} There are no new bugs found in [sharelib/streaming].
.{color:green}+1{color} There are no new bugs found in [sharelib/spark].
.{color:green}+1{color} There are no new bugs found in [sharelib/pig].
.{color:green}+1{color} There are no new bugs found in [sharelib/sqoop].
.{color:green}+1{color} There are no new bugs found in [sharelib/git].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive].
.{color:green}+1{color} There are no new bugs found in [sharelib/hcatalog].
.{color:green}+1{color} There are no new bugs found in [sharelib/distcp].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive2].
.{color:green}+1{color} There are no new bugs found in [server].
.{color:green}+1{color} There are no new bugs found in [examples].
.{color:green}+1{color} There are no new bugs found in [core].
.{color:green}+1{color} There are no new bugs found in [client].
.{color:green}+1{color} There are no new bugs found in [docs].
.{color:green}+1{color} There are no new bugs found in [webapp].
{color:green}+1 BACKWARDS_COMPATIBILITY{color}
.{color:green}+1{color} the patch does not change any JPA 
Entity/Colum/Basic/Lob/Transient annotations
.{color:green}+1{color} the patch does not modify JPA files
{color:green}+1 TESTS{color}
.Tests run: 3163
{color:green}+1 DISTRO{color}
.{color:green}+1{color} distro tarball builds with the patch 


{color:red}*-1 Overall result, please check the reported -1(s)*{color}


The full output of the test-patch run is available at

. https://builds.apache.org/job/PreCommit-OOZIE-Build/1163/



> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> 

[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-05 Thread Andras Salamon (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16879171#comment-16879171
 ] 

Andras Salamon commented on OOZIE-3468:
---

The new version of the patch adds class level info about the new warnings. A 
few examples:

Two new errors: 
{noformat}

+1 PATCH_APPLIES
-1 MODERNIZER
-1 the patch seems to introduce 2 new modernizer error(s)
-1 the patch introduces new warnings in 
/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java
-1 the patch introduces new warnings in 
/tools/src/main/java/org/apache/oozie/tools/OozieSharelibCLI$ConcurrentCopyFromLocal.java


-1 Overall result, please check the reported -1(s)
{noformat}
In more complex cases the output focuses on the new warnings:

Adding 1+1+3 bugs and fixing 3 the same time:
{noformat}


+1 PATCH_APPLIES
-1 MODERNIZER
-1 the patch seems to introduce 2 new modernizer error(s)
-1 the patch introduces 1 new warnings in 
/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java
-1 the patch introduces 3 new warnings in 
/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java
-1 the patch introduces 1 new warnings in 
/tools/src/main/java/org/apache/oozie/tools/OozieSharelibCLI$ConcurrentCopyFromLocal.java


-1 Overall result, please check the reported -1(s)
{noformat}
Adding 1+1+3 bugs and fixing 14 the same time:

{noformat}


+1 PATCH_APPLIES
 -1 MODERNIZER
 +1 the patch fixes 9 modernizer error(s)
 -1 the patch introduces 1 new warnings in 
/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java
 -1 the patch introduces 3 new warnings in 
/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java
 -1 the patch introduces 1 new warnings in 
/tools/src/main/java/org/apache/oozie/tools/OozieSharelibCLI$ConcurrentCopyFromLocal.java


 -1 Overall result, please check the reported -1(s)
{noformat}

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we 

[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-05 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16879169#comment-16879169
 ] 

Hadoop QA commented on OOZIE-3468:
--

PreCommit-OOZIE-Build started


> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch, 
> OOZIE-3468-03-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-03 Thread Julia Kinga Marton (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16878327#comment-16878327
 ] 

Julia Kinga Marton commented on OOZIE-3468:
---

+1 for adding the modrnizer to our precommit script. 

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-03 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16878042#comment-16878042
 ] 

Hadoop QA commented on OOZIE-3468:
--


Testing JIRA OOZIE-3468

Cleaning local git workspace



{color:green}+1 PATCH_APPLIES{color}
{color:green}+1 CLEAN{color}
{color:red}-1 RAW_PATCH_ANALYSIS{color}
.{color:green}+1{color} the patch does not introduce any @author tags
.{color:green}+1{color} the patch does not introduce any tabs
.{color:green}+1{color} the patch does not introduce any trailing spaces
.{color:green}+1{color} the patch does not introduce any star imports
.{color:red}-1{color} the patch contains 2 line(s) longer than 132 
characters
.{color:red}-1{color} the patch does not add/modify any testcase
{color:green}+1 RAT{color}
.{color:green}+1{color} the patch does not seem to introduce new RAT 
warnings
{color:green}+1 JAVADOC{color}
.{color:green}+1{color} Javadoc generation succeeded with the patch
.{color:green}+1{color} the patch does not seem to introduce new Javadoc 
warning(s)
{color:green}+1 COMPILE{color}
.{color:green}+1{color} HEAD compiles
.{color:green}+1{color} patch compiles
.{color:green}+1{color} the patch does not seem to introduce new javac 
warnings
{color:green}+1{color} There are no new bugs found in total.
.{color:green}+1{color} There are no new bugs found in 
[fluent-job/fluent-job-api].
.{color:green}+1{color} There are no new bugs found in [docs].
.{color:green}+1{color} There are no new bugs found in [examples].
.{color:green}+1{color} There are no new bugs found in [webapp].
.{color:green}+1{color} There are no new bugs found in [tools].
.{color:green}+1{color} There are no new bugs found in [client].
.{color:green}+1{color} There are no new bugs found in [server].
.{color:green}+1{color} There are no new bugs found in [core].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive2].
.{color:green}+1{color} There are no new bugs found in [sharelib/streaming].
.{color:green}+1{color} There are no new bugs found in [sharelib/pig].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive].
.{color:green}+1{color} There are no new bugs found in [sharelib/oozie].
.{color:green}+1{color} There are no new bugs found in [sharelib/spark].
.{color:green}+1{color} There are no new bugs found in [sharelib/git].
.{color:green}+1{color} There are no new bugs found in [sharelib/hcatalog].
.{color:green}+1{color} There are no new bugs found in [sharelib/sqoop].
.{color:green}+1{color} There are no new bugs found in [sharelib/distcp].
{color:green}+1 BACKWARDS_COMPATIBILITY{color}
.{color:green}+1{color} the patch does not change any JPA 
Entity/Colum/Basic/Lob/Transient annotations
.{color:green}+1{color} the patch does not modify JPA files
{color:green}+1 TESTS{color}
.Tests run: 3163
{color:green}+1 DISTRO{color}
.{color:green}+1{color} distro tarball builds with the patch 


{color:red}*-1 Overall result, please check the reported -1(s)*{color}


The full output of the test-patch run is available at

. https://builds.apache.org/job/PreCommit-OOZIE-Build/1161/



> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer 

[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-03 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16877949#comment-16877949
 ] 

Hadoop QA commented on OOZIE-3468:
--

PreCommit-OOZIE-Build started


> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-03 Thread Andras Salamon (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16877895#comment-16877895
 ] 

Andras Salamon commented on OOZIE-3468:
---

The second work-in-progress patch adds a new patch tester for modernizer. It 
only checks the number of errors and give results like this:
{noformat}


+1 PATCH_APPLIES
+1 MODERNIZER


+1 Overall result, good!, no -1s{noformat}

or

{noformat}
+1 PATCH_APPLIES
-1 MODERNIZER
-1 the patch seems to introduce 1 new modernizer error(s)


-1 Overall result, please check the reported -1(s)
{noformat}

In this current version it does not list the new errors. It might be useful to 
add this, but we need to avoid listing lot's of false positive warnings like in 
the spotbugs checking.


> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch, OOZIE-3468-02-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-07-01 Thread Andras Salamon (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16876151#comment-16876151
 ] 

Andras Salamon commented on OOZIE-3468:
---

Looking better:
{noformat}
$ mvn modernizer:modernizer | grep -i ERROR | sed -E 's/.*(Prefer .*)/\1/g' | 
sort | uniq -c | sort -nr
  56 Prefer java.lang.StringBuilder
  34 Prefer java.util.Collections.emptyList()
  26 Prefer java.util.Collections.emptyMap()
  26 Prefer java.lang.Long.valueOf(long)
  21 Prefer java.lang.Integer.valueOf(int)
  16 Prefer java.io.InputStreamReader(java.io.InputStream, 
java.nio.charset.Charset)
  11 Prefer java.lang.String.(byte[], java.nio.charset.Charset)
   6 Prefer java.lang.String.getBytes(java.nio.charset.Charset)
   5 Prefer javax.inject.Provider
   4 Prefer java.io.OutputStreamWriter(java.io.OutputStream, 
java.nio.charset.Charset)
   3 Prefer java.util.LinkedHashSet<>()
   2 Prefer java.util.LinkedHashMap<>()
   1 Prefer java.util.HashMap<>()
   1 Prefer java.util.Base64.Encoder.encodeToString(byte[])
   1 Prefer java.util.Base64.Decoder.decode(String)
   1 Prefer java.lang.Double.valueOf(double){noformat}

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-05-20 Thread Andras Salamon (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16844000#comment-16844000
 ] 

Andras Salamon commented on OOZIE-3468:
---

Thanks to OOZIE-3464 and OOZIE-3488 situation looks a bit better:
{noformat}
$ mvn modernizer:modernizer | grep -i ERROR | sed -E 's/.*(Prefer .*)/\1/g' | 
sort | uniq -c | sort -nr
  56 Prefer java.lang.StringBuilder
  51 Prefer java.util.Objects.requireNonNull(Object, String) or 
java.util.Objects.requireNonNull(Object, Supplier)
  34 Prefer java.util.Collections.emptyList()
  26 Prefer java.util.Collections.emptyMap()
  26 Prefer java.lang.Long.valueOf(long)
  21 Prefer java.lang.Integer.valueOf(int)
  18 Prefer java.util.Objects.requireNonNull(Object)
  16 Prefer java.io.InputStreamReader(java.io.InputStream, 
java.nio.charset.Charset)
  11 Prefer java.lang.String.(byte[], java.nio.charset.Charset)
   6 Prefer java.lang.String.getBytes(java.nio.charset.Charset)
   5 Prefer javax.inject.Provider
   4 Prefer java.io.OutputStreamWriter(java.io.OutputStream, 
java.nio.charset.Charset)
   3 Prefer java.util.LinkedHashSet<>()
   2 Prefer java.util.LinkedHashMap<>()
   1 Prefer java.util.HashMap<>()
   1 Prefer java.util.Base64.Encoder.encodeToString(byte[])
   1 Prefer java.util.Base64.Decoder.decode(String)
   1 Prefer java.lang.Double.valueOf(double)
{noformat}

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-05-16 Thread Andras Salamon (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16841181#comment-16841181
 ] 

Andras Salamon commented on OOZIE-3468:
---

Just to show the current status of the project:

 
{noformat}
$ mvn modernizer:modernizer | grep -i ERROR | sed -E 's/.*(Prefer .*)/\1/g' | 
sort | uniq -c | sort -nr

  56 Prefer java.lang.StringBuilder
  52 Prefer java.util.Objects.requireNonNull(Object, String) or 
java.util.Objects.requireNonNull(Object, Supplier)
  34 Prefer java.util.Collections.emptyList()
  26 Prefer java.util.Collections.emptyMap()
  26 Prefer java.lang.Long.valueOf(long)
  21 Prefer java.lang.Integer.valueOf(int)
  18 Prefer java.util.Objects.requireNonNull(Object)
  11 Prefer java.lang.String.(byte[], java.nio.charset.Charset)
   6 Prefer java.lang.String.getBytes(java.nio.charset.Charset)
   6 Prefer java.io.InputStreamReader(java.io.InputStream, 
java.nio.charset.Charset)
   5 Prefer javax.inject.Provider
   5 Prefer java.util.ArrayList<>()
   4 Prefer java.io.OutputStreamWriter(java.io.OutputStream, 
java.nio.charset.Charset)
   3 Prefer java.util.LinkedHashSet<>()
   2 Prefer java.util.LinkedHashMap<>()
   1 Prefer java.util.HashMap<>()
   1 Prefer java.util.Base64.Encoder.encodeToString(byte[])
   1 Prefer java.util.Base64.Decoder.decode(String)
   1 Prefer java.lang.Double.valueOf(double){noformat}

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-04-09 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16813302#comment-16813302
 ] 

Hadoop QA commented on OOZIE-3468:
--


Testing JIRA OOZIE-3468

Cleaning local git workspace



{color:green}+1 PATCH_APPLIES{color}
{color:green}+1 CLEAN{color}
{color:red}-1 RAW_PATCH_ANALYSIS{color}
.{color:green}+1{color} the patch does not introduce any @author tags
.{color:green}+1{color} the patch does not introduce any tabs
.{color:green}+1{color} the patch does not introduce any trailing spaces
.{color:green}+1{color} the patch does not introduce any star imports
.{color:green}+1{color} the patch does not introduce any line longer than 
132
.{color:red}-1{color} the patch does not add/modify any testcase
{color:green}+1 RAT{color}
.{color:green}+1{color} the patch does not seem to introduce new RAT 
warnings
{color:green}+1 JAVADOC{color}
.{color:green}+1{color} Javadoc generation succeeded with the patch
.{color:green}+1{color} the patch does not seem to introduce new Javadoc 
warning(s)
{color:green}+1 COMPILE{color}
.{color:green}+1{color} HEAD compiles
.{color:green}+1{color} patch compiles
.{color:green}+1{color} the patch does not seem to introduce new javac 
warnings
{color:orange}0{color} There are [4] new bugs found in total that would be nice 
to have fixed.
.{color:green}+1{color} There are no new bugs found in 
[fluent-job/fluent-job-api].
.{color:green}+1{color} There are no new bugs found in [docs].
.{color:green}+1{color} There are no new bugs found in [core].
.{color:orange}0{color} There are [4] new bugs found in [server] that would 
be nice to have fixed.
.You can find the SpotBugs diff here: server/findbugs-new.html
.{color:green}+1{color} There are no new bugs found in [sharelib/distcp].
.{color:green}+1{color} There are no new bugs found in [sharelib/oozie].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive].
.{color:green}+1{color} There are no new bugs found in [sharelib/hive2].
.{color:green}+1{color} There are no new bugs found in [sharelib/git].
.{color:green}+1{color} There are no new bugs found in [sharelib/spark].
.{color:green}+1{color} There are no new bugs found in [sharelib/sqoop].
.{color:green}+1{color} There are no new bugs found in [sharelib/pig].
.{color:green}+1{color} There are no new bugs found in [sharelib/streaming].
.{color:green}+1{color} There are no new bugs found in [sharelib/hcatalog].
.{color:green}+1{color} There are no new bugs found in [examples].
.{color:green}+1{color} There are no new bugs found in [tools].
.{color:green}+1{color} There are no new bugs found in [client].
.{color:green}+1{color} There are no new bugs found in [webapp].
{color:green}+1 BACKWARDS_COMPATIBILITY{color}
.{color:green}+1{color} the patch does not change any JPA 
Entity/Colum/Basic/Lob/Transient annotations
.{color:green}+1{color} the patch does not modify JPA files
{color:green}+1 TESTS{color}
.Tests run: 3169
.{color:orange}Tests failed at first run:{color}
TestWorkflowRetries>TestWorkflow#testWorkflowWithStartAndEndCompletesSuccessfully
.For the complete list of flaky tests, see TEST-SUMMARY-FULL files.
{color:green}+1 DISTRO{color}
.{color:green}+1{color} distro tarball builds with the patch 


{color:red}*-1 Overall result, please check the reported -1(s)*{color}


The full output of the test-patch run is available at

. https://builds.apache.org/job/PreCommit-OOZIE-Build/1083/



> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> 

[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-04-09 Thread Julia Kinga Marton (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16813241#comment-16813241
 ] 

Julia Kinga Marton commented on OOZIE-3468:
---

I would vote for including it to the pre-commit build and check only the new 
code, similar to the SpotBugs plugin

> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OOZIE-3468) Use modernizer plugin

2019-04-09 Thread Hadoop QA (JIRA)


[ 
https://issues.apache.org/jira/browse/OOZIE-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16813210#comment-16813210
 ] 

Hadoop QA commented on OOZIE-3468:
--

PreCommit-OOZIE-Build started


> Use modernizer plugin
> -
>
> Key: OOZIE-3468
> URL: https://issues.apache.org/jira/browse/OOZIE-3468
> Project: Oozie
>  Issue Type: Improvement
>  Components: build
>Affects Versions: trunk
>Reporter: Andras Salamon
>Assignee: Andras Salamon
>Priority: Major
> Attachments: OOZIE-3468-01-wip.patch
>
>
> Recently I've opened a few jiras which suggested to use standard java classes 
> instead of external libraries ( OOZIE-3463, OOZIE-3467). There is a tool 
> which can find such technical depts: [maven modernizer 
> plugin|https://github.com/gaul/modernizer-maven-plugin].
> The usage is quite simple:
> {noformat}
> $ mvn modernizer:modernizer
> ...
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:88: 
> Prefer java.lang.String.(byte[], java.nio.charset.Charset)  
>  
> [ERROR] /src/oozie/core/src/main/java/org/apache/oozie/StringBlob.java:122: 
> Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:85:
>  Prefer java.nio.charset.StandardCharsets  
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java:92:
>  Prefer java.nio.charset.StandardCharsets 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java:188:
>  Prefer java.util.ArrayList<>() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:91: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:101: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:110: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/JVMInfo.java:119: 
> Prefer java.lang.StringBuilder   
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/VersionServlet.java:36:
>  Prefer java.util.Collections.emptyList() 
> [ERROR] 
> /src/oozie/core/src/main/java/org/apache/oozie/servlet/V1AdminServlet.java:49:
>  Prefer java.util.Collections.emptyList() 
> ...
> {noformat}
> There are several ways to use this plugin:
>  # Add the plugin to the root pom and let developers manually use this 
> plugin. It's the simplest solution, but it will be easy to forget it.
>  # Add this to the precommit script similarly to findbugs and at least avoid 
> to insert new code which uses old style API. Probably we will have the same 
> problems like we have with findbugs, we will have lots of false positive 
> warnings.
>  # Turn the plugin on by default and fail the compilation if it finds any 
> problem. I think this is too strict.
> If we choose option 2 or 3 we should probably specify an ignore list, I don't 
> think for instance that we really want to change all the {{new Long(10)}} 
> code to {{Long.valueOf(10)}}.
> By default this plugin checks the target java version (1.8 right now) but 
> it's possible to specify 1.7 instead if we want to focus on those problems 
> first. (It was not working for me without specifying the java version.)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)