From 152fba73e37e835e7497a3ea7d74ba5487ae9b8f Mon Sep 17 00:00:00 2001 From: Nikolay Pultsin Date: Mon, 19 Apr 2010 19:13:38 +0000 Subject: [PATCH] version number has been changed to 0.6.1 NPE in Author.hashCode has been fixed git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@1253 6a642e6f-84f6-412e-ac94-c4a38d5a04b0 --- AndroidManifest.xml | 2 +- VERSION | 2 +- src/org/geometerplus/fbreader/library/Author.java | 8 ++++++++ src/org/geometerplus/fbreader/library/Library.java | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e4467650e..176802526 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/VERSION b/VERSION index a918a2aa1..ee6cdce3c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 +0.6.1 diff --git a/src/org/geometerplus/fbreader/library/Author.java b/src/org/geometerplus/fbreader/library/Author.java index 985104724..3b9df3b4e 100644 --- a/src/org/geometerplus/fbreader/library/Author.java +++ b/src/org/geometerplus/fbreader/library/Author.java @@ -31,6 +31,14 @@ public final class Author { SortKey = sortKey; } + public static boolean areEquals(Author author0, Author author1) { + return author0 == null ? author1 == null : author0.equals(author1); + } + + public static int hashCode(Author author) { + return author == null ? 0 : author.hashCode(); + } + @Override public boolean equals(Object o) { if (o == this) { diff --git a/src/org/geometerplus/fbreader/library/Library.java b/src/org/geometerplus/fbreader/library/Library.java index ae87dd68f..6e166275a 100644 --- a/src/org/geometerplus/fbreader/library/Library.java +++ b/src/org/geometerplus/fbreader/library/Library.java @@ -165,11 +165,11 @@ public final class Library { return false; } AuthorSeriesPair pair = (AuthorSeriesPair)object; - return myAuthor.equals(pair.myAuthor) && mySeries.equals(pair.mySeries); + return Author.areEquals(myAuthor, pair.myAuthor) && mySeries.equals(pair.mySeries); } public int hashCode() { - return myAuthor.hashCode() + mySeries.hashCode(); + return Author.hashCode(myAuthor) + mySeries.hashCode(); } }