jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
GRECLIPSE
  • GRECLIPSE
  • GRECLIPSE-926 Import statement added above package ...
  • GRECLIPSE-949

Recognize ModuleNode.encounteredUnrecoverableError

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.1.1Release
  • Fix Version/s: 2.6.1.M1
  • Component/s: Parser
  • Labels:
    None
  • Number of attachments :
    1

Description

The following code snippet should have ModuleNode.encounteredUnrecoverableError set to true.

package com.foo

import javax.swing.text.html.HTML


   void nuthin() {
		 if (! (this instanceof HTMLAccessibleContext/*_*/) {
            
         }
    }
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    recognizer.patch
    09/Feb/11 3:52 PM
    0.9 kB
    Andy Clement

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Andy Clement added a comment - 19/Jan/11 1:01 PM

I just created testUnrecoverableErrors_GRE949 in GroovySimpleTest with the code above and the module node returns true for encounteredUnrecoverableError() - is that snippet right (i.e. it has no class decl)?

Show
Andy Clement added a comment - 19/Jan/11 1:01 PM I just created testUnrecoverableErrors_GRE949 in GroovySimpleTest with the code above and the module node returns true for encounteredUnrecoverableError() - is that snippet right (i.e. it has no class decl)?
Hide
Permalink
Andrew Eisenberg added a comment - 08/Feb/11 10:27 PM

This is odd because when asked during a content assist invocation, encounteredUnrecoverableError() is set to false for the above snippet. Perhaps we can have a look at this tomorrow.

Show
Andrew Eisenberg added a comment - 08/Feb/11 10:27 PM This is odd because when asked during a content assist invocation, encounteredUnrecoverableError() is set to false for the above snippet. Perhaps we can have a look at this tomorrow.
Hide
Permalink
Andrew Eisenberg added a comment - 09/Feb/11 1:31 PM

Committed failing test case in project org.codehaus.groovy.eclipse.core.tests class org.codehaus.groovy.eclipse.core.compiler.UnrecoverableErrorTests.

Show
Andrew Eisenberg added a comment - 09/Feb/11 1:31 PM Committed failing test case in project org.codehaus.groovy.eclipse.core.tests class org.codehaus.groovy.eclipse.core.compiler.UnrecoverableErrorTests.
Hide
Permalink
Andy Clement added a comment - 09/Feb/11 2:24 PM

Ok, your test is failing for me. On examination I am not sure you could call it an unrecoverable error... because it recovered. I'll agree it isn't pretty but code was produced for some parts of the source.

Show
Andy Clement added a comment - 09/Feb/11 2:24 PM Ok, your test is failing for me. On examination I am not sure you could call it an unrecoverable error... because it recovered. I'll agree it isn't pretty but code was produced for some parts of the source.
Hide
Permalink
Andrew Eisenberg added a comment - 09/Feb/11 2:54 PM

But, there is no package declaration or any import statements. These are the things that Groovy-Eclipse uses to orient itself with respect to add/organize imports.

Show
Andrew Eisenberg added a comment - 09/Feb/11 2:54 PM But, there is no package declaration or any import statements. These are the things that Groovy-Eclipse uses to orient itself with respect to add/organize imports.
Hide
Permalink
Andy Clement added a comment - 09/Feb/11 3:52 PM

Here is a patch for GroovyRecognizer - it is handcoded recovery that will need working into the grammar if we want to go ahead with it. Please apply it and play around to see what happens. You may find on an error there are cascading secondary problems now because it won't immediately give up, it will try to continue (but it may be confused about where it has gotten to). This is causing problems for a few of the tests that pass in broken code and expect particular output.

Show
Andy Clement added a comment - 09/Feb/11 3:52 PM Here is a patch for GroovyRecognizer - it is handcoded recovery that will need working into the grammar if we want to go ahead with it. Please apply it and play around to see what happens. You may find on an error there are cascading secondary problems now because it won't immediately give up, it will try to continue (but it may be confused about where it has gotten to). This is causing problems for a few of the tests that pass in broken code and expect particular output.
Hide
Permalink
Andrew Eisenberg added a comment - 29/Sep/11 4:24 PM

Try to get this for 2.6.0.

Show
Andrew Eisenberg added a comment - 29/Sep/11 4:24 PM Try to get this for 2.6.0.
Hide
Permalink
Andrew Eisenberg added a comment - 18/Oct/11 3:13 PM

Revisiting this. I applied the patch and I am playing with the broken code in the description.

The goal is for organize imports to not remove everything if some kind of error has occurred and method bodies are empty. However, this patch does not do this.

After applying the patch, the nuthin method does exist in the module node, but it is an empty method with no statements. And hence invoking organize imports will remove the import statement.

Still some work to do.

Show
Andrew Eisenberg added a comment - 18/Oct/11 3:13 PM Revisiting this. I applied the patch and I am playing with the broken code in the description. The goal is for organize imports to not remove everything if some kind of error has occurred and method bodies are empty. However, this patch does not do this. After applying the patch, the nuthin method does exist in the module node, but it is an empty method with no statements. And hence invoking organize imports will remove the import statement. Still some work to do.
Hide
Permalink
Andrew Eisenberg added a comment - 02/Nov/11 11:59 AM

Now working. Fix was picked up with all the other fixes to parser recovery for 2.6.0. Including a regression test.

Show
Andrew Eisenberg added a comment - 02/Nov/11 11:59 AM Now working. Fix was picked up with all the other fixes to parser recovery for 2.6.0. Including a regression test.

People

  • Assignee:
    Andrew Eisenberg
    Reporter:
    Andrew Eisenberg
Vote (0)
Watch (0)

Dates

  • Created:
    31/Dec/10 2:00 PM
    Updated:
    18/Jan/12 11:47 AM
    Resolved:
    02/Nov/11 11:59 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.