Compiler errors when using multiple modules

I often get compiler errors when using multiple modules because one or another required library is not available to the module. For example, my main module has a test case that subclasses another test case class in a different module. That other module has jUnit attached to it, and so the base class test case compiles fine and appears in Idea with no red error lines. However, my main module test case does not compile. I get an errror indicating that the class junit.framework.TestCase is not found because that library is not included in my main module. However, in Idea, there are no red lines indicating the problem, and so this type of error is more difficult to debug. Are there any plans to address this problem?

Basically, I've gotten used to red lines always being there if there's going to be a compiler error, and in this situation that assumption fails and confuses me. :)

4 comments

It is always weird when IDEA does not highlight something but it won't compile. When this happens I am just sort of confused because I almost never have to look at the compilation output.

I had a problem recently where code wouldn't compile but IDEA did not highlight it. I didn't think to report it at the time. I think it had to do with inner class scoping, but I can't remember what it was well enough to reproduce it. It was definitely with a recent build, I think with 957. Has anyone else seen this? I can't find anything in the tracker.

0

Did I understand you correctly that your case is like this:

In Module A (module A has Junit in its libraries):

public class ClassA extends TestCase{}

In Module B (module B does not have Junit in its libraries):

public ClassB extends ClassA{}

?

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"


"Kirk Woll" <kirk@digimax.com> wrote in message
news:994176.1067993759601.JavaMail.itn@is.intellij.net...

I often get compiler errors when using multiple modules because one or

another required library is not available to the module. For example, my
main module has a test case that subclasses another test case class in a
different module. That other module has jUnit attached to it, and so the
base class test case compiles fine and appears in Idea with no red error
lines. However, my main module test case does not compile. I get an
errror indicating that the class junit.framework.TestCase is not found
because that library is not included in my main module. However, in Idea,
there are no red lines indicating the problem, and so this type of error is
more difficult to debug. Are there any plans to address this problem?
>

Basically, I've gotten used to red lines always being there if there's

going to be a compiler error, and in this situation that assumption fails
and confuses me. :)


0

In 957, you could get a "No red line but can't compile" situation if a class in a module's sourcepath referred to a class in that same module's testpath. Clearly a pathological case, but it was only caught by the off-line compiler, not the on-line syntax checker.

0

This is exactly the case for me.

0

Please sign in to leave a comment.