You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2018/09/03 22:04:00 UTC

[jira] [Commented] (GROOVY-8772) Groovy debugger is on the wrong line when exiting a try/catch

    [ https://issues.apache.org/jira/browse/GROOVY-8772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16602457#comment-16602457 ] 

Paul King commented on GROOVY-8772:
-----------------------------------

This could be a known problem. It might be worth trying a Groovy 3 snapshot to see if that fixes the problem - that will give us a bit more info. Also, just to clarify, you aren't using @CompileStatic or indy compilation/jars?

> Groovy debugger is on the wrong line when exiting a try/catch
> -------------------------------------------------------------
>
>                 Key: GROOVY-8772
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8772
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.0
>            Reporter: David Pociu
>            Priority: Major
>         Attachments: image.png, image1.png, image2.png
>
>
> Complete report also filed with IntelliJ Idea at [https://youtrack.jetbrains.com/issue/IDEA-198280]
> In the following code snippet:
> ----
>  
> {code:java}
> package aaa
> package aaa
> /**
> * Created by D. Pociu - InsiTech on 9/3/2018.
> */
> class Main1 {
> static void main(String[] args){
>    println "Hello"
>    try{
>       int a = 123;
>    } catch (Exception ex){
>       String s = ex.getMessage()
>       println s
>    }
>    println "what just happened?"
> }
> }{code}
>  
> ----
> If we set a debug point at the 'println "Hello" line and go inside the try/catch using the debugger, the next line after 'int a = 123' that the debugger stops on should be 'println "what just happened?"' , but instead is 'println s'.
> So the debugger jumps to the last line of the catch (visually, not any of the variables, or anything) , when visually it should be at the first line after the catch if no exception has been thrown.
> This creates GREAT confusion when I'm trying to debug complex classes because it gives the impression that the catch clause has been triggered when it has not.
>  See attached screenshots of the step by step:
> ----
> Here's what the guys at Jetbrains had to say (see link above also):
>   
>  _Peter Gromov  commented 6 hours ago_
>  _Yes. The same problem is reproducible in Eclipse, so [David P.|https://youtrack.jetbrains.com/users/dpociu] could you please report the issue to Groovy compiler team? See [http://groovy-lang.org/reporting-issues.html]_
>   __ 
>  _Egor Ushakov  commented 7 hours ago_
>  _[Peter Gromov|https://youtrack.jetbrains.com/users/peter] it seems that groovy compiler does not generate line info for the location right after the try block (but stops there in debugger)._
>   
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)