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
2a6b1e69
Commit
2a6b1e69
authored
Apr 20, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5720 from izeye/substring
* pr/5720: Remove the second parameter of substring() if possible
parents
58dac43b
b914b4aa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
8 deletions
+7
-8
ProjectInfoAutoConfiguration.java
...boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
+1
-1
InitializrService.java
...ingframework/boot/cli/command/init/InitializrService.java
+1
-2
RawConfigurationMetadata.java
.../boot/configurationmetadata/RawConfigurationMetadata.java
+1
-1
ItemHint.java
...mework/boot/configurationprocessor/metadata/ItemHint.java
+1
-1
SampleApplication.java
...ofiles-fork/src/main/java/org/test/SampleApplication.java
+1
-1
SampleApplication.java
...un-profiles/src/main/java/org/test/SampleApplication.java
+1
-1
ConfigFileApplicationListenerTests.java
...ot/context/config/ConfigFileApplicationListenerTests.java
+1
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
View file @
2a6b1e69
...
@@ -76,7 +76,7 @@ public class ProjectInfoAutoConfiguration {
...
@@ -76,7 +76,7 @@ public class ProjectInfoAutoConfiguration {
Properties
target
=
new
Properties
();
Properties
target
=
new
Properties
();
for
(
String
key
:
source
.
stringPropertyNames
())
{
for
(
String
key
:
source
.
stringPropertyNames
())
{
if
(
key
.
startsWith
(
p
))
{
if
(
key
.
startsWith
(
p
))
{
target
.
put
(
key
.
substring
(
p
.
length
()
,
key
.
length
()
),
source
.
get
(
key
));
target
.
put
(
key
.
substring
(
p
.
length
()),
source
.
get
(
key
));
}
}
}
}
return
target
;
return
target
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrService.java
View file @
2a6b1e69
...
@@ -250,8 +250,7 @@ class InitializrService {
...
@@ -250,8 +250,7 @@ class InitializrService {
String
value
=
header
.
getValue
();
String
value
=
header
.
getValue
();
int
start
=
value
.
indexOf
(
FILENAME_HEADER_PREFIX
);
int
start
=
value
.
indexOf
(
FILENAME_HEADER_PREFIX
);
if
(
start
!=
-
1
)
{
if
(
start
!=
-
1
)
{
value
=
value
.
substring
(
start
+
FILENAME_HEADER_PREFIX
.
length
(),
value
=
value
.
substring
(
start
+
FILENAME_HEADER_PREFIX
.
length
());
value
.
length
());
int
end
=
value
.
indexOf
(
"\""
);
int
end
=
value
.
indexOf
(
"\""
);
if
(
end
!=
-
1
)
{
if
(
end
!=
-
1
)
{
return
value
.
substring
(
0
,
end
);
return
value
.
substring
(
0
,
end
);
...
...
spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/RawConfigurationMetadata.java
View file @
2a6b1e69
...
@@ -81,7 +81,7 @@ class RawConfigurationMetadata {
...
@@ -81,7 +81,7 @@ class RawConfigurationMetadata {
String
dottedPrefix
=
groupId
+
"."
;
String
dottedPrefix
=
groupId
+
"."
;
String
id
=
item
.
getId
();
String
id
=
item
.
getId
();
if
(
hasLength
(
groupId
)
&&
id
.
startsWith
(
dottedPrefix
))
{
if
(
hasLength
(
groupId
)
&&
id
.
startsWith
(
dottedPrefix
))
{
String
name
=
id
.
substring
(
dottedPrefix
.
length
()
,
id
.
length
()
);
String
name
=
id
.
substring
(
dottedPrefix
.
length
());
item
.
setName
(
name
);
item
.
setName
(
name
);
}
}
}
}
...
...
spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java
View file @
2a6b1e69
...
@@ -54,7 +54,7 @@ public class ItemHint implements Comparable<ItemHint> {
...
@@ -54,7 +54,7 @@ public class ItemHint implements Comparable<ItemHint> {
int
dot
=
name
.
lastIndexOf
(
'.'
);
int
dot
=
name
.
lastIndexOf
(
'.'
);
if
(
dot
!=
-
1
)
{
if
(
dot
!=
-
1
)
{
String
prefix
=
name
.
substring
(
0
,
dot
);
String
prefix
=
name
.
substring
(
0
,
dot
);
String
originalName
=
name
.
substring
(
dot
,
name
.
length
()
);
String
originalName
=
name
.
substring
(
dot
);
return
prefix
+
ConfigurationMetadata
.
toDashedCase
(
originalName
);
return
prefix
+
ConfigurationMetadata
.
toDashedCase
(
originalName
);
}
}
return
ConfigurationMetadata
.
toDashedCase
(
name
);
return
ConfigurationMetadata
.
toDashedCase
(
name
);
...
...
spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/src/main/java/org/test/SampleApplication.java
View file @
2a6b1e69
...
@@ -29,7 +29,7 @@ public class SampleApplication {
...
@@ -29,7 +29,7 @@ public class SampleApplication {
throw
new
IllegalArgumentException
(
"Invalid argument "
+
argument
);
throw
new
IllegalArgumentException
(
"Invalid argument "
+
argument
);
}
}
int
index
=
args
[
0
].
indexOf
(
"="
);
int
index
=
args
[
0
].
indexOf
(
"="
);
String
profile
=
argument
.
substring
(
index
+
1
,
argument
.
length
()
);
String
profile
=
argument
.
substring
(
index
+
1
);
System
.
out
.
println
(
"I haz been run with profile(s) '"
+
profile
+
"'"
);
System
.
out
.
println
(
"I haz been run with profile(s) '"
+
profile
+
"'"
);
}
}
...
...
spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/src/main/java/org/test/SampleApplication.java
View file @
2a6b1e69
...
@@ -29,7 +29,7 @@ public class SampleApplication {
...
@@ -29,7 +29,7 @@ public class SampleApplication {
throw
new
IllegalArgumentException
(
"Invalid argument "
+
argument
);
throw
new
IllegalArgumentException
(
"Invalid argument "
+
argument
);
}
}
int
index
=
args
[
0
].
indexOf
(
"="
);
int
index
=
args
[
0
].
indexOf
(
"="
);
String
profile
=
argument
.
substring
(
index
+
1
,
argument
.
length
()
);
String
profile
=
argument
.
substring
(
index
+
1
);
System
.
out
.
println
(
"I haz been run with profile(s) '"
+
profile
+
"'"
);
System
.
out
.
println
(
"I haz been run with profile(s) '"
+
profile
+
"'"
);
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java
View file @
2a6b1e69
...
@@ -464,7 +464,7 @@ public class ConfigFileApplicationListenerTests {
...
@@ -464,7 +464,7 @@ public class ConfigFileApplicationListenerTests {
assertThat
(
index
)
assertThat
(
index
)
.
as
(
"Loading profile '"
+
profile
+
"' not found in '"
+
log
+
"'"
)
.
as
(
"Loading profile '"
+
profile
+
"' not found in '"
+
log
+
"'"
)
.
isNotEqualTo
(-
1
);
.
isNotEqualTo
(-
1
);
log
=
log
.
substring
(
index
+
line
.
length
()
,
log
.
length
()
);
log
=
log
.
substring
(
index
+
line
.
length
());
}
}
}
}
...
...
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