Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c19057e1
Commit
c19057e1
authored
Aug 04, 2019
by
Bo Zhang
Committed by
Madhura Bhave
Aug 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify conditional statements
See gh-17779
parent
4002a66c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
33 deletions
+16
-33
BeanDefinitionLoader.java
...n/java/org/springframework/boot/BeanDefinitionLoader.java
+2
-5
ApplicationPidFileWriter.java
...pringframework/boot/context/ApplicationPidFileWriter.java
+1
-1
NoUnboundElementsBindHandler.java
...properties/bind/handler/NoUnboundElementsBindHandler.java
+1
-3
CollectionToDelimitedStringConverter.java
...rk/boot/convert/CollectionToDelimitedStringConverter.java
+2
-5
AbstractDataSourceInitializer.java
...ingframework/boot/jdbc/AbstractDataSourceInitializer.java
+2
-5
DeferredLog.java
...in/java/org/springframework/boot/logging/DeferredLog.java
+6
-6
UndertowServletWebServer.java
.../boot/web/embedded/undertow/UndertowServletWebServer.java
+1
-4
UndertowWebServer.java
...amework/boot/web/embedded/undertow/UndertowWebServer.java
+1
-4
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java
View file @
c19057e1
...
@@ -281,11 +281,8 @@ class BeanDefinitionLoader {
...
@@ -281,11 +281,8 @@ class BeanDefinitionLoader {
}
}
// Nested anonymous classes are not eligible for registration, nor are groovy
// Nested anonymous classes are not eligible for registration, nor are groovy
// closures
// closures
if
(
type
.
getName
().
matches
(
".*\\$_.*closure.*"
)
||
type
.
isAnonymousClass
()
||
type
.
getConstructors
()
==
null
return
!
type
.
getName
().
matches
(
".*\\$_.*closure.*"
)
&&
!
type
.
isAnonymousClass
()
||
type
.
getConstructors
().
length
==
0
)
{
&&
type
.
getConstructors
()
!=
null
&&
type
.
getConstructors
().
length
!=
0
;
return
false
;
}
return
true
;
}
}
/**
/**
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java
View file @
c19057e1
...
@@ -160,7 +160,7 @@ public class ApplicationPidFileWriter implements ApplicationListener<SpringAppli
...
@@ -160,7 +160,7 @@ public class ApplicationPidFileWriter implements ApplicationListener<SpringAppli
private
boolean
failOnWriteError
(
SpringApplicationEvent
event
)
{
private
boolean
failOnWriteError
(
SpringApplicationEvent
event
)
{
String
value
=
getProperty
(
event
,
FAIL_ON_WRITE_ERROR_PROPERTIES
);
String
value
=
getProperty
(
event
,
FAIL_ON_WRITE_ERROR_PROPERTIES
);
return
(
value
!=
null
)
?
Boolean
.
parseBoolean
(
value
)
:
false
;
return
Boolean
.
parseBoolean
(
value
)
;
}
}
private
String
getProperty
(
SpringApplicationEvent
event
,
List
<
Property
>
candidates
)
{
private
String
getProperty
(
SpringApplicationEvent
event
,
List
<
Property
>
candidates
)
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandler.java
View file @
c19057e1
...
@@ -99,9 +99,7 @@ public class NoUnboundElementsBindHandler extends AbstractBindHandler {
...
@@ -99,9 +99,7 @@ public class NoUnboundElementsBindHandler extends AbstractBindHandler {
private
boolean
isUnbound
(
ConfigurationPropertyName
name
,
ConfigurationPropertyName
candidate
)
{
private
boolean
isUnbound
(
ConfigurationPropertyName
name
,
ConfigurationPropertyName
candidate
)
{
if
(
name
.
isAncestorOf
(
candidate
))
{
if
(
name
.
isAncestorOf
(
candidate
))
{
if
(!
this
.
boundNames
.
contains
(
candidate
)
&&
!
isOverriddenCollectionElement
(
candidate
))
{
return
!
this
.
boundNames
.
contains
(
candidate
)
&&
!
isOverriddenCollectionElement
(
candidate
);
return
true
;
}
}
}
return
false
;
return
false
;
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/CollectionToDelimitedStringConverter.java
View file @
c19057e1
...
@@ -49,11 +49,8 @@ final class CollectionToDelimitedStringConverter implements ConditionalGenericCo
...
@@ -49,11 +49,8 @@ final class CollectionToDelimitedStringConverter implements ConditionalGenericCo
if
(
targetType
==
null
||
sourceElementType
==
null
)
{
if
(
targetType
==
null
||
sourceElementType
==
null
)
{
return
true
;
return
true
;
}
}
if
(
this
.
conversionService
.
canConvert
(
sourceElementType
,
targetType
)
return
this
.
conversionService
.
canConvert
(
sourceElementType
,
targetType
)
||
sourceElementType
.
getType
().
isAssignableFrom
(
targetType
.
getType
()))
{
||
sourceElementType
.
getType
().
isAssignableFrom
(
targetType
.
getType
());
return
true
;
}
return
false
;
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/AbstractDataSourceInitializer.java
View file @
c19057e1
...
@@ -69,11 +69,8 @@ public abstract class AbstractDataSourceInitializer {
...
@@ -69,11 +69,8 @@ public abstract class AbstractDataSourceInitializer {
if
(
getMode
()
==
DataSourceInitializationMode
.
NEVER
)
{
if
(
getMode
()
==
DataSourceInitializationMode
.
NEVER
)
{
return
false
;
return
false
;
}
}
if
(
getMode
()
==
DataSourceInitializationMode
.
EMBEDDED
return
getMode
()
!=
DataSourceInitializationMode
.
EMBEDDED
&&
!
EmbeddedDatabaseConnection
.
isEmbedded
(
this
.
dataSource
))
{
||
EmbeddedDatabaseConnection
.
isEmbedded
(
this
.
dataSource
);
return
false
;
}
return
true
;
}
}
/**
/**
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java
View file @
c19057e1
...
@@ -38,42 +38,42 @@ public class DeferredLog implements Log {
...
@@ -38,42 +38,42 @@ public class DeferredLog implements Log {
@Override
@Override
public
boolean
isTraceEnabled
()
{
public
boolean
isTraceEnabled
()
{
synchronized
(
this
.
lines
)
{
synchronized
(
this
.
lines
)
{
return
(
this
.
destination
!=
null
)
?
this
.
destination
.
isTraceEnabled
()
:
true
;
return
(
this
.
destination
==
null
)
||
this
.
destination
.
isTraceEnabled
()
;
}
}
}
}
@Override
@Override
public
boolean
isDebugEnabled
()
{
public
boolean
isDebugEnabled
()
{
synchronized
(
this
.
lines
)
{
synchronized
(
this
.
lines
)
{
return
(
this
.
destination
!=
null
)
?
this
.
destination
.
isDebugEnabled
()
:
true
;
return
(
this
.
destination
==
null
)
||
this
.
destination
.
isDebugEnabled
()
;
}
}
}
}
@Override
@Override
public
boolean
isInfoEnabled
()
{
public
boolean
isInfoEnabled
()
{
synchronized
(
this
.
lines
)
{
synchronized
(
this
.
lines
)
{
return
(
this
.
destination
!=
null
)
?
this
.
destination
.
isInfoEnabled
()
:
true
;
return
(
this
.
destination
==
null
)
||
this
.
destination
.
isInfoEnabled
()
;
}
}
}
}
@Override
@Override
public
boolean
isWarnEnabled
()
{
public
boolean
isWarnEnabled
()
{
synchronized
(
this
.
lines
)
{
synchronized
(
this
.
lines
)
{
return
(
this
.
destination
!=
null
)
?
this
.
destination
.
isWarnEnabled
()
:
true
;
return
(
this
.
destination
==
null
)
||
this
.
destination
.
isWarnEnabled
()
;
}
}
}
}
@Override
@Override
public
boolean
isErrorEnabled
()
{
public
boolean
isErrorEnabled
()
{
synchronized
(
this
.
lines
)
{
synchronized
(
this
.
lines
)
{
return
(
this
.
destination
!=
null
)
?
this
.
destination
.
isErrorEnabled
()
:
true
;
return
(
this
.
destination
==
null
)
||
this
.
destination
.
isErrorEnabled
()
;
}
}
}
}
@Override
@Override
public
boolean
isFatalEnabled
()
{
public
boolean
isFatalEnabled
()
{
synchronized
(
this
.
lines
)
{
synchronized
(
this
.
lines
)
{
return
(
this
.
destination
!=
null
)
?
this
.
destination
.
isFatalEnabled
()
:
true
;
return
(
this
.
destination
==
null
)
||
this
.
destination
.
isFatalEnabled
()
;
}
}
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServer.java
View file @
c19057e1
...
@@ -344,10 +344,7 @@ public class UndertowServletWebServer implements WebServer {
...
@@ -344,10 +344,7 @@ public class UndertowServletWebServer implements WebServer {
return
false
;
return
false
;
}
}
Port
other
=
(
Port
)
obj
;
Port
other
=
(
Port
)
obj
;
if
(
this
.
number
!=
other
.
number
)
{
return
this
.
number
==
other
.
number
;
return
false
;
}
return
true
;
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java
View file @
c19057e1
...
@@ -275,10 +275,7 @@ public class UndertowWebServer implements WebServer {
...
@@ -275,10 +275,7 @@ public class UndertowWebServer implements WebServer {
return
false
;
return
false
;
}
}
UndertowWebServer
.
Port
other
=
(
UndertowWebServer
.
Port
)
obj
;
UndertowWebServer
.
Port
other
=
(
UndertowWebServer
.
Port
)
obj
;
if
(
this
.
number
!=
other
.
number
)
{
return
this
.
number
==
other
.
number
;
return
false
;
}
return
true
;
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment