Issue 1:
Dave Syer opened SPR-6525 and commented

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():

@Test
public void testNestedMethod() {
evaluate("placeOfBirth.doubleIt(inventions.length)", 18, Integer.class);
}

Affects: 3.0 RC3

Attachments:

SPR-6526.patch (1.51 kB)

Issue Links:

#10255 Spel parser is not able to resolve bean id variable when it is passed as parameter to a static method. ("is duplicated by")

Referenced from: commits 33a7bbb

Issue 2:
Jason Zaugg opened SPR-4686 and commented

@Component

public final class SimpleXslTransformerFactory {

@Autowired

private StreamSourceFactory streamSourceFactory;

@Autowired

private EfgLoggerFactory loggerFactory;

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));
}
}

}

When evaluating ClassMetadataReadingVisitor.isIndependent(),

this.enclosingClassName: com.efgfp.raptor.functional.SimpleXslTransformerFactory

this.independentInnerClass: false

therefore (this.enclosingClassName == null || this.independentInnerClass) => false

The list of candidate resources contained, in this order:

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],

URL [jar:file:/D:/wyd/workspace/raptor/target/exploded/raptor-web-interfaceWeb/WEB-INF/lib/functional-test.jar!/com/efgfp/raptor/functional/SimpleXslTransformerFactory.class],

Debugging the calls to the ClassMetadataReadingVisitor showed that a call was made:

visitInnerClass():72, ClassMetadataReadingVisitor.java
accept():-1
accept():-1
getAnnotationMetadata():52, SimpleMetadataReader.java

name = {java.lang.String@5861}"com/efgfp/raptor/functional/SimpleXslTransformerFactory$LoggingErrorListener"

outerName = {java.lang.String@3079}"com/efgfp/raptor/functional/SimpleXslTransformerFactory"

innerName = {java.lang.String@5862}"LoggingErrorListener"

access = 4101

and that during this call, independentInnerClass was set to null.

Affects: 2.5.1

Issue Links:

#9003 component scanning incorrectly excludes classes ("duplicates")