@Override
    public void setLocations(Resource... locations) {
        final List<Resource> list = new ArrayList<>();
        for (Resource r : locations) {
            if (r.exists()) {
                list.add(r);
            } else {
                // In our case this event is worth a DEBUG note.
                logger.debug(
                        "The following Resource was not present (it may be "
                                + "optional, or it's absence may lead to issues):  ",
                        r);
            }
        }
        super.setLocations(list.toArray(new Resource[0]));
    }
@ Override public void setLocations ( Resource ... locations ) { final List < Resource > list = new ArrayList < > ( ) ; for ( Resource r : locations ) { if ( r . exists ( ) ) { list . add ( r ) ; } else { logger . debug ( "The following Resource was not present (it may be " + "optional, or it's absence may lead to issues):  " , r ) ; } } super . setLocations ( list . toArray ( new Resource [ 0 ] ) ) ; }
uPortal defines some properties files in its primaryPropertyPlaceholderConfigurer bean that
are considered (and documented) optional. The parent class
(PropertySourcesPlaceholderConfigurer) will operate properly without them, but puts a
significant number of WARN messages into the log. These are noisy, and could lead a new
adopter to think that something's wrong. This method removes absent properties files from the
collection.