[Design the new POJO MicroContainer] - Re: NPE with new parsing in aop-mc-int tests
by alesj
"adrian(a)jboss.org" wrote :
| What does JBossXB have to do with the following code?
|
| | KernelDeployment dep = new AbstractKernelDeployment("test");
| | dep.setBeans(Arrays.asList((BeanMetaDataFactory) null));
| |
| which produces the same error.
Good point. :-)
I'll fix/handle this together with this:
"adrian(a)jboss.org" wrote :
| "adrian(a)jboss.org" wrote :
| | | Then in the part where the deployment/bean are checked for classloader
| | | AbstractKernelDeployer::deploybean()
| |
|
| While I am on this subject.
|
| I originally put all the deployment defaults in this method, but other
| defaults have been added in the AbstractKernelDeployment::getBeans().
|
| I think the AbstractKernelDeployment is the correct place for this code,
| so we should look at moving all the logic that is AbstractKernelDeployer::deployBean()
| into there.
|
| Especially since the AbstractKernelDeployer is not always used,
| e.g. the BeanMetaDeployer in the deployers project.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140499#4140499
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140499
18 years
[Design the new POJO MicroContainer] - Re: AOPConstructorJoinpoint::methodHasAnnotations is wrong
by alesj
"alesj" wrote :
| Looking at Kabir's comment on recent change:
| anonymous wrote :
| | [JBMICROCONT-250] When checking component metadata for a method, only return that we have joinpoint annotations if they exist at instance level or below.
| |
| Looks like a case of wrong impl or wrong conclusion on how MetaData.getScopeMetaData(ScopeLevel) works.
|
| Should we really always check for all levels below and including INSTANCE?
|
I've added this hierarchy check:
| private boolean checkForMetaDataAtSubInstanceLevel(MetaData metaData)
| {
| if (metaData != null)
| {
| List<ScopeLevel> levels = CommonLevelsUtil.getSubLevels(CommonLevels.INSTANCE);
| for (ScopeLevel level : levels)
| {
| boolean hasMetaData = hasMetaDataAtLevel(metaData, level);
| if (hasMetaData)
| return true;
| }
| }
| return false;
| }
|
And I'm ignoring any annotations that are marked with InstanceAnnotation(false):
| protected boolean hasMetaDataAtLevel(MetaData metaData, ScopeLevel level)
| {
| MetaData levelMetaData = metaData.getScopeMetaData(level);
| if (levelMetaData != null && levelMetaData.isEmpty() == false)
| {
| Set<Object> checkSet = new HashSet<Object>();
| Object[] allMetaData = levelMetaData.getMetaData();
| Annotation[] annotations = levelMetaData.getAnnotations();
| // all meta data is not null, since instance metadata is not empty
| checkSet.addAll(Arrays.asList(allMetaData));
| checkSet.removeAll(Arrays.asList(annotations));
|
| // do we have something else than annotations
| if (checkSet.isEmpty() == false)
| return true;
| else
| {
| // do we have an annotation that's not marked with IA
| for (Annotation annotation : annotations)
| {
| InstanceAnnotation ia = annotation.annotationType().getAnnotation(InstanceAnnotation.class);
| if (ia == null || ia.value())
| return true;
| }
| }
| }
| return false;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140480#4140480
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140480
18 years