Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
None
-
None
-
None
-
None
-
Linux 2.6.9-78.0.0.0.1.ELsmp #1 SMP Fri Jul 25 14:41:56 EDT 2008 i686 i686 i386 GNU/Linux
Description
Sdklib.groovy :
package odilib
public class Sdklib extends Framework {
def test() {
throw new ObjectAlreadyExists ('some text')
}
}
public class ObjectAlreadyExists extends Exception {}
=========================================
my_script.groovy :
import odilib.*
def x = new Sdklib ()
try
catch (ObjectAlreadyExists e) {}
Run as :
groovy my_script.groovy
Error :
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, my_script.groovy: xx: unable to resolve class ObjectAlreadyExists
@ line xx, column 5.
} catch (ObjectAlreadyExists e) {
^
1 error
As you could see, Sdklib.groovy has 2 classes that belong to package odilib, the second one defines exception.
From the outside script the first class named after the script Sdklib is visible, but not the second one corresponding to the exception.
Attachments
Issue Links
- is related to
-
GROOVY-1328 cleanup strategy of choosing the class to execute when a file contains multiple classes
- Closed