Skip to content

JoinPoint and Singature toString, toShortString, and toLongString don't return useful information [SPR-5437] #10111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jan 27, 2009 · 1 comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Ramnivas Laddad opened SPR-5437 and commented

Furthermore, the method output doesn't match what AspectJ weaving produces making it difficult to migrate from/to Spring AOP and AspectJ weaving.

For example, here is what the current implementation of Spring AOP returns for these methods:

  • JoinPoint.getSignature().toString() -- org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint$MethodSignatureImpl@1c737be
  • JoinPoint.toString() -- org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint: execution(find)
  • JoinPoint.getSignature().toShortString() -- find
  • JoinPoint.toShortString() -- execution(find)
  • JoinPoint.getSignature().toLongString() -- public abstract java.lang.Object com.myco.util.GenericRepository.find(java.lang.Long)
  • JoinPoint.toLongString() -- org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint: execution:
    [ReflectiveMethodInvocation: public abstract java.lang.Object com.mycoutil.GenericRepository.find(java.lang.Long); target is of class [com.myco.repository.impl.JpaProductRepository]]

Basically, toString methods don't provide much useful information, short versions provide too little, and long versions provide too much :-) and not consistent in their output. As a result, these methods are not very useful for tracing, performance monitoring etc.


Referenced from: commits c8d6c15

@spring-projects-issues
Copy link
Collaborator Author

Ramnivas Laddad commented

Now the output matches that produced by the AspectJ weaver. Tests added to ensure that the two remain consistent.

@spring-projects-issues spring-projects-issues added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 M2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant