Merge pull request #29753 from perlun
* pr/29753: Polish "Make sure NoUniqueBeanDefinitionException to be serializable" Make sure NoUniqueBeanDefinitionException to be serializable Closes gh-29753
This commit is contained in:
commit
1af259f928
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2023 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;
|
package org.springframework.beans.factory;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
|
@ -61,7 +62,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti
|
||||||
super(type, "expected single matching bean but found " + beanNamesFound.size() + ": " +
|
super(type, "expected single matching bean but found " + beanNamesFound.size() + ": " +
|
||||||
StringUtils.collectionToCommaDelimitedString(beanNamesFound));
|
StringUtils.collectionToCommaDelimitedString(beanNamesFound));
|
||||||
this.numberOfBeansFound = beanNamesFound.size();
|
this.numberOfBeansFound = beanNamesFound.size();
|
||||||
this.beanNamesFound = beanNamesFound;
|
this.beanNamesFound = new ArrayList<>(beanNamesFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -83,7 +84,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti
|
||||||
super(type, "expected single matching bean but found " + beanNamesFound.size() + ": " +
|
super(type, "expected single matching bean but found " + beanNamesFound.size() + ": " +
|
||||||
StringUtils.collectionToCommaDelimitedString(beanNamesFound));
|
StringUtils.collectionToCommaDelimitedString(beanNamesFound));
|
||||||
this.numberOfBeansFound = beanNamesFound.size();
|
this.numberOfBeansFound = beanNamesFound.size();
|
||||||
this.beanNamesFound = beanNamesFound;
|
this.beanNamesFound = new ArrayList<>(beanNamesFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue