File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
main/java/org/springframework/core
test/java/org/springframework/core/env Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
44
44
*/
45
45
public abstract class SpringProperties {
46
46
47
+ private static final String PROPERTIES_RESOURCE_LOCATION = "spring.properties" ;
48
+
47
49
private static final Log logger = LogFactory .getLog (SpringProperties .class );
48
50
49
51
private static final Properties localProperties = new Properties ();
@@ -52,7 +54,7 @@ public abstract class SpringProperties {
52
54
static {
53
55
try {
54
56
ClassLoader cl = SpringProperties .class .getClassLoader ();
55
- URL url = cl .getResource ("spring.properties" );
57
+ URL url = cl .getResource (PROPERTIES_RESOURCE_LOCATION );
56
58
if (url != null ) {
57
59
logger .info ("Found 'spring.properties' file in local classpath" );
58
60
InputStream is = url .openStream ();
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -354,6 +354,13 @@ public void suppressGetenvAccessThroughSpringProperty() {
354
354
SpringProperties .setProperty ("spring.getenv.ignore" , null );
355
355
}
356
356
357
+ @ Test
358
+ public void suppressGetenvAccessThroughSpringFlag () {
359
+ SpringProperties .setFlag ("spring.getenv.ignore" );
360
+ assertTrue (environment .getSystemEnvironment ().isEmpty ());
361
+ SpringProperties .setProperty ("spring.getenv.ignore" , null );
362
+ }
363
+
357
364
@ Test
358
365
public void getSystemProperties_withAndWithoutSecurityManager () {
359
366
System .setProperty (ALLOWED_PROPERTY_NAME , ALLOWED_PROPERTY_VALUE );
You can’t perform that action at this time.
0 commit comments