-
Notifications
You must be signed in to change notification settings - Fork 10
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
Null checks on fields #7
Conversation
@aarahmanqa can you resolve the merge conflicts for this pull request after that i'll test the code and merge accordingly. |
@shivam1608 , sorry for delay. I have resolved conflicts. Kindly review it. |
@aarahmanqa np for delays , currently i don't have my pc with me, i'm using my mobile. i'll soon check the commits when i reach home. |
@shivam1608 , could you please review the PR and get it merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Completed.
Thanks to @NotTheRambo
* Update README.md * Update README.md * Update README.md * Update README.md * ignore eclipse project file * bugfix in example(generating random domain) Domains.getRandomDomain() returns an Domain object. It does not override toString(), so "thisismychoice@"+Domains.getRandomDomain() will be like thisismychoice@me.shivzee.util.Domain@7fb4f2a9 This cause following Exception : javax.security.auth.login.LoginException: Something went wrong while creating account! Try Againjavax.security.auth.login.LoginException: Account Already Exists! Error 422 at me.shivzee.util.JMailBuilder.createAndLogin(JMailBuilder.java:94) To fix this, I called getDomainName() to get real domain name, and it worked fine. :) * add .gitignore for eclipse Sorry, since I'm in army, all I can use in here is just Eclipse Portable XD * FunctionalInterface annotation because a lambda can be WorkCallback * add Synchronous methods * name Threads * change version number * fixed pr3 Added Reusability of Code & Updated Java Docs * Updated Version * Update README.md * Added EventListener * Fix:Patch Request * Added Checks * Added: EventListener * Fix: Naming Convention * Removed Old Docs * Added EventListener * Update: Docs * Update: EventListener * Update: Java Docs * Update: Version * Add: JMailTM.jar * Update README.md * Added: onAccountUpdate Event * Update: Bind to Logger * Fixed: Documentation * Updated: Documentation * Updated: Version * Updated: Version * 1. Added status code 429 Exception 2. Added created/updated time in ZonedDateTime format * Updated as per comment * Updated: Version * Added: Examples Directory * Added: Login with Token * Updated: JavaDocs * Update README.md * Added if condition for hasAttachments (#6) * Added if condition for hasAttachments * As per review comments, modified the if block to minimal --------- Co-authored-by: aarahman <aarahman@tekion.com> * Null checks on fields (#7) * Added if condition for hasAttachments * Added safeEval() so that if any field is null calling toString will not cause issue * Changed the primitive data type to Wrapper type in POJO classes --------- Co-authored-by: aarahman <aarahman@tekion.com> * Update readme tags --------- Co-authored-by: awidesky <awidesky@naver.com> Co-authored-by: VigneshwaranT <vigneshwarant@tekion.com> Co-authored-by: Ahamed Abdul Rahman <ahamedabdulrahman@gmail.com> Co-authored-by: aarahman <aarahman@tekion.com>
Whenever we retrieve a value from the json field, we use .toString() which could throw NullPointerException. That field may be allowed to have null but since we have .toString() we would end up with NPE. This PR aims at avoiding such NPE. Its a better alternative to null check.
More info on this approach is here
Note : This PR contains the changes made in #6 too.