Skip to content

Commit bd282e6

Browse files
committed
Polishing
(cherry picked from commit 6e5b873)
1 parent 6bdc5bf commit bd282e6

File tree

4 files changed

+36
-30
lines changed

4 files changed

+36
-30
lines changed

spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java

+6
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,22 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
5353
* Name of the ConversionService bean in the factory.
5454
* If none is supplied, default conversion rules apply.
5555
* @see org.springframework.core.convert.ConversionService
56+
* @since 3.0
5657
*/
5758
String CONVERSION_SERVICE_BEAN_NAME = "conversionService";
5859

5960
/**
6061
* Name of the LoadTimeWeaver bean in the factory. If such a bean is supplied,
6162
* the context will use a temporary ClassLoader for type matching, in order
6263
* to allow the LoadTimeWeaver to process all actual bean classes.
64+
* @since 2.5
6365
* @see org.springframework.instrument.classloading.LoadTimeWeaver
6466
*/
6567
String LOAD_TIME_WEAVER_BEAN_NAME = "loadTimeWeaver";
6668

6769
/**
6870
* Name of the {@link Environment} bean in the factory.
71+
* @since 3.1
6972
*/
7073
String ENVIRONMENT_BEAN_NAME = "environment";
7174

@@ -84,6 +87,7 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
8487

8588
/**
8689
* Set the unique id of this application context.
90+
* @since 3.0
8791
*/
8892
void setId(String id);
8993

@@ -99,12 +103,14 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
99103

100104
/**
101105
* Return the Environment for this application context in configurable form.
106+
* @since 3.1
102107
*/
103108
ConfigurableEnvironment getEnvironment();
104109

105110
/**
106111
* Set the {@code Environment} for this application context.
107112
* @param environment the new environment
113+
* @since 3.1
108114
*/
109115
void setEnvironment(ConfigurableEnvironment environment);
110116

spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,24 +35,24 @@
3535
*
3636
* <h4>Example: adding a new property source with highest search priority</h4>
3737
* <pre class="code">
38-
* ConfigurableEnvironment environment = new StandardEnvironment();
39-
* MutablePropertySources propertySources = environment.getPropertySources();
40-
* Map<String, String> myMap = new HashMap<String, String>();
41-
* myMap.put("xyz", "myValue");
42-
* propertySources.addFirst(new MapPropertySource("MY_MAP", myMap));
38+
* ConfigurableEnvironment environment = new StandardEnvironment();
39+
* MutablePropertySources propertySources = environment.getPropertySources();
40+
* Map<String, String> myMap = new HashMap<String, String>();
41+
* myMap.put("xyz", "myValue");
42+
* propertySources.addFirst(new MapPropertySource("MY_MAP", myMap));
4343
* </pre>
4444
*
4545
* <h4>Example: removing the default system properties property source</h4>
4646
* <pre class="code">
47-
* MutablePropertySources propertySources = environment.getPropertySources();
48-
* propertySources.remove(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)
47+
* MutablePropertySources propertySources = environment.getPropertySources();
48+
* propertySources.remove(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)
4949
* </pre>
5050
*
5151
* <h4>Example: mocking the system environment for testing purposes</h4>
5252
* <pre class="code">
53-
* MutablePropertySources propertySources = environment.getPropertySources();
54-
* MockPropertySource mockEnvVars = new MockPropertySource().withProperty("xyz", "myValue");
55-
* propertySources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars);
53+
* MutablePropertySources propertySources = environment.getPropertySources();
54+
* MockPropertySource mockEnvVars = new MockPropertySource().withProperty("xyz", "myValue");
55+
* propertySources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars);
5656
* </pre>
5757
*
5858
* When an {@link Environment} is being used by an {@code ApplicationContext}, it is
@@ -64,7 +64,6 @@
6464
* org.springframework.context.support.PropertySourcesPlaceholderConfigurer property
6565
* placeholder configurers}.
6666
*
67-
*
6867
* @author Chris Beams
6968
* @since 3.1
7069
* @see StandardEnvironment

spring-core/src/main/java/org/springframework/core/env/Environment.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,8 +77,8 @@ public interface Environment extends PropertyResolver {
7777
* activated by setting {@linkplain AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME
7878
* "spring.profiles.active"} as a system property or by calling
7979
* {@link ConfigurableEnvironment#setActiveProfiles(String...)}.
80-
* <p>If no profiles have explicitly been specified as active, then any {@linkplain
81-
* #getDefaultProfiles() default profiles} will automatically be activated.
80+
* <p>If no profiles have explicitly been specified as active, then any
81+
* {@linkplain #getDefaultProfiles() default profiles} will automatically be activated.
8282
* @see #getDefaultProfiles
8383
* @see ConfigurableEnvironment#setActiveProfiles
8484
* @see AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME

spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,23 +25,25 @@
2525
/**
2626
* XStream {@link Converter} that supports all classes, but throws exceptions for
2727
* (un)marshalling.
28-
* <p>Main purpose of this class is to
28+
*
29+
* <p>The main purpose of this class is to
2930
* {@linkplain com.thoughtworks.xstream.XStream#registerConverter(com.thoughtworks.xstream.converters.Converter, int) register}
30-
* this converter as a catchall last converter with a
31+
* this converter as a catch-all last converter with a
3132
* {@linkplain com.thoughtworks.xstream.XStream#PRIORITY_NORMAL normal}
32-
* or higher priority, in addition to converters that explicitly support the domain
33-
* classes that should be supported. As a result, default XStream converters with lower
34-
* priorities and possible security vulnerabilities do not get invoked.
35-
* <p>For instance:</p>
33+
* or higher priority, in addition to converters that explicitly handle the domain
34+
* classes that should be supported. As a result, default XStream converters with
35+
* lower priorities and possible security vulnerabilities do not get invoked.
36+
*
37+
* <p>For instance:
3638
* <pre class="code">
3739
* XStreamMarshaller unmarshaller = new XStreamMarshaller();
3840
* unmarshaller.getXStream().registerConverter(new MyDomainClassConverter(), XStream.PRIORITY_VERY_HIGH);
3941
* unmarshaller.getXStream().registerConverter(new CatchAllConverter(), XStream.PRIORITY_NORMAL);
40-
* MyDomainClass o = unmarshaller.unmarshal(source);
42+
* MyDomainClass myObject = unmarshaller.unmarshal(source);
4143
* </pre
4244
*
4345
* @author Arjen Poutsma
44-
* @since 4.0
46+
* @since 3.2.5
4547
*/
4648
public class CatchAllConverter implements Converter {
4749

@@ -51,14 +53,13 @@ public boolean canConvert(Class type) {
5153
}
5254

5355
@Override
54-
public void marshal(Object source, HierarchicalStreamWriter writer,
55-
MarshallingContext context) {
56-
throw new UnsupportedOperationException("marshalling not supported");
56+
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
57+
throw new UnsupportedOperationException("Marshalling not supported");
5758
}
5859

5960
@Override
60-
public Object unmarshal(HierarchicalStreamReader reader,
61-
UnmarshallingContext context) {
62-
throw new UnsupportedOperationException("unmarshalling not supported");
61+
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
62+
throw new UnsupportedOperationException("Unmarshalling not supported");
6363
}
64+
6465
}

0 commit comments

Comments
 (0)