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
fda537d3
Commit
fda537d3
authored
Aug 02, 2013
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
e1c6860a
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
18 additions
and
57 deletions
+18
-57
BeanDefinitionLoader.java
...n/java/org/springframework/boot/BeanDefinitionLoader.java
+0
-1
CustomPropertyConstructor.java
.../springframework/boot/bind/CustomPropertyConstructor.java
+4
-12
PropertiesConfigurationFactory.java
...ngframework/boot/bind/PropertiesConfigurationFactory.java
+0
-1
PropertySourcesPropertyValues.java
...ingframework/boot/bind/PropertySourcesPropertyValues.java
+4
-10
RelaxedDataBinder.java
...java/org/springframework/boot/bind/RelaxedDataBinder.java
+0
-2
JsonParserFactory.java
...va/org/springframework/boot/config/JsonParserFactory.java
+1
-2
YamlProcessor.java
...n/java/org/springframework/boot/config/YamlProcessor.java
+0
-4
YamlPropertySourceLoader.java
...springframework/boot/config/YamlPropertySourceLoader.java
+0
-1
ErrorPage.java
.../org/springframework/boot/context/embedded/ErrorPage.java
+1
-5
JettyEmbeddedServletContainer.java
...context/embedded/jetty/JettyEmbeddedServletContainer.java
+0
-1
JettyEmbeddedServletContainerFactory.java
.../embedded/jetty/JettyEmbeddedServletContainerFactory.java
+0
-1
TomcatEmbeddedServletContainerFactory.java
...mbedded/tomcat/TomcatEmbeddedServletContainerFactory.java
+1
-2
ContextIdApplicationContextInitializer.java
...t/initializer/ContextIdApplicationContextInitializer.java
+6
-8
ConfigurationProperties.java
...work/boot/context/properties/ConfigurationProperties.java
+1
-7
No files found.
spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java
View file @
fda537d3
...
...
@@ -149,7 +149,6 @@ class BeanDefinitionLoader {
}
private
int
load
(
Package
source
)
{
// FIXME register the scanned package for data to pick up
return
this
.
scanner
.
scan
(
source
.
getName
());
}
...
...
spring-boot/src/main/java/org/springframework/boot/bind/CustomPropertyConstructor.java
View file @
fda537d3
...
...
@@ -85,18 +85,10 @@ public class CustomPropertyConstructor extends Constructor {
@Override
protected
Property
getProperty
(
Class
<?>
type
,
String
name
)
throws
IntrospectionException
{
Property
p
=
lookupProperty
(
type
,
name
);
return
p
!=
null
?
p
:
super
.
getProperty
(
type
,
name
);
}
private
Property
lookupProperty
(
Class
<?>
type
,
String
name
)
{
Map
<
String
,
Property
>
m
=
CustomPropertyConstructor
.
this
.
properties
.
get
(
type
);
if
(
m
!=
null
)
{
return
m
.
get
(
name
);
}
return
null
;
Map
<
String
,
Property
>
forType
=
CustomPropertyConstructor
.
this
.
properties
.
get
(
type
);
Property
property
=
(
forType
==
null
?
null
:
forType
.
get
(
name
));
return
(
property
==
null
?
super
.
getProperty
(
type
,
name
)
:
property
);
}
}
}
spring-boot/src/main/java/org/springframework/boot/bind/PropertiesConfigurationFactory.java
View file @
fda537d3
...
...
@@ -82,7 +82,6 @@ public class PropertiesConfigurationFactory<T> implements FactoryBean<T>,
/**
* Create a new factory for an object of the given type.
*
* @see #PropertiesConfigurationFactory(Class)
*/
@SuppressWarnings
(
"unchecked"
)
...
...
spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java
View file @
fda537d3
...
...
@@ -44,12 +44,10 @@ public class PropertySourcesPropertyValues implements PropertyValues {
/**
* Create a new PropertyValues from the given PropertySources
*
* @param propertySources a PropertySources instance
*/
public
PropertySourcesPropertyValues
(
PropertySources
propertySources
)
{
this
.
propertySources
=
propertySources
;
// TODO: maybe lazy initialization?
PropertySourcesPropertyResolver
resolver
=
new
PropertySourcesPropertyResolver
(
propertySources
);
for
(
PropertySource
<?>
source
:
propertySources
)
{
...
...
@@ -93,15 +91,11 @@ public class PropertySourcesPropertyValues implements PropertyValues {
public
PropertyValues
changesSince
(
PropertyValues
old
)
{
MutablePropertyValues
changes
=
new
MutablePropertyValues
();
// for each property value in the new set
for
(
PropertyValue
new
Pv
:
getPropertyValues
())
{
for
(
PropertyValue
new
Value
:
getPropertyValues
())
{
// if there wasn't an old one, add it
PropertyValue
pvOld
=
old
.
getPropertyValue
(
newPv
.
getName
());
if
(
pvOld
==
null
)
{
changes
.
addPropertyValue
(
newPv
);
}
else
if
(!
pvOld
.
equals
(
newPv
))
{
// it's changed
changes
.
addPropertyValue
(
newPv
);
PropertyValue
oldValue
=
old
.
getPropertyValue
(
newValue
.
getName
());
if
(
oldValue
==
null
||
!
oldValue
.
equals
(
newValue
))
{
changes
.
addPropertyValue
(
newValue
);
}
}
return
changes
;
...
...
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java
View file @
fda537d3
...
...
@@ -82,7 +82,6 @@ public class RelaxedDataBinder extends DataBinder {
* map keys. Also creates new maps for properties of map type that are null (assuming
* all maps are potentially nested). The standard bracket <code>[...]</code>
* dereferencing is also accepted.
*
* @param propertyValues the property values
* @param target the target object
*/
...
...
@@ -146,7 +145,6 @@ public class RelaxedDataBinder extends DataBinder {
* <li>Fuzzy matching can be employed for bean property names</li>
* <li>Period separators can be used instead of indexing ([...]) for map keys</li>
* </ul>
*
* @param wrapper a bean wrapper for the object to bind
* @param path the bean path to bind
* @return a transformed path with correct bean wrapper syntax
...
...
spring-boot/src/main/java/org/springframework/boot/config/JsonParserFactory.java
View file @
fda537d3
...
...
@@ -30,8 +30,7 @@ public abstract class JsonParserFactory {
/**
* Static factory for the "best" JSON parser available on the classpath. Tries Jackson
* (2), then Snake YAML, and then falls back to the {@link SimpleJsonParser}.
*
* 2, then Snake YAML, and then falls back to the {@link SimpleJsonParser}.
* @return a {@link JsonParser}
*/
public
static
JsonParser
getJsonParser
()
{
...
...
spring-boot/src/main/java/org/springframework/boot/config/YamlProcessor.java
View file @
fda537d3
...
...
@@ -72,7 +72,6 @@ public class YamlProcessor {
* name=My Cool App
* url=http://dev.bar.com
* </pre>
*
* @param matchers a map of keys to value patterns (regular expressions)
*/
public
void
setDocumentMatchers
(
List
<?
extends
DocumentMatcher
>
matchers
)
{
...
...
@@ -83,7 +82,6 @@ public class YamlProcessor {
* Flag indicating that a document for which all the
* {@link #setDocumentMatchers(List) document matchers} abstain will nevertheless
* match.
*
* @param matchDefault the flag to set (default true)
*/
public
void
setMatchDefault
(
boolean
matchDefault
)
{
...
...
@@ -94,7 +92,6 @@ public class YamlProcessor {
* Method to use for resolving resources. Each resource will be converted to a Map, so
* this property is used to decide which map entries to keep in the final output from
* this factory.
*
* @param resolutionMethod the resolution method to set (defaults to
* {@link ResolutionMethod#OVERRIDE}).
*/
...
...
@@ -117,7 +114,6 @@ public class YamlProcessor {
* into the callback, along with its representation as Properties. Depending on the
* {@link #setResolutionMethod(ResolutionMethod)} not all of the documents will be
* parsed.
*
* @param callback a callback to delegate to once matching documents are found
*/
protected
void
process
(
MatchCallback
callback
)
{
...
...
spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java
View file @
fda537d3
...
...
@@ -63,7 +63,6 @@ public class YamlPropertySourceLoader extends PropertiesPropertySourceLoader {
/**
* A property source loader that loads all properties and matches all documents.
*
* @return a property source loader
*/
public
static
YamlPropertySourceLoader
matchAllLoader
()
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/ErrorPage.java
View file @
fda537d3
...
...
@@ -54,7 +54,6 @@ public class ErrorPage {
* The path to render (usually implemented as a forward), starting with "/". A custom
* controller or servlet path can be used, or if the container supports it, a template
* path (e.g. "/error.jsp").
*
* @return the path that will be rendered for this error
*/
public
String
getPath
()
{
...
...
@@ -70,7 +69,6 @@ public class ErrorPage {
/**
* The HTTP status value that this error page matches.
*
* @return the status
*/
public
HttpStatus
getStatus
()
{
...
...
@@ -79,7 +77,6 @@ public class ErrorPage {
/**
* The HTTP status value that this error page matches.
*
* @return the status value (or 0 for a page that matches any status)
*/
public
int
getStatusCode
()
{
...
...
@@ -88,8 +85,7 @@ public class ErrorPage {
/**
* The exception type name.
*
* @return the exception type name (or null if there is none)
* @return the exception type name (or {@code null} if there is none)
*/
public
String
getExceptionName
()
{
return
this
.
exception
==
null
?
null
:
this
.
exception
.
getName
();
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainer.java
View file @
fda537d3
...
...
@@ -83,7 +83,6 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
}
catch
(
InterruptedException
ex
)
{
Thread
.
currentThread
().
interrupt
();
// No drama
}
catch
(
Exception
ex
)
{
throw
new
EmbeddedServletContainerException
(
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java
View file @
fda537d3
...
...
@@ -274,7 +274,6 @@ public class JettyEmbeddedServletContainerFactory extends
/**
* Add {@link Configuration}s that will be applied to the {@link WebAppContext} before
* the server is started.
*
* @param configurations the configurations to add
*/
public
void
addConfigurations
(
Configuration
...
configurations
)
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java
View file @
fda537d3
...
...
@@ -332,8 +332,7 @@ public class TomcatEmbeddedServletContainerFactory extends
}
/**
* Add {@link LifecycleListener}s that should be applied to the Tomcat {@link Context}
* .
* Add {@link LifecycleListener}s that should be added to the Tomcat {@link Context}.
* @param contextLifecycleListeners the listeners to add
*/
public
void
addContextLifecycleListeners
(
...
...
spring-boot/src/main/java/org/springframework/boot/context/initializer/ContextIdApplicationContextInitializer.java
View file @
fda537d3
...
...
@@ -76,15 +76,13 @@ public class ContextIdApplicationContextInitializer implements
index
);
index
=
environment
.
getProperty
(
"spring.application.index"
,
Integer
.
class
,
index
);
if
(
index
>=
0
)
{
name
=
name
+
":"
+
index
;
return
name
+
":"
+
index
;
}
else
{
// FIXME do we want this
String
profiles
=
StringUtils
.
arrayToCommaDelimitedString
(
environment
.
getActiveProfiles
());
if
(
StringUtils
.
hasText
(
profiles
))
{
name
=
name
+
":"
+
profiles
;
}
String
profiles
=
StringUtils
.
arrayToCommaDelimitedString
(
environment
.
getActiveProfiles
());
if
(
StringUtils
.
hasText
(
profiles
))
{
name
=
name
+
":"
+
profiles
;
}
return
name
;
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java
View file @
fda537d3
...
...
@@ -26,9 +26,8 @@ import java.lang.annotation.Target;
* Annotation for externalized configuration. Add this to a class definition if you want
* to bind and validate some external Properties (e.g. from a .properties file).
*
* @see ConfigurationPropertiesBindingPostProcessor
*
* @author Dave Syer
* @see ConfigurationPropertiesBindingPostProcessor
*/
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
...
...
@@ -39,7 +38,6 @@ public @interface ConfigurationProperties {
* The (optional) name of the object to be bound. Properties to bind can have a name
* prefix to select the properties that are valid to this object. Synonym for
* {@link #name()}.
*
* @return the name prefix of the properties to bind
*/
String
value
()
default
""
;
...
...
@@ -48,7 +46,6 @@ public @interface ConfigurationProperties {
* The (optional) name of the object to be bound. Properties to bind can have a name
* prefix to select the properties that are valid to this object. Synonym for
* {@link #value()}.
*
* @return the name prefix of the properties to bind
*/
String
name
()
default
""
;
...
...
@@ -57,7 +54,6 @@ public @interface ConfigurationProperties {
* Flag to indicate that when binding to this object invalid fields should be ignored.
* Invalid means invalid according to the binder that is used, and usually this means
* fields of the wrong type (or that cannot be coerced into the correct type).
*
* @return the flag value (default false)
*/
boolean
ignoreInvalidFields
()
default
false
;
...
...
@@ -65,7 +61,6 @@ public @interface ConfigurationProperties {
/**
* Flag to indicate that when binding to this object unknown fields should be ignored.
* An unknown field could be a sign of a mistake in the Properties.
*
* @return the flag value (default true)
*/
boolean
ignoreUnknownFields
()
default
true
;
...
...
@@ -73,7 +68,6 @@ public @interface ConfigurationProperties {
/**
* Optionally provide an explicit resource path to bind to instead of using the
* default environment.
*
* @return the path (or paths) of resources to bind to
*/
String
[]
path
()
default
{};
...
...
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