1. Removed unnecessary null checks
2. Combined collection initialization and modification
3. Minor collections related optimizations

Closes gh-15837
This commit is contained in:
Kedar Joshi
2019-02-03 22:47:44 +05:30
committed by Stephane Nicoll
parent 6e5ffd8587
commit 4a253ff87c
12 changed files with 27 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 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.
@@ -155,8 +155,7 @@ public class EntityScanPackages {
String[] basePackages = attributes.getStringArray("basePackages");
Class<?>[] basePackageClasses = attributes
.getClassArray("basePackageClasses");
Set<String> packagesToScan = new LinkedHashSet<>();
packagesToScan.addAll(Arrays.asList(basePackages));
Set<String> packagesToScan = new LinkedHashSet<>(Arrays.asList(basePackages));
for (Class<?> basePackageClass : basePackageClasses) {
packagesToScan.add(ClassUtils.getPackageName(basePackageClass));
}