Skip to content
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

fix NPE during compare #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

valery-pavlov
Copy link

No description provided.

Copy link
Contributor

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Thank you for this report and fixes. Do you have time to take my suggestions into account?

I'm also curious to know in wich situation you encountered this NPE... Do you have any specific script? That would allow us to write integration tests, and identify why the original String was null.

Best regards,

Benoit

@@ -40,6 +40,8 @@ public AsciiCasemap() {
* @see org.apache.jsieve.comparators.Equals#equals(String, String)
*/
public boolean equals(String string1, String string2) {
if (string1 == null && string2 == null) return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have an indentation problem, this if is not at the same level than the other one.

We also tend to always use a block after a if.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be possible to you to propose tests for this changeset?

Maybe we can write a AsciiCasemapTest class, and test :

  • null, null
  • "a", null
  • null, "a"
  • "a", "b"
  • "a", "a"
  • "a", "A"

@chibenwa
Copy link
Contributor

chibenwa commented May 7, 2017

We might also need an issue on https://issues.apache.org/jira/browse/JSIEVE

@valery-pavlov
Copy link
Author

valery-pavlov commented May 10, 2017 via email

@valery-pavlov
Copy link
Author

valery-pavlov commented May 10, 2017 via email

@chibenwa
Copy link
Contributor

Ok, thanks for context.

Do you have time to add some tests and open the issue on our JIRA, or you prefer me doing it?

Cheers,

Benoit

@valery-pavlov
Copy link
Author

valery-pavlov commented May 11, 2017 via email

@valery-pavlov
Copy link
Author

valery-pavlov commented May 11, 2017 via email

@chibenwa
Copy link
Contributor

Thanks.

I'll try to have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants