You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/08/11 20:30:52 UTC

[GitHub] [netbeans] mbien commented on a diff in pull request #4454: Tomcat module cleanup

mbien commented on code in PR #4454:
URL: https://github.com/apache/netbeans/pull/4454#discussion_r943915247


##########
enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JaxWsStack.java:
##########
@@ -169,21 +169,17 @@ private String[] getDetectedMetroLibs() {
 
     
     private boolean isKeystore() {
-        if (new File(catalinaHome, KEYSTORE_LOCATION).exists()) return true;
-        else return false;
+        return new File(catalinaHome, KEYSTORE_LOCATION).exists();

Review Comment:
   this jackpot rule should cover this particular case:
   ```java
   new java.io.File($parent, $child$).exists() :: $parent instanceof String
   => java.nio.file.Files.exists(java.nio.file.Path.of($parent, $child$))   :: sourceVersionGE(11)
   => java.nio.file.Files.exists(java.nio.file.Paths.get($parent, $child$)) :: otherwise
   ;;
   
   new java.io.File($uri).exists() :: $uri instanceof java.net.URI
   => java.nio.file.Files.exists(java.nio.file.Path.of($uri))   :: sourceVersionGE(11)
   => java.nio.file.Files.exists(java.nio.file.Paths.get($uri)) :: otherwise
   ;;
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists