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
c6c3a91f
Commit
c6c3a91f
authored
Aug 05, 2019
by
SaberXu
Committed by
Stephane Nicoll
Aug 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify if statements
See gh-17785
parent
3efead4b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
24 deletions
+9
-24
ConfigurationMetadata.java
...onfigurationprocessor/metadata/ConfigurationMetadata.java
+1
-1
Metadata.java
...mework/boot/configurationprocessor/metadata/Metadata.java
+2
-8
LaunchScriptConfiguration.java
...boot/gradle/tasks/bundling/LaunchScriptConfiguration.java
+4
-7
MainClassFinder.java
...rg/springframework/boot/loader/tools/MainClassFinder.java
+1
-4
PropertiesMergingResourceTransformer.java
...work/boot/maven/PropertiesMergingResourceTransformer.java
+1
-4
No files found.
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java
View file @
c6c3a91f
...
@@ -165,7 +165,7 @@ public class ConfigurationMetadata {
...
@@ -165,7 +165,7 @@ public class ConfigurationMetadata {
if
(
o1
==
o2
)
{
if
(
o1
==
o2
)
{
return
true
;
return
true
;
}
}
return
o1
!=
null
&&
o
2
!=
null
&&
o
1
.
equals
(
o2
);
return
o1
!=
null
&&
o1
.
equals
(
o2
);
}
}
public
static
String
nestedPrefix
(
String
prefix
,
String
name
)
{
public
static
String
nestedPrefix
(
String
prefix
,
String
name
)
{
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java
View file @
c6c3a91f
...
@@ -157,10 +157,7 @@ public final class Metadata {
...
@@ -157,10 +157,7 @@ public final class Metadata {
if
(
this
.
deprecation
==
null
&&
itemMetadata
.
getDeprecation
()
!=
null
)
{
if
(
this
.
deprecation
==
null
&&
itemMetadata
.
getDeprecation
()
!=
null
)
{
return
false
;
return
false
;
}
}
if
(
this
.
deprecation
!=
null
&&
!
this
.
deprecation
.
equals
(
itemMetadata
.
getDeprecation
()))
{
return
this
.
deprecation
==
null
||
this
.
deprecation
.
equals
(
itemMetadata
.
getDeprecation
());
return
false
;
}
return
true
;
}
}
public
MetadataItemCondition
ofType
(
Class
<?>
dataType
)
{
public
MetadataItemCondition
ofType
(
Class
<?>
dataType
)
{
...
@@ -342,10 +339,7 @@ public final class Metadata {
...
@@ -342,10 +339,7 @@ public final class Metadata {
if
(
this
.
value
!=
null
&&
!
this
.
value
.
equals
(
valueHint
.
getValue
()))
{
if
(
this
.
value
!=
null
&&
!
this
.
value
.
equals
(
valueHint
.
getValue
()))
{
return
false
;
return
false
;
}
}
if
(
this
.
description
!=
null
&&
!
this
.
description
.
equals
(
valueHint
.
getDescription
()))
{
return
this
.
description
==
null
||
this
.
description
.
equals
(
valueHint
.
getDescription
());
return
false
;
}
return
true
;
}
}
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java
View file @
c6c3a91f
...
@@ -106,17 +106,14 @@ public class LaunchScriptConfiguration implements Serializable {
...
@@ -106,17 +106,14 @@ public class LaunchScriptConfiguration implements Serializable {
return
false
;
return
false
;
}
}
if
(
this
.
script
==
null
)
{
if
(
this
.
script
==
null
)
{
if
(
other
.
script
!=
null
)
{
return
other
.
script
==
null
;
return
false
;
}
}
}
else
if
(!
this
.
script
.
equals
(
other
.
script
))
{
else
if
(!
this
.
script
.
equals
(
other
.
script
))
{
return
false
;
return
false
;
}
}
else
if
(!
equalContents
(
this
.
script
,
other
.
script
))
{
else
{
return
false
;
return
equalContents
(
this
.
script
,
other
.
script
)
;
}
}
return
true
;
}
}
private
boolean
equalContents
(
File
one
,
File
two
)
{
private
boolean
equalContents
(
File
one
,
File
two
)
{
...
@@ -132,7 +129,7 @@ public class LaunchScriptConfiguration implements Serializable {
...
@@ -132,7 +129,7 @@ public class LaunchScriptConfiguration implements Serializable {
public
int
hashCode
()
{
public
int
hashCode
()
{
final
int
prime
=
31
;
final
int
prime
=
31
;
int
result
=
1
;
int
result
=
1
;
result
=
prime
*
result
+
((
this
.
properties
==
null
)
?
0
:
this
.
properties
.
hashCode
()
);
result
=
prime
*
result
+
this
.
properties
.
hashCode
(
);
result
=
prime
*
result
+
((
this
.
script
==
null
)
?
0
:
this
.
script
.
hashCode
());
result
=
prime
*
result
+
((
this
.
script
==
null
)
?
0
:
this
.
script
.
hashCode
());
return
result
;
return
result
;
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java
View file @
c6c3a91f
...
@@ -381,10 +381,7 @@ public abstract class MainClassFinder {
...
@@ -381,10 +381,7 @@ public abstract class MainClassFinder {
return
false
;
return
false
;
}
}
MainClass
other
=
(
MainClass
)
obj
;
MainClass
other
=
(
MainClass
)
obj
;
if
(!
this
.
name
.
equals
(
other
.
name
))
{
return
this
.
name
.
equals
(
other
.
name
);
return
false
;
}
return
true
;
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/PropertiesMergingResourceTransformer.java
View file @
c6c3a91f
...
@@ -52,10 +52,7 @@ public class PropertiesMergingResourceTransformer implements ResourceTransformer
...
@@ -52,10 +52,7 @@ public class PropertiesMergingResourceTransformer implements ResourceTransformer
@Override
@Override
public
boolean
canTransformResource
(
String
resource
)
{
public
boolean
canTransformResource
(
String
resource
)
{
if
(
this
.
resource
!=
null
&&
this
.
resource
.
equalsIgnoreCase
(
resource
))
{
return
this
.
resource
!=
null
&&
this
.
resource
.
equalsIgnoreCase
(
resource
);
return
true
;
}
return
false
;
}
}
@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