Possible debugger bug.. [message #85186] |
Wed, 13 August 2003 01:14  |
Eclipse User |
|
|
|
Originally posted by: pawel7.astercity.net
Try this on Eclipse 2.1.1 :
(I tried on two computers with jdk 1.4.1 and 1.3.1 but it doesn't matter
anyway since this is very likely to be eclipse bug if it's one actually)
We got two .java files (compilation units) in one package.
First A contains usual public class A with main method with th name of the
file.
Second file B contains a non-public (package friendly) class Bx with the
name that is not the name of the file.
When you try to access the Bx class from A - the real-time debugger shows a
lightbulb on the left with "cannot resolve".
There's no task to fix on the tasklist and the project actually compiles and
runs well.
When you use a bit different source with the second file containing two
classes, one
with the name of the file B and another, Bx. The same lightbulb error shows,
but stuff compiles.
If you want to fix it (for the lightbulb to vanish) you gotta somehow (by a
class field or a constructor) access the class
that has the name of compilation unit (B) before the one with another (Bx).
Theoretically this is not breaking the package rules, should compile and
compiles. Why the prompt ?
here's an example:
// File A.java
package pack1.pack2;
public class A {
//B b;
public static void main(String[] args) {
Bx bx = new Bx();
}
}
// File B.java
package pack1.pack2;
class Bx {
Bx(){
System.out.println("that's me, bx");
}
}
//class B {}
What do you think? Is this a bug or am I wrong with some settings..
Greets
Pavel
|
|
|
Re: Possible debugger bug.. [message #89522 is a reply to message #85186] |
Wed, 27 August 2003 06:02  |
Eclipse User |
|
|
|
You should avoid refering to non-public classes outside the compilation
unit.
See
http://java.sun.com/docs/books/jls/second_edition/html/packa ges.doc.html#267
83
Jerome
"Pavel" <pawel7@astercity.net> wrote in message
news:bhchd8$pq9$1@eclipse.org...
> Try this on Eclipse 2.1.1 :
> (I tried on two computers with jdk 1.4.1 and 1.3.1 but it doesn't matter
> anyway since this is very likely to be eclipse bug if it's one actually)
>
> We got two .java files (compilation units) in one package.
> First A contains usual public class A with main method with th name of the
> file.
> Second file B contains a non-public (package friendly) class Bx with the
> name that is not the name of the file.
> When you try to access the Bx class from A - the real-time debugger shows
a
> lightbulb on the left with "cannot resolve".
> There's no task to fix on the tasklist and the project actually compiles
and
> runs well.
>
> When you use a bit different source with the second file containing two
> classes, one
> with the name of the file B and another, Bx. The same lightbulb error
shows,
> but stuff compiles.
> If you want to fix it (for the lightbulb to vanish) you gotta somehow (by
a
> class field or a constructor) access the class
> that has the name of compilation unit (B) before the one with another
(Bx).
> Theoretically this is not breaking the package rules, should compile and
> compiles. Why the prompt ?
>
> here's an example:
>
> // File A.java
> package pack1.pack2;
> public class A {
> //B b;
> public static void main(String[] args) {
> Bx bx = new Bx();
> }
> }
>
> // File B.java
> package pack1.pack2;
> class Bx {
> Bx(){
> System.out.println("that's me, bx");
> }
> }
> //class B {}
>
> What do you think? Is this a bug or am I wrong with some settings..
> Greets
> Pavel
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05412 seconds