Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void testGetConfigurationProperties() {
}
)
@EnableAutoConfiguration
class Disalbed {
class Disabled {

@Autowired(required = false)
private ArtifactsEndpoint artifactsEndpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public static class Threads {
* Maximum capacity of the thread pool's backing queue. This setting only has
* an effect if the value is greater than 0.
*/
private int maxQueueCapacity = 2147483647;
private int maxQueueCapacity = Integer.MAX_VALUE;

public int getMax() {
return this.max;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public MultipartConfigElement createMultipartConfig() {
long maxRequestSizeBytes = convertToBytes(this.maxRequestSize, -1);
long fileSizeThresholdBytes = convertToBytes(this.fileSizeThreshold, 0);
return new MultipartConfigElement(this.location, maxFileSizeBytes, maxRequestSizeBytes,
(int) fileSizeThresholdBytes);
Math.toIntExact(fileSizeThresholdBytes));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@

static ExcludedAutoConfigurationClassPropertySource get(Environment environment) {
MutablePropertySources propertySources = getPropertySources(environment);
ExcludedAutoConfigurationClassPropertySource propertySource = (ExcludedAutoConfigurationClassPropertySource) propertySources.get(NAME);
PropertySource<?> source = propertySources.get(NAME);
ExcludedAutoConfigurationClassPropertySource propertySource =
source instanceof ExcludedAutoConfigurationClassPropertySource

Check warning on line 224 in microsphere-spring-boot-core/src/main/java/io/microsphere/spring/boot/autoconfigure/ConfigurableAutoConfigurationImportFilter.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this instanceof check and cast with 'instanceof ExcludedAutoConfigurationClassPropertySource excludedautoconfigurationclasspropertysource'

See more on https://sonarcloud.io/project/issues?id=microsphere-projects_microsphere-spring-boot&issues=AZ5ideNZpT_z9FcZuKgi&open=AZ5ideNZpT_z9FcZuKgi&pullRequest=117
? (ExcludedAutoConfigurationClassPropertySource) source : null;
if (propertySource == null) {
propertySource = new ExcludedAutoConfigurationClassPropertySource();
propertySources.addFirst(propertySource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,12 @@ private void initBinding(Class<?> beanClass, String prefix, Map<String, String>
* @return the converted value, or the original value if conversion is not supported
*/
Object convertForProperty(String propertyName, Object value) {
if (value == null) {
return null;
}
Class<?> propertyType = this.initializedBeanWrapper.getPropertyType(propertyName);
ConversionService conversionService = this.initializedBeanWrapper.getConversionService();
if (conversionService.canConvert(value.getClass(), propertyType)) {
if (conversionService != null && conversionService.canConvert(value.getClass(), propertyType)) {
return conversionService.convert(value, propertyType);
}
return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void initConfigurationPropertiesBeanContext(ConfigurationPropertyName name, Bind
if (isConfigurationPropertiesBean(context)) {
ConfigurationPropertiesBeanContext configurationPropertiesBeanContext = getConfigurationPropertiesBeanContext(name, target, context);
Supplier<?> value = target.getValue();
Object bean = value.get();
Object bean = value != null ? value.get() : null;
if (bean != null) {
if (logger.isTraceEnabled()) {
logger.trace("The ConfigurationPropertiesBean binding is finished , configuration property name : '{}' , type : '{}' , depth : {} , bean : '{}'", name, target.getType(), context.getDepth(), bean);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void test() {
@TestPropertySource(
properties = "microsphere.spring.beans.auto-registered=false"
)
@DisplayName("Disalbed AutoRegistrationBeanInitializer Test")
@DisplayName("Disabled AutoRegistrationBeanInitializer Test")
class DisabledTest {

@Autowired
Expand Down
Loading