gradle-tomcat-plugin icon indicating copy to clipboard operation
gradle-tomcat-plugin copied to clipboard

Method always returns false - Refactor Bug

Open yurelle opened this issue 7 years ago • 3 comments

https://github.com/bmuschko/gradle-tomcat-plugin/blob/c103bf4706d58f6c144d1e123bf884ab0adc3a46/plugin/src/main/groovy/com/bmuschko/gradle/tomcat/tasks/TomcatRun.groovy#L116

This function always returns false. Several years ago, this code was refactored to add the if condition (in this commit; line: [old]-97 [new]-111). In the original code, the webXml.exists() was the last line of the function, and thus acted as a return value. However, once moved to inside an if-block, this auto return no longer works. Thus, this function always returns false. A manual return needs to be added to this line.

Fix: return webXml.exists()

yurelle avatar Feb 19 '18 18:02 yurelle

Looks like you are right. Would you be interested in providing a pull request?

bmuschko avatar Apr 14 '18 17:04 bmuschko

Thank you, but I don't have access to the code base right now. You can take the credit. :-)

-Yurelle

On Sat, Apr 14, 2018 at 1:35 PM, Benjamin Muschko [email protected] wrote:

Looks like you are right. Would you be interested in providing a pull request?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bmuschko/gradle-tomcat-plugin/issues/174#issuecomment-381346228, or mute the thread https://github.com/notifications/unsubscribe-auth/AWoRsdqtIlrbsVG3N61Fhh6sW1KyPIpsks5tojN7gaJpZM4SK9-1 .

yurelle avatar Apr 16 '18 20:04 yurelle

@yurelle Just as a heads up: I am asking because I won't have the time to look into it soon. If you have an urgent need for the bug to be fixed then you'll need to provide a pull request.

bmuschko avatar Apr 24 '18 14:04 bmuschko