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
2eba1c5f
Commit
2eba1c5f
authored
Oct 17, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Use Assert.state() with Supplier where possible"
Closes gh-10658
parent
3b71393e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
CommandLineInvoker.java
...framework/boot/cli/infrastructure/CommandLineInvoker.java
+2
-2
DefinitionsParser.java
...ngframework/boot/test/mock/mockito/DefinitionsParser.java
+2
-2
ApplicationTemp.java
...c/main/java/org/springframework/boot/ApplicationTemp.java
+2
-1
JettyWebServer.java
...ringframework/boot/web/embedded/jetty/JettyWebServer.java
+2
-2
No files found.
spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java
View file @
2eba1c5f
...
...
@@ -93,8 +93,8 @@ public final class CommandLineInvoker {
}
File
bin
=
new
File
(
unpacked
.
listFiles
()[
0
],
"bin"
);
File
launchScript
=
new
File
(
bin
,
isWindows
()
?
"spring.bat"
:
"spring"
);
Assert
.
state
(
launchScript
.
exists
()
&&
launchScript
.
isFile
(),
()
->
"Could not find CLI launch script "
+
launchScript
.
getAbsolutePath
());
Assert
.
state
(
launchScript
.
exists
()
&&
launchScript
.
isFile
(),
()
->
"Could not find CLI launch script "
+
launchScript
.
getAbsolutePath
());
return
launchScript
;
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java
View file @
2eba1c5f
...
...
@@ -109,8 +109,8 @@ class DefinitionsParser {
private
void
addDefinition
(
AnnotatedElement
element
,
Definition
definition
,
String
type
)
{
boolean
isNewDefinition
=
this
.
definitions
.
add
(
definition
);
Assert
.
state
(
isNewDefinition
,
()
->
"Duplicate "
+
type
+
" definition "
+
definition
);
Assert
.
state
(
isNewDefinition
,
()
->
"Duplicate "
+
type
+
" definition "
+
definition
);
if
(
element
instanceof
Field
)
{
Field
field
=
(
Field
)
element
;
this
.
definitionFields
.
put
(
definition
,
field
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ApplicationTemp.java
View file @
2eba1c5f
...
...
@@ -91,7 +91,8 @@ public class ApplicationTemp {
Assert
.
state
(
StringUtils
.
hasLength
(
property
),
"No 'java.io.tmpdir' property set"
);
File
file
=
new
File
(
property
);
Assert
.
state
(
file
.
exists
(),
()
->
"Temp directory"
+
file
+
" does not exist"
);
Assert
.
state
(
file
.
isDirectory
(),
()
->
"Temp location "
+
file
+
" is not a directory"
);
Assert
.
state
(
file
.
isDirectory
(),
()
->
"Temp location "
+
file
+
" is not a directory"
);
return
file
;
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyWebServer.java
View file @
2eba1c5f
...
...
@@ -92,8 +92,8 @@ public class JettyWebServer implements WebServer {
@Override
protected
void
doStart
()
throws
Exception
{
for
(
Connector
connector
:
JettyWebServer
.
this
.
connectors
)
{
Assert
.
state
(
connector
.
isStopped
(),
()
->
"Connector "
+
connector
+
" has been started prematurely"
);
Assert
.
state
(
connector
.
isStopped
(),
()
->
"Connector "
+
connector
+
" has been started prematurely"
);
}
JettyWebServer
.
this
.
server
.
setConnectors
(
null
);
}
...
...
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