<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=david_syer" rel="nofollow">Dave Syer</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6525?redirect=false" rel="nofollow">SPR-6525</a></strong> and commented</p>
<p dir="auto">SpEL context is wrong in method parameter resolution.  Instead of using the current context for the stack (which refers to the method target), parameters should have a current context equal to the context root.  This test would fail in EvaluationTests():</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Test
public void testNestedMethod() {
     evaluate(&quot;placeOfBirth.doubleIt(inventions.length)&quot;, 18, Integer.class);
}"><pre class="notranslate"><code class="notranslate">@Test
public void testNestedMethod() {
     evaluate("placeOfBirth.doubleIt(inventions.length)", 18, Integer.class);
}
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC3</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/15983/SPR-6526.patch" rel="nofollow">SPR-6526.patch</a> (<em>1.51 kB</em>)</li>
</ul>
<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="398093849" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10255" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10255/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10255">#10255</a> Spel parser is not able to resolve bean id variable when it is passed as parameter to a static method. (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/33a7bbb4850e69a3b9ac812411bb12d81346f37a/hovercard" href="https://github.com/spring-projects/spring-framework/commit/33a7bbb4850e69a3b9ac812411bb12d81346f37a"><tt>33a7bbb</tt></a></p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jzaugg" rel="nofollow">Jason Zaugg</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4686?redirect=false" rel="nofollow">SPR-4686</a></strong> and commented</p>
<p dir="auto"><code class="notranslate">@Component</code><br>
public final class SimpleXslTransformerFactory {<br>
<code class="notranslate">@Autowired</code><br>
private StreamSourceFactory streamSourceFactory;<br>
<code class="notranslate">@Autowired</code><br>
private EfgLoggerFactory loggerFactory;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public Transformer createXslTransformer(Resource xsl) {
    Source xslSource = streamSourceFactory.create(xsl);
    Transformer xslTransformer = createXslTransformer(xslSource, TransformerFactory.newInstance());
    xslTransformer.setErrorListener(new LoggingErrorListener());
    return xslTransformer;
}

private Transformer createXslTransformer(Source xslSource, TransformerFactory factory) {
    try {
        return factory.newTransformer(xslSource);
    } catch (TransformerConfigurationException e) {
        throw new RuntimeException(e);
    }
}

private class LoggingErrorListener implements ErrorListener {
    public void warning(TransformerException exception) throws TransformerException {
        loggerFactory.create().warn(ExceptionUtils.getFullStackTrace(exception));
    }

    public void error(TransformerException exception) throws TransformerException {
        loggerFactory.create().warn(ExceptionUtils.getFullStackTrace(exception));
    }

    public void fatalError(TransformerException exception) throws TransformerException {
        loggerFactory.create().warn(ExceptionUtils.getFullStackTrace(exception));
    }
}"><pre class="notranslate"><code class="notranslate">public Transformer createXslTransformer(Resource xsl) {
    Source xslSource = streamSourceFactory.create(xsl);
    Transformer xslTransformer = createXslTransformer(xslSource, TransformerFactory.newInstance());
    xslTransformer.setErrorListener(new LoggingErrorListener());
    return xslTransformer;
}

private Transformer createXslTransformer(Source xslSource, TransformerFactory factory) {
    try {
        return factory.newTransformer(xslSource);
    } catch (TransformerConfigurationException e) {
        throw new RuntimeException(e);
    }
}

private class LoggingErrorListener implements ErrorListener {
    public void warning(TransformerException exception) throws TransformerException {
        loggerFactory.create().warn(ExceptionUtils.getFullStackTrace(exception));
    }

    public void error(TransformerException exception) throws TransformerException {
        loggerFactory.create().warn(ExceptionUtils.getFullStackTrace(exception));
    }

    public void fatalError(TransformerException exception) throws TransformerException {
        loggerFactory.create().warn(ExceptionUtils.getFullStackTrace(exception));
    }
}
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">When evaluating ClassMetadataReadingVisitor.isIndependent(),<br>
this.enclosingClassName: com.efgfp.raptor.functional.SimpleXslTransformerFactory<br>
this.independentInnerClass: false</p>
<p dir="auto">therefore (this.enclosingClassName == null || this.independentInnerClass) =&gt; false</p>
<p dir="auto">The list of candidate resources contained, in this order:</p>
<p dir="auto">URL [jar:file:/D:/wyd/workspace/raptor/target/exploded/raptor-web-interfaceWeb/WEB-INF/lib/functional-test.jar!/com/efgfp/raptor/functional/SimpleXslTransformerFactory$LoggingErrorListener.class],<br>
URL [jar:file:/D:/wyd/workspace/raptor/target/exploded/raptor-web-interfaceWeb/WEB-INF/lib/functional-test.jar!/com/efgfp/raptor/functional/SimpleXslTransformerFactory.class],</p>
<p dir="auto">Debugging the calls to the ClassMetadataReadingVisitor showed that a call was made:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" visitInnerClass():72, ClassMetadataReadingVisitor.java
accept():-1
accept():-1
getAnnotationMetadata():52, SimpleMetadataReader.java"><pre class="notranslate"><code class="notranslate"> visitInnerClass():72, ClassMetadataReadingVisitor.java
accept():-1
accept():-1
getAnnotationMetadata():52, SimpleMetadataReader.java
</code></pre></div>
<p dir="auto">name = {java.lang.String@5861}"com/efgfp/raptor/functional/SimpleXslTransformerFactory$LoggingErrorListener"<br>
outerName = {java.lang.String@3079}"com/efgfp/raptor/functional/SimpleXslTransformerFactory"<br>
innerName = {java.lang.String@5862}"LoggingErrorListener"<br>
access = 4101</p>
<p dir="auto">and that during this call, independentInnerClass was set to null.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.1</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="398084522" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9003" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9003/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9003">#9003</a> component scanning incorrectly excludes classes (<em><strong>"duplicates"</strong></em>)</li>
</ul>