throw NotSerializableException if no serialization id is available

This commit is contained in:
Juergen Hoeller 2010-02-01 14:52:43 +00:00
parent 5f5e7c3262
commit 1dbb64580c
1 changed files with 3 additions and 2 deletions

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,6 +16,7 @@
package org.springframework.beans.factory.support; package org.springframework.beans.factory.support;
import java.io.NotSerializableException;
import java.io.ObjectStreamException; import java.io.ObjectStreamException;
import java.io.Serializable; import java.io.Serializable;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
@ -929,7 +930,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
return new SerializedBeanFactoryReference(this.serializationId); return new SerializedBeanFactoryReference(this.serializationId);
} }
else { else {
return this; throw new NotSerializableException("DefaultListableBeanFactory has no serialization id");
} }
} }