Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6903

try catch cause a NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.0-beta-2
    • None
    • None
    • jdk 1.7
      groovy 2.4.0-beta1
      android sdk 19

    Description

      There will be a strange exception occured when I use groovy like the following.

      07-01 23:26:08.853    7351-7371/com.githang.android.tucao.android E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-23837
          java.lang.NullPointerException
                  at groovy.lang.MetaClassImpl.getProperties(MetaClassImpl.java:1959)
                  at org.codehaus.groovy.runtime.MethodRankHelper.getPropertySuggestionString(MethodRankHelper.java:175)
                  at groovy.lang.MissingPropertyException.getMessageWithoutLocationText(MissingPropertyException.java:66)
                  at groovy.lang.GroovyRuntimeException.getMessage(GroovyRuntimeException.java:62)
                  at java.lang.Throwable.getLocalizedMessage(Throwable.java:187)
                  at java.lang.Throwable.toString(Throwable.java:361)
                  at java.lang.Throwable.printStackTrace(Throwable.java:321)
                  at java.lang.Throwable.printStackTrace(Throwable.java:288)
                  at java.lang.Throwable.printStackTrace(Throwable.java:236)
                  at com.githang.android.crash.CrashHttpReport.sendReport(CrashHttpReport.java:92)
                  at com.githang.android.crash.AbstractCrashReportHandler$1.run(AbstractCrashReportHandler.java:70)
                  at java.lang.Thread.run(Thread.java:838)
      07-01 23:26:08.984    7351-7351/com.githang.android.tucao.android D/GraphicBuffer﹕ create handle(0x5fb7de28) (w:720, h:1280, f:1)
      07-01 23:26:08.993    7351-7351/com.githang.android.tucao.android D/GraphicBuffer﹕ close handle(0x5fb7de28) (w:720 h:1280 f:1)
      07-01 23:26:09.002    7351-7351/com.githang.android.tucao.android D/GraphicBuffer﹕ create handle(0x5fb7de28) (w:720, h:1280, f:1)
      

      At first , I thought it was my open source project(andriod-crash:https://github.com/msdx/android-crash) error, but the line that the log print was like the following:

      91:        } catch (Exception e) {
      92:            e.printStackTrace();
      93:        }
      

      How could the line of code is wrong?

      And I use the project in my another project write by Java, it works, and no any exception.

      Attachments

        Activity

          People

            melix Cédric Champeau
            msdx Haohang Huang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: