From 1dbb64580c32709af472c9115a9f12cf98eb3661 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 1 Feb 2010 14:52:43 +0000 Subject: [PATCH] throw NotSerializableException if no serialization id is available --- .../beans/factory/support/DefaultListableBeanFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 707a907d32b..1da35ce9568 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package org.springframework.beans.factory.support; +import java.io.NotSerializableException; import java.io.ObjectStreamException; import java.io.Serializable; import java.lang.annotation.Annotation; @@ -929,7 +930,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto return new SerializedBeanFactoryReference(this.serializationId); } else { - return this; + throw new NotSerializableException("DefaultListableBeanFactory has no serialization id"); } }