fix BookStore

This commit is contained in:
SowinskiBraeden committed 2025-11-10 10:56:56 -08:00
1 parent f5483b20b5
commit 4a9c8f11ef
1 file changed
+8 -6
@@ -256,13 +256,13 @@ public class BookStore
}
}
if (longest != null)
if (longest == null)
{
System.out.println(longest.getTitle());
System.out.println("No longest title found");
}
else
{
System.out.println("No longest title found");
System.out.println(longest.getTitle());
}
}
@@ -353,12 +353,14 @@ public class BookStore
{
oldest = novel;
}
else
{
if (novel.getYearPublished() < oldest.getYearPublished())
else if (novel.getYearPublished() < oldest.getYearPublished())
{
oldest = novel;
}
else
{
// nothing to do
throw new IllegalArgumentException("CRASH");
}
}