This java package was not used directly in the pod being compiled, it was used in one of the dependencies, but it was not available on classpath when the current pod was compiled.
brianWed 21 Apr 2010
can you post a snippet of the test code that caused that exception so we can get it into the test suite?
alex_panchenkoWed 21 Apr 2010
The issue can be reproduced by performing the following steps:
compile this class to JAR
package com.xored.topic1079;
public class JA {
public int execute() {
return 1;
}
}
remove this check -o ! -d "$FAN_CP" in fanlaunch as it doesn't allow complex classpaths
alex_panchenko Tue 20 Apr 2010
diff -r ecb44c5ba4f6 src/compiler/fan/steps/ResolveImports.fan --- a/src/compiler/fan/steps/ResolveImports.fan Mon Apr 19 19:35:42 2010 -0400 +++ b/src/compiler/fan/steps/ResolveImports.fan Tue Apr 20 11:15:13 2010 +0700 @@ -52,7 +52,14 @@ // process each unit for CompilationUnit.importedTypes units.each |CompilationUnit unit| { - resolveImportedTypes(unit) + try { + resolveImportedTypes(unit) + } + catch (CompilerErr e) + { + errReport(e) + return + } } bombIfErrAs I've experienced the following error which was not reported:
This java package was not used directly in the pod being compiled, it was used in one of the dependencies, but it was not available on classpath when the current pod was compiled.
brian Wed 21 Apr 2010
can you post a snippet of the test code that caused that exception so we can get it into the test suite?
alex_panchenko Wed 21 Apr 2010
The issue can be reproduced by performing the following steps:
package com.xored.topic1079; public class JA { public int execute() { return 1; } }-o ! -d "$FAN_CP"infanlaunchas it doesn't allow complex classpathsexport FAN_CP=your-fan-home/lib/java/sys.jar:path-to-my.jarusing [java] com.xored.topic1079 class Topic1079 : JA { Void main(Str[] args) { echo(execute()) } }unset FAN_CPusing Topic1079A class Topic1079B { Void main(Str[] args) { Topic1079().main(args); echo("OK") } }Without the patch the output is:
compile [Topic1079B] Compile [Topic1079B] FindSourceFiles [1 files] BUILD FAILED [760ms]!After patch the output is better:
compile [Topic1079B] Compile [Topic1079B] FindSourceFiles [1 files] null: Java package 'com.xored.topic1079' not found BUILD FAILED [561ms]!brian Thu 22 Apr 2010
Promoted to ticket #1079 and assigned to brian
Patch seems simple and safe, but I'd like to read thru that code and just verify.
Things are a bit crazy until first week of May, but then I should have time to go thru ticket list and do another official build.
brian Thu 6 May 2010
Ticket resolved in 1.0.53
Take a look at this changeset
I wrapped both resolveImports and resolveImportedTypes just in case to report an error.