diff --git a/core-java-modules/core-java-serialization/src/main/java/com/baeldung/util/MySerializationUtils.java b/core-java-modules/core-java-serialization/src/main/java/com/baeldung/util/MySerializationUtils.java index d8a3b99481..568a503476 100644 --- a/core-java-modules/core-java-serialization/src/main/java/com/baeldung/util/MySerializationUtils.java +++ b/core-java-modules/core-java-serialization/src/main/java/com/baeldung/util/MySerializationUtils.java @@ -37,8 +37,10 @@ public class MySerializationUtils { continue; } Class fieldType = field.getType(); - serializable = isSerializable(fieldType); + if (!isSerializable(fieldType)) { + return false; + } } - return serializable; + return true; } }