You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/06/06 05:39:37 UTC

[GitHub] [maven] 2997ms opened a new pull request #360: [MNG-6891] Delete the useless codes which won't be executed

2997ms opened a new pull request #360:
URL: https://github.com/apache/maven/pull/360


   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   This is a change followed up with this [pr](https://github.com/apache/maven/pull/337/files). I found since we have only accept WARN and ERROR level logging, and other level logging we will throw the exception. The int value of Error > WARN, then the next few lines codes won't be executed. So here this pr is to delete the codes.
   
    - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed 
          for the change (usually before you start working on it).  Trivial changes like typos do not 
          require a JIRA issue.  Your pull request should address just this issue, without 
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line and body.
    - [x] Format the pull request title like `[MNG-XXX] - Fixes bug in ApproximateQuantiles`,
          where you replace `MNG-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of the 
          commit message.
    - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will 
          be performed on your pull request automatically.
    - [x] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] 2997ms commented on a change in pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
2997ms commented on a change in pull request #360:
URL: https://github.com/apache/maven/pull/360#discussion_r434009485



##########
File path: maven-slf4j-wrapper/src/main/java/org/apache/maven/logwrapper/LogLevelRecorder.java
##########
@@ -42,14 +42,7 @@
 
     public LogLevelRecorder( String threshold )
     {
-        Level level = determineThresholdLevel( threshold );
-
-        if ( level.toInt() < Level.WARN.toInt() )
-        {
-            throw new IllegalArgumentException( "Logging severity thresholds can only be set to WARN or ERROR" );
-        }
-
-        logThreshold = level;
+        logThreshold = determineThresholdLevel( threshold );

Review comment:
       We only accept this two level logging https://github.com/apache/maven/pull/337/files#diff-1539b34a819f425067138253cfac27adR35
   And the logging level value is `   ERROR(40, "ERROR"),
       WARN(30, "WARN"),
       INFO(20, "INFO"),
       DEBUG(10, "DEBUG"),
       TRACE(0, "TRACE");`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] 2997ms commented on pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
2997ms commented on pull request #360:
URL: https://github.com/apache/maven/pull/360#issuecomment-639535150


   Nobody reviews...


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] MartinKanters commented on pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on pull request #360:
URL: https://github.com/apache/maven/pull/360#issuecomment-640080533


   I don't see any problems with this PR. It looks like dead code indeed, now that `LogLevelRecorder` has a static `ACCEPTED_LEVELS` Map. Nice find @2997ms .


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] rfscholte closed pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
rfscholte closed pull request #360:
URL: https://github.com/apache/maven/pull/360


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] rfscholte commented on pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #360:
URL: https://github.com/apache/maven/pull/360#issuecomment-640014966


   I'll ask @mthmulders @MartinKanters  to review as well.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #360:
URL: https://github.com/apache/maven/pull/360#issuecomment-639649334


   You need more patience.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] 2997ms closed pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
2997ms closed pull request #360:
URL: https://github.com/apache/maven/pull/360


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] rfscholte commented on pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #360:
URL: https://github.com/apache/maven/pull/360#issuecomment-647005172


   Fixed in https://github.com/apache/maven/commit/1e5bf55e12126f4dc224d471d2dc52f3ac182c24
   Thanks for the PR!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] 2997ms commented on a change in pull request #360: [MNG-6891] Delete the useless codes which won't be executed

Posted by GitBox <gi...@apache.org>.
2997ms commented on a change in pull request #360:
URL: https://github.com/apache/maven/pull/360#discussion_r434009485



##########
File path: maven-slf4j-wrapper/src/main/java/org/apache/maven/logwrapper/LogLevelRecorder.java
##########
@@ -42,14 +42,7 @@
 
     public LogLevelRecorder( String threshold )
     {
-        Level level = determineThresholdLevel( threshold );
-
-        if ( level.toInt() < Level.WARN.toInt() )
-        {
-            throw new IllegalArgumentException( "Logging severity thresholds can only be set to WARN or ERROR" );
-        }
-
-        logThreshold = level;
+        logThreshold = determineThresholdLevel( threshold );

Review comment:
       We only accept these two levels logging https://github.com/apache/maven/pull/337/files#diff-1539b34a819f425067138253cfac27adR35
   And the logging level value is `   ERROR(40, "ERROR"),
       WARN(30, "WARN"),
       INFO(20, "INFO"),
       DEBUG(10, "DEBUG"),
       TRACE(0, "TRACE");`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org