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 11/*
2- * Copyright 2002-2013 the original author or authors.
2+ * Copyright 2002-2014 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.
4444 */
4545public abstract class SpringProperties {
4646
47+ private static final String PROPERTIES_RESOURCE_LOCATION = "spring.properties" ;
48+
4749 private static final Log logger = LogFactory .getLog (SpringProperties .class );
4850
4951 private static final Properties localProperties = new Properties ();
@@ -52,7 +54,7 @@ public abstract class SpringProperties {
5254 static {
5355 try {
5456 ClassLoader cl = SpringProperties .class .getClassLoader ();
55- URL url = cl .getResource ("spring.properties" );
57+ URL url = cl .getResource (PROPERTIES_RESOURCE_LOCATION );
5658 if (url != null ) {
5759 logger .info ("Found 'spring.properties' file in local classpath" );
5860 InputStream is = url .openStream ();
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2013 the original author or authors.
2+ * Copyright 2002-2014 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.
@@ -354,6 +354,13 @@ public void suppressGetenvAccessThroughSpringProperty() {
354354 SpringProperties .setProperty ("spring.getenv.ignore" , null );
355355 }
356356
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+
357364 @ Test
358365 public void getSystemProperties_withAndWithoutSecurityManager () {
359366 System .setProperty (ALLOWED_PROPERTY_NAME , ALLOWED_PROPERTY_VALUE );
You can’t perform that action at this time.
0 commit comments