New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnnecessarySemicolonAfterTypeMemberDeclaration throws Exception on on Local Class #13411
Comments
Can i work on this? |
I have figured out where the null check can be done. Can i be assigned this? |
First, I tried to reproduce an issue by creating a Test.java which actually replicates the issue and a config file. And, I got a nullpointer exception as seen below.
After, i implemented the null-check, I get the following output without any nullpointer exception.
Is it good enough? And, can i proceed with a draft PR or a PR? |
Anyone is welcome to send a PR, please make a comment "I am on it" in this issue to let others know you are working on it. |
Thank you. I am on it. |
…cal Class (checkstyle#13411) This commit addresses issue checkstyle#13411, where the UnnecessarySemicolonAfterTypeMemberDeclarationCheck was throwing a NullPointerException when dealing with a local class inside a switch statement. A null check has been added to the isSemicolon method of the UnnecessarySemicolonAfterTypeMemberDeclarationCheck class to ensure that the method correctly handles null input and prevents the exception. Resolves: checkstyle#13411 - UnnecessarySemicolonAfterTypeMemberDeclaration throws Exception on Local Class.
…rDeclarationCheck for Local Class
@nrmancuso i have added PR. But, it is failing the CIs. Not sure why. I just made a simple change though. |
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck for Local Class
…rDeclarationCheck
…rDeclarationCheck
…rDeclarationCheck
…rDeclarationCheck
…rDeclarationCheck
…rDeclarationCheck
…rDeclarationCheck
…rDeclarationCheck
Closed via #13486 |
I have read check documentation: https://checkstyle.sourceforge.io/checks/coding/unnecessarysemicolonaftertypememberdeclaration.html#UnnecessarySemicolonAfterTypeMemberDeclaration
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words
Describe what you expect in detail.
I would expect this check not to throw a Null Pointer Exception on a local class declaration within a switch statement, even if this code is unusual.
The text was updated successfully, but these errors were encountered: