Uploaded image for project: 'XBean'
  1. XBean
  2. XBEAN-318

xbean-finder should log the class name on errors

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.13
    • 4.14
    • None
    • None

    Description

      xbean-finder sometimes fails parsing classes but does not always log the name of the class, making it difficult to identify issues.

       

      For instance

      Caused by: java.lang.UnsupportedOperationException
      at org.apache.xbean.asm6.ClassVisitor.visitNestHostExperimental(ClassVisitor.java:158)
      at org.apache.xbean.asm6.ClassReader.accept(ClassReader.java:541)
      at org.apache.xbean.asm6.ClassReader.accept(ClassReader.java:391)
      at org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinder.java:1168)
      at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:145)
      at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:158)

      The annotation finder only catches NoClassDefFound

      https://github.com/apache/geronimo-xbean/blob/xbean-4.9/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java#L146

       

      So either we catch all exceptions we are interested in, or we collect a bit wider (Exception) and log a proper message. I'd probably go for the second as first it's simpler and second, whatever exception happens, it's always useful to know what class we were processing when it failed.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jlmonteiro Jean-Louis Monteiro
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: