AspectJ Load time weaver doesn't detect all classes

前端 未结 3 1293
梦谈多话
梦谈多话 2021-02-07 16:07

I am using Spring\'s declarative transactions (the @Transactional annotation) in \"aspectj\" mode. It works in most cases exactly like it should, but for one it doesn\'t. We can

3条回答
  •  我在风中等你
    2021-02-07 16:36

    Option 1) Aspect J is open source. Crack it open and see what is going on.

    Option 2) Rename your class to Bang, see if it starts working

    I would not be surprised if there is hard coding to skip "lang' in there, though I can't say why.

    Edit -

    Seeing code like this in the source

            if (superclassnameIndex > 0) { // May be zero -> class is java.lang.Object
                superclassname = cpool.getConstantString(superclassnameIndex, Constants.CONSTANT_Class);
                superclassname = Utility.compactClassName(superclassname, false);
    
    } else {
                superclassname = "java.lang.Object";
            }
    

    Looks like they are trying to skip weaving of java.lang.stuff.... don't see anything for just "lang" but it may be there (or a bug)

提交回复
热议问题