<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=tmattsson" rel="nofollow">Tobias Mattsson</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8728?redirect=false" rel="nofollow">SPR-8728</a></strong> and commented</p>
<p dir="auto">It would be really helpful if the profile attribute could take names of profiles that all has to be active.</p>
<p dir="auto">For instance:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;beans profile=&quot;production,datacenter_us&quot;&gt;
    ...
&lt;/beans&gt;
&lt;beans profile=&quot;production,datacenter_eu&quot;&gt;
    ...
&lt;/beans&gt;"><pre class="notranslate"><code class="notranslate">&lt;beans profile="production,datacenter_us"&gt;
    ...
&lt;/beans&gt;
&lt;beans profile="production,datacenter_eu"&gt;
    ...
&lt;/beans&gt;
</code></pre></div>
<p dir="auto">As for syntax there would need to be a notation that can express both OR and AND, possibly using | and ,</p>
<p dir="auto">Like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;beans profile=&quot;staging|production&quot;&gt;
    ...
&lt;/beans&gt;"><pre class="notranslate"><code class="notranslate">&lt;beans profile="staging|production"&gt;
    ...
&lt;/beans&gt;
</code></pre></div>
<p dir="auto">Even better would be if the syntax was in line with other expressions such as SpEL.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 M2</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117665" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13818" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13818/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13818">#13818</a> Provide boolean logic on bean profiles, i.e. NOT profile. (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398222390" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/21010" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/21010/hovercard" href="https://github.com/spring-projects/spring-framework/issues/21010">#21010</a> Profile activation: not operator does not work consistently</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398110303" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12637" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12637/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12637">#12637</a> Support profile exclusivity and/or bean definition finality</li>
</ul>
<p dir="auto">7 votes, 12 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mark.fisher" rel="nofollow">Mark Fisher</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9654?redirect=false" rel="nofollow">SPR-9654</a></strong> and commented</p>
<p dir="auto">This can lead to an implicit "escaping" of the yet-to-be-initialized instance. It's more subtle than an explicit escape of a "this" reference, but it still allows the instance to be used before it is fully initialized (e.g. any explicit or implicit "this" references within the overridden method).</p>
<p dir="auto">This is a decent explanation of the potential consequences:<br>
<a href="https://www.securecoding.cert.org/confluence/display/java/MET05-J.+Ensure+that+constructors+do+not+call+overridable+methods" rel="nofollow">https://www.securecoding.cert.org/confluence/display/java/MET05-J.+Ensure+that+constructors+do+not+call+overridable+methods</a></p>
<p dir="auto">I discovered this while trying to create a custom Environment subclass that initializes a couple of its own final instance varirables within its constructor and then attempts to use those in its overriding implementation of customizePropertySources(..).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.2</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398116580" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13652" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13652/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13652">#13652</a> AbstractEnvironment should not call overridable method from constructor (<em><strong>"duplicates"</strong></em>)</li>
</ul>