[Design the new POJO MicroContainer] - Re: MC upgrade breaks scoped aop tests in trunk
by kabir.khan@jboss.com
"adrian(a)jboss.org" wrote :
| I think this is the real change isn't it? It would depend upon how you
| created/deployed the GBF's metadata. How old is the previous code I showed?
|
The AbstractAopMetaDataDeployer code is current trunk and has been there for some months
"adrian(a)jboss.org" wrote :
| This is the code from 7 months ago before recent changes.
| You can see it looks at the context first
| http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontaine...
|
Actually, GBF.classLoader is what is used if present. Not the context:
| public Object createBean() throws Throwable
| {
| ClassLoader cl = null;
| if (classLoader == null && context != null)
| {
| try
| {
| cl = context.getClassLoader();
| }
| catch (Throwable t)
| {
| log.trace("Unable to retrieve classloader from " + context);
| }
| }
|
| if (cl == null)
| cl = Configurator.getClassLoader(classLoader);
|
"adrian(a)jboss.org" wrote :
| But actually looking at the logic behind all this, I don't see why we need to look
| at the context for classloader since the next step is to ask the
| ClassLoaderMetaData anyway (or use the TCL absent that).
|
|
| | private Object createBean(ClassLoader cl) throws Throwable
| | {
| | ClassLoader loader = cl;
| | if (loader == null)
| | loader = Configurator.getClassLoader(classLoader);
| |
|
| For everybody else, this will be same as asking the controller context
| since the "classLoader" above is the same ClassLoaderMetaData.
| But for you who wants to change the logic, it will do something different.
So what do you suggest? Putting things back to more like the way they were? I've got an idea for a test that I can add to aop-mc-int that can help test for future regressions once this is working again.
"adrian(a)jboss.org" wrote :
| Duplicating code just means it won't get fixed the next time somebody finds a bug
| or adds a new feature.
|
True, I was just trying to find a way out of my Friday surprise mess :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193045#4193045
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193045
16 years, 1 month