Skip to content

Commit 0efc4a6

Browse files
committed
Polishing
1 parent e785eba commit 0efc4a6

File tree

13 files changed

+47
-167
lines changed

13 files changed

+47
-167
lines changed

src/main/scala/org/springframework/scala/beans/factory/RichBeanFactory.scala

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/main/scala/org/springframework/scala/beans/factory/RichListableBeanFactory.scala

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/main/scala/org/springframework/scala/beans/factory/config/MapFactoryBean.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
package org.springframework.scala.beans.factory.config
1818

1919
import org.springframework.beans.factory.config.AbstractFactoryBean
20-
import scala.collection.mutable.Builder
21-
import scala.collection.Map
20+
import scala.collection.{mutable, Map}
2221

2322
/**
2423
* Simple factory for shared [[scala.collection.Map]] instances. Allows for central setup
@@ -30,7 +29,7 @@ import scala.collection.Map
3029
* @param builderFunction function used to create a new map builder
3130
*/
3231
class MapFactoryBean[T, U](val sourceMap: Map[T, U],
33-
val builderFunction: () => Builder[(T, U), Map[T, U]])
32+
val builderFunction: () => mutable.Builder[(T, U), Map[T, U]])
3433
extends AbstractFactoryBean[scala.collection.Map[T, U]] {
3534

3635
def this(sourceMap: Map[T, U]) {

src/main/scala/org/springframework/scala/beans/factory/config/SeqFactoryBean.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package org.springframework.scala.beans.factory.config
22

33
import org.springframework.beans.factory.config.AbstractFactoryBean
4-
import scala.collection.mutable.Builder
5-
import scala.collection.Seq
4+
import scala.collection.{mutable, Seq}
65

76
/**
87
* Simple factory for shared [[scala.collection.Seq]] instances. Allows for central setup
@@ -14,7 +13,7 @@ import scala.collection.Seq
1413
* @param builderFunction function used to create a new sequence builder
1514
*/
1615
class SeqFactoryBean[T](val sourceSeq: Seq[T],
17-
val builderFunction: () => Builder[T, Seq[T]])
16+
val builderFunction: () => mutable.Builder[T, Seq[T]])
1817
extends AbstractFactoryBean[Seq[T]] {
1918

2019
def this(sourceSeq: Seq[T]) {

src/main/scala/org/springframework/scala/beans/factory/config/SetFactoryBean.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.springframework.scala.beans.factory.config
22

33
import org.springframework.beans.factory.config.AbstractFactoryBean
4-
import collection.mutable.Builder
4+
import scala.collection.mutable
55

66
/**
77
* Simple factory for shared [[scala.collection.Set]] instances. Allows for central setup
@@ -13,7 +13,7 @@ import collection.mutable.Builder
1313
* @param builderFunction function used to create a new set builder
1414
*/
1515
class SetFactoryBean[T](val sourceSet: scala.collection.Set[T],
16-
val builderFunction: () => Builder[T, Set[T]])
16+
val builderFunction: () => mutable.Builder[T, Set[T]])
1717
extends AbstractFactoryBean[scala.collection.Set[T]] {
1818

1919
def this(sourceSet: scala.collection.Set[T]) {

src/main/scala/org/springframework/scala/beans/factory/function/FunctionalGenericBeanDefinition.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ package org.springframework.scala.beans.factory.function
1919
import org.springframework.beans.factory.support.GenericBeanDefinition
2020

2121
/**
22+
* Default implementation of
23+
* [[org.springframework.scala.beans.factory.function.FunctionalBeanDefinition]].
24+
*
2225
* @author Arjen Poutsma
2326
*/
24-
class FunctionalGenericBeanDefinition[T](val beanFunction: () => T)
27+
class FunctionalGenericBeanDefinition[T](beanFunction: () => T)
2528
extends GenericBeanDefinition with FunctionalBeanDefinition[T] {
2629

2730
setBeanClass(classOf[Function0Wrapper])

src/main/scala/org/springframework/scala/beans/factory/function/InitDestroyFunctionBeanPostProcessor.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import scala.collection.mutable.{Set, MultiMap, SynchronizedMap, HashMap}
2828
* alternative to Spring's [[org.springframework.beans.factory.InitializingBean]]
2929
* and [[org.springframework.beans.factory.DisposableBean]] callback interfaces.
3030
*
31-
* Initialization functions are defined as `(T) => T`, i.e. a function that takes the bean
32-
* as parameter, and returns either the original bean or a wrapped one.
31+
* Initialization functions are defined as `(T) => Unit`, i.e. a function that takes the
32+
* bean as parameter, but does not return anything.
3333
*
3434
* Destruction functions are defined as `(T) => Unit`, i.e. a function that takes the bean
3535
* as parameter, but does not return anything.
@@ -61,8 +61,8 @@ class InitDestroyFunctionBeanPostProcessor
6161
* @tparam T the bean type
6262
*/
6363
def registerInitFunction[T](beanName: String, initFunction: (T) => Unit) {
64-
Assert.hasLength(beanName, "'beanName' must not be empty");
65-
Assert.notNull(initFunction, "'initFunction' must not be null");
64+
Assert.hasLength(beanName, "'beanName' must not be empty")
65+
Assert.notNull(initFunction, "'initFunction' must not be null")
6666

6767
initFunctions.addBinding(beanName, initFunction.asInstanceOf[Function1[Any, Unit]])
6868
}
@@ -78,8 +78,8 @@ class InitDestroyFunctionBeanPostProcessor
7878
* @tparam T the bean type
7979
*/
8080
def registerDestroyFunction[T](beanName: String, destroyFunction: (T) => Unit) {
81-
Assert.hasLength(beanName, "'beanName' must not be empty");
82-
Assert.notNull(destroyFunction, "'destroyFunction' must not be null");
81+
Assert.hasLength(beanName, "'beanName' must not be empty")
82+
Assert.notNull(destroyFunction, "'destroyFunction' must not be null")
8383

8484
destroyFunctions
8585
.addBinding(beanName, destroyFunction.asInstanceOf[Function1[Any, Unit]])

src/main/scala/org/springframework/scala/beans/factory/xml/UtilNamespaceHandler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder
77
import org.springframework.scala.beans.factory.config.{MapFactoryBean, SetFactoryBean, SeqFactoryBean}
88

99
/**
10+
* Namespace handler for the `scala-util` namespace.
11+
*
1012
* @author Arjen Poutsma
1113
*/
1214
class UtilNamespaceHandler extends NamespaceHandlerSupport {

src/main/scala/org/springframework/scala/beans/propertyeditors/ScalaCollectionEditor.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package org.springframework.scala.beans.propertyeditors
1818

1919
import java.beans.PropertyEditorSupport
2020
import scala.collection.JavaConversions._
21-
import scala.collection.mutable.Builder
21+
import scala.collection.mutable
2222

2323
/**
2424
* Property editor for Scala collections, converting any source collection to a given
@@ -30,7 +30,7 @@ import scala.collection.mutable.Builder
3030
* @param nullAsEmptyCollection whether to convert an incoming `null` value to an empty
3131
* collection (of the appropriate type). Defaults to `false`.
3232
*/
33-
class ScalaCollectionEditor[T, U](val builderFunction: () => Builder[T, _],
33+
class ScalaCollectionEditor[T, U](val builderFunction: () => mutable.Builder[T, _],
3434
val nullAsEmptyCollection: Boolean = false)
3535
extends PropertyEditorSupport {
3636

@@ -52,10 +52,10 @@ class ScalaCollectionEditor[T, U](val builderFunction: () => Builder[T, _],
5252
builder ++= source
5353
}
5454
case javaCollection: java.util.Collection[T] => {
55-
builder ++= collectionAsScalaIterable(javaCollection);
55+
builder ++= collectionAsScalaIterable(javaCollection)
5656
}
5757
case javaMap: java.util.Map[T, U] => {
58-
val mapBuilder = builder.asInstanceOf[Builder[(T, U), _]]
58+
val mapBuilder = builder.asInstanceOf[mutable.Builder[(T, U), _]]
5959
mapBuilder ++= mapAsScalaMap(javaMap)
6060
}
6161
case el: T => {

src/main/scala/org/springframework/scala/beans/propertyeditors/ScalaEditorRegistrar.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package org.springframework.scala.beans.propertyeditors
2-
31
/*
42
* Copyright 2011-2012 the original author or authors.
53
*
@@ -16,6 +14,8 @@ package org.springframework.scala.beans.propertyeditors
1614
* limitations under the License.
1715
*/
1816

17+
package org.springframework.scala.beans.propertyeditors
18+
1919
import scala.util.matching.Regex
2020

2121
import org.springframework.beans.{PropertyEditorRegistry, PropertyEditorRegistrar}

0 commit comments

Comments
 (0)