Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Is it a bug? Help me please
Is it a bug? Help me please [message #60084] Wed, 18 June 2003 04:44 Go to next message
Eclipse UserFriend
Hello, I've a little problem using Eclipse. If i create 2 file like these
inside a package named "ptest":

File1:
------------------
package ptest;

class Myclass1 {
public int testInt = 5;
}

class Myclass2 {
public String testString = "Hi";
}
----------------------------------------

FileMain:
------------------
package ptest;

public class FileMain {
public static void main(String[] args) {
Myclass2 a = new Myclass2(); // Here Eclipse underlines Myclass2
System.out.println(a.testString);
}
}
----------------------------------------

Eclipse compiles correctly (the program runs), but underlines in red
"Myclass2" FileMain.
The code is perfectly legal since the first classes (Myclass1 and Myclass2)
have package visibility and if i use for example JBuilder, it works
correctly and doesn't underline nothing. The result is that i cannot work
with Eclipse, since in my program i've a lot of classes (around 600) and i
grouped some of them by functionality in various files, but Eclipse doesn't
recognize the type of the variables i declared and all the advanced features
don't work.
Is this a bug? Is there some workaround for this?
Thank you for your answers.

Bitblaster
Re: Is it a bug? Help me please [message #60183 is a reply to message #60084] Wed, 18 June 2003 07:37 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0238_01C335A7.21A0C220
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: quoted-printable

Hi=20

I've reproduced your situation on Eclipse 2.1 (200303272130) and the =
line is really marked as error.

Funny thing is that the file FileMain isn't marked as "errorneus" in the =
package explorer, the file gets compiled (I have a .class file) and even =
I was able to run it.=20

I tryed to compile the same source outside of eclipse and it compiled =
fine with JDK 1.3+

however compilation with JDK 1.2.2 and 1.1.8 failed with:

FileMain.java:20: class ptest.Myclass2 is defined in Myclass1.java. =
Because it is used outside of its source file, it should be defined in a =
file called "Myclass2.java".
System.out.println(a.testString);

The default setting for eclispe is to maintain the .class files JDK 1.1 =
compatible. Unfortunately setting the compatibility level to 1.4 shows =
no effect - the line is still makred as error - so this looks like an =
eclipse bug.

Best regards=20

Vasil


"Bitblaster" <bitblasters@yahoo.it> wrote in message =
news:bcp8p7$5eu$1@rogue.oti.com...
> Hello, I've a little problem using Eclipse. If i create 2 file like =
these
> inside a package named "ptest":
>=20
> File1:
> ------------------
> package ptest;
>=20
> class Myclass1 {
> public int testInt =3D 5;
> }
>=20
> class Myclass2 {
> public String testString =3D "Hi";
> }
> ----------------------------------------
>=20
> FileMain:
> ------------------
> package ptest;
>=20
> public class FileMain {
> public static void main(String[] args) {
> Myclass2 a =3D new Myclass2(); // Here Eclipse underlines =
Myclass2
> System.out.println(a.testString);
> }
> }
> ----------------------------------------
>=20
> Eclipse compiles correctly (the program runs), but underlines in red
> "Myclass2" FileMain.
> The code is perfectly legal since the first classes (Myclass1 and =
Myclass2)
> have package visibility and if i use for example JBuilder, it works
> correctly and doesn't underline nothing. The result is that i cannot =
work
> with Eclipse, since in my program i've a lot of classes (around 600) =
and i
> grouped some of them by functionality in various files, but Eclipse =
doesn't
> recognize the type of the variables i declared and all the advanced =
features
> don't work.
> Is this a bug? Is there some workaround for this?
> Thank you for your answers.
>=20
> Bitblaster
>=20
>
------=_NextPart_000_0238_01C335A7.21A0C220
Content-Type: text/html;
charset="windows-1251"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1251">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0 background=3D"">
<DIV>Hi </DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>I've reproduced your situation on Eclipse 2.1 (200303272130) and =
the line=20
is&nbsp;really marked as error.</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D3>Funny thing is that the =
file&nbsp;FileMain isn't=20
marked as "errorneus" in the package explorer,&nbsp;the file&nbsp;gets =
compiled=20
(I have a .class file) and even I was able to run it. =
</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D3>I tryed to compile the same source =
outside of=20
eclipse and it compiled fine&nbsp;with JDK 1.3+</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D3></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D3>however compilation with JDK 1.2.2 =
and 1.1.8=20
failed with:</FONT></DIV>
<DIV><BR>FileMain.java:20: class ptest.Myclass2 is defined in =
Myclass1.java.=20
Because it is used outside of its source file, it should be defined in a =
file=20
called=20
"Myclass2.java".<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
System.out.println(a.testString);</DIV>
<DIV><BR><FONT size=3D3>The default setting for eclispe is to maintain =
the .class=20
files JDK 1.1 compatible. Unfortunately setting the compatibility level=20
to&nbsp;1.4 shows no effect - the line is still makred as error - so =
this looks=20
like an eclipse bug.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D3>Best regards </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D3>Vasil</FONT></DIV>
<DIV><BR><BR>"Bitblaster" &lt;bitblasters@yahoo.it&gt; wrote in message=20
news:bcp8p7$5eu$1@rogue.oti.com...<BR>&gt; Hello, I've a little problem =
using=20
Eclipse. If i create 2 file like these<BR>&gt; inside a package named=20
"ptest":<BR>&gt; <BR>&gt; File1:<BR>&gt; ------------------<BR>&gt; =
package=20
ptest;<BR>&gt; <BR>&gt; class Myclass1 {<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
public=20
int testInt =3D 5;<BR>&gt; }<BR>&gt; <BR>&gt; class Myclass2=20
{<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; public String testString =3D =
"Hi";<BR>&gt;=20
}<BR>&gt; ----------------------------------------<BR>&gt; <BR>&gt;=20
FileMain:<BR>&gt; ------------------<BR>&gt; package ptest;<BR>&gt; =
<BR>&gt;=20
public class FileMain {<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; public static =
void=20
main(String[] args) =
{<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;=20
Myclass2 a =3D new Myclass2();&nbsp; // Here Eclipse underlines=20
Myclass2<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;=20
System.out.println(a.testString);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
}<BR>&gt;=20
}<BR>&gt; ----------------------------------------<BR>&gt; <BR>&gt; =
Eclipse=20
compiles correctly (the program runs), but underlines in red<BR>&gt; =
"Myclass2"=20
FileMain.<BR>&gt; The code is perfectly legal since the first classes =
(Myclass1=20
and Myclass2)<BR>&gt; have package visibility and if i use for example =
JBuilder,=20
it works<BR>&gt; correctly and doesn't underline nothing. The result is =
that i=20
cannot work<BR>&gt; with Eclipse, since in my program i've a lot of =
classes=20
(around 600) and i<BR>&gt; grouped some of them by functionality in =
various=20
files, but Eclipse doesn't<BR>&gt; recognize the type of the variables i =

declared and all the advanced features<BR>&gt; don't work.<BR>&gt; Is =
this a=20
bug? Is there some workaround for this?<BR>&gt; Thank you for your=20
answers.<BR>&gt; <BR>&gt; Bitblaster<BR>&gt; <BR>&gt;=20
</FONT></DIV></BODY></HTML>

------=_NextPart_000_0238_01C335A7.21A0C220--
Re: Is it a bug? Help me please [message #60207 is a reply to message #60084] Wed, 18 June 2003 07:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Olivier_Thomann.ca.ibm.comNOSPAM

On Wed, 18 Jun 2003 10:44:22 +0200, "Bitblaster"
<bitblasters@yahoo.it> wrote:
>File1:
>------------------
>package ptest;
>
>class Myclass1 {
> public int testInt = 5;
>}
>
>class Myclass2 {
> public String testString = "Hi";
>}
Define each class in its own file. Then it will work fine.
If you do a full build, it should work as well. The problem is to
retrieve secondary types. This is under investigation for 3.0.
--
Olivier
Re: Is it a bug? Help me please [message #60229 is a reply to message #60207] Wed, 18 June 2003 07:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Olivier_Thomann.ca.ibm.comNOSPAM

On Wed, 18 Jun 2003 07:41:45 -0400, Olivier Thomann
<Olivier_Thomann@ca.ibm.comNOSPAM> wrote:
>Define each class in its own file. Then it will work fine.
>If you do a full build, it should work as well. The problem is to
>retrieve secondary types. This is under investigation for 3.0.
I forgot to mention that each file should have the class name.
--
Olivier
Re: Is it a bug? Help me please [message #60535 is a reply to message #60183] Wed, 18 June 2003 10:00 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0015_01C335B2.B93D02A0
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: quoted-printable

Ok, thank you very much for your time, i'll wait for the next version of =
Eclipse, but it looks strange to me that i'm the only who asked for this =
bug (i installed Eclipse for the first time only 2 days ago).
Bye!

Bit
"Vasil Panushev" <v_panushev@prosyst.bg> ha scritto nel messaggio =
news:bcpitm$epo$1@rogue.oti.com...
Hi=20

I've reproduced your situation on Eclipse 2.1 (200303272130) and the =
line is really marked as error.

Funny thing is that the file FileMain isn't marked as "errorneus" in =
the package explorer, the file gets compiled (I have a .class file) and =
even I was able to run it.=20

I tryed to compile the same source outside of eclipse and it compiled =
fine with JDK 1.3+

however compilation with JDK 1.2.2 and 1.1.8 failed with:

FileMain.java:20: class ptest.Myclass2 is defined in Myclass1.java. =
Because it is used outside of its source file, it should be defined in a =
file called "Myclass2.java".
System.out.println(a.testString);

The default setting for eclispe is to maintain the .class files JDK =
1.1 compatible. Unfortunately setting the compatibility level to 1.4 =
shows no effect - the line is still makred as error - so this looks like =
an eclipse bug.

Best regards=20

Vasil


"Bitblaster" <bitblasters@yahoo.it> wrote in message =
news:bcp8p7$5eu$1@rogue.oti.com...
> Hello, I've a little problem using Eclipse. If i create 2 file like =
these
> inside a package named "ptest":
>=20
> File1:
> ------------------
> package ptest;
>=20
> class Myclass1 {
> public int testInt =3D 5;
> }
>=20
> class Myclass2 {
> public String testString =3D "Hi";
> }
> ----------------------------------------
>=20
> FileMain:
> ------------------
> package ptest;
>=20
> public class FileMain {
> public static void main(String[] args) {
> Myclass2 a =3D new Myclass2(); // Here Eclipse underlines =
Myclass2
> System.out.println(a.testString);
> }
> }
> ----------------------------------------
>=20
> Eclipse compiles correctly (the program runs), but underlines in red
> "Myclass2" FileMain.
> The code is perfectly legal since the first classes (Myclass1 and =
Myclass2)
> have package visibility and if i use for example JBuilder, it works
> correctly and doesn't underline nothing. The result is that i cannot =
work
> with Eclipse, since in my program i've a lot of classes (around 600) =
and i
> grouped some of them by functionality in various files, but Eclipse =
doesn't
> recognize the type of the variables i declared and all the advanced =
features
> don't work.
> Is this a bug? Is there some workaround for this?
> Thank you for your answers.
>=20
> Bitblaster
>=20
>
------=_NextPart_000_0015_01C335B2.B93D02A0
Content-Type: text/html;
charset="windows-1251"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1251">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0 background=3D"">
<DIV><FONT face=3DArial size=3D2>Ok, thank you very much for your time, =
i'll wait=20
for&nbsp;the next&nbsp;version of Eclipse, but it looks strange to me =
that i'm=20
the only who&nbsp;asked for&nbsp;this bug (i installed Eclipse for the =
first=20
time only 2 days ago).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Bye!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Bit</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Vasil Panushev" &lt;<A=20
href=3D"mailto:v_panushev@prosyst.bg">v_panushev@prosyst.bg</A>&gt; ha =
scritto=20
nel messaggio <A=20
=
href=3D"news:bcpitm$epo$1@rogue.oti.com">news:bcpitm$epo$1@rogue.oti.com<=
/A>...</DIV>
<DIV>Hi </DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>I've reproduced your situation on Eclipse 2.1 (200303272130) and =
the line=20
is&nbsp;really marked as error.</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D3>Funny thing is that the =
file&nbsp;FileMain=20
isn't marked as "errorneus" in the package explorer,&nbsp;the =
file&nbsp;gets=20
compiled (I have a .class file) and even I was able to run it.=20
</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D3>I tryed to compile the same source =
outside of=20
eclipse and it compiled fine&nbsp;with JDK 1.3+</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D3></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D3>however compilation with JDK 1.2.2 =
and 1.1.8=20
failed with:</FONT></DIV>
<DIV><BR>FileMain.java:20: class ptest.Myclass2 is defined in =
Myclass1.java.=20
Because it is used outside of its source file, it should be defined in =
a file=20
called=20
=
"Myclass2.java".<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
System.out.println(a.testString);</DIV>
<DIV><BR><FONT size=3D3>The default setting for eclispe is to maintain =
the=20
.class files JDK 1.1 compatible. Unfortunately setting the =
compatibility level=20
to&nbsp;1.4 shows no effect - the line is still makred as error - so =
this=20
looks like an eclipse bug.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D3>Best regards </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D3>Vasil</FONT></DIV>
<DIV><BR><BR>"Bitblaster" &lt;bitblasters@yahoo.it&gt; wrote in =
message=20
news:bcp8p7$5eu$1@rogue.oti.com...<BR>&gt; Hello, I've a little =
problem using=20
Eclipse. If i create 2 file like these<BR>&gt; inside a package named=20
"ptest":<BR>&gt; <BR>&gt; File1:<BR>&gt; ------------------<BR>&gt; =
package=20
ptest;<BR>&gt; <BR>&gt; class Myclass1 =
{<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=20
public int testInt =3D 5;<BR>&gt; }<BR>&gt; <BR>&gt; class Myclass2=20
{<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; public String testString =3D =
"Hi";<BR>&gt;=20
}<BR>&gt; ----------------------------------------<BR>&gt; <BR>&gt;=20
FileMain:<BR>&gt; ------------------<BR>&gt; package ptest;<BR>&gt; =
<BR>&gt;=20
public class FileMain {<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; public static =
void=20
main(String[] args) =
{<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;=20
Myclass2 a =3D new Myclass2();&nbsp; // Here Eclipse underlines=20
Myclass2<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;=20
System.out.println(a.testString);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
}<BR>&gt;=20
}<BR>&gt; ----------------------------------------<BR>&gt; <BR>&gt; =
Eclipse=20
compiles correctly (the program runs), but underlines in red<BR>&gt;=20
"Myclass2" FileMain.<BR>&gt; The code is perfectly legal since the =
first=20
classes (Myclass1 and Myclass2)<BR>&gt; have package visibility and if =
i use=20
for example JBuilder, it works<BR>&gt; correctly and doesn't underline =

nothing. The result is that i cannot work<BR>&gt; with Eclipse, since =
in my=20
program i've a lot of classes (around 600) and i<BR>&gt; grouped some =
of them=20
by functionality in various files, but Eclipse doesn't<BR>&gt; =
recognize the=20
type of the variables i declared and all the advanced features<BR>&gt; =
don't=20
work.<BR>&gt; Is this a bug? Is there some workaround for =
this?<BR>&gt; Thank=20
you for your answers.<BR>&gt; <BR>&gt; Bitblaster<BR>&gt; <BR>&gt;=20
</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0015_01C335B2.B93D02A0--
Re: Is it a bug? Help me please [message #60890 is a reply to message #60207] Wed, 18 June 2003 10:03 Go to previous messageGo to next message
Eclipse UserFriend
I can't recreate the entire structure of my program (it's also not so
elegant to have 600 separated files each of 20 lines...), so i'll wait for
the next version of Eclipse, but it looks strange to me that i'm the only
who asked for this bug (i installed Eclipse for the first time only 2 days
ago). Thank you however for you interest
Bye!

Bit

"Olivier Thomann" <Olivier_Thomann@ca.ibm.comNOSPAM> ha scritto nel
messaggio news:ctj0fv4d7ik2bgqeclf6ctadur4k9or1sp@4ax.com...
On Wed, 18 Jun 2003 10:44:22 +0200, "Bitblaster"
<bitblasters@yahoo.it> wrote:
>File1:
>------------------
>package ptest;
>
>class Myclass1 {
> public int testInt = 5;
>}
>
>class Myclass2 {
> public String testString = "Hi";
>}
Define each class in its own file. Then it will work fine.
If you do a full build, it should work as well. The problem is to
retrieve secondary types. This is under investigation for 3.0.
--
Olivier
Workaround found [message #61505 is a reply to message #60084] Thu, 19 June 2003 03:48 Go to previous messageGo to next message
Eclipse UserFriend
So i bypassed the problem by adding the output folder as a class folder in
the libraries, so that emule (stupidly) sees that there there is one file
for each class and no longer underlines the class names.
Re: Workaround found [message #61540 is a reply to message #61505] Thu, 19 June 2003 03:49 Go to previous message
Eclipse UserFriend
I wrote emule, i mean Eclipse obviously ;-)

"Bitblaster" <bitblasters@yahoo.it> ha scritto nel messaggio
news:bcrpss$7mf$1@rogue.oti.com...
So i bypassed the problem by adding the output folder as a class folder in
the libraries, so that emule (stupidly) sees that there there is one file
for each class and no longer underlines the class names.
Previous Topic:linux tree control
Next Topic:Junit output
Goto Forum:
  


Current Time: Mon May 12 16:44:26 EDT 2025

Powered by FUDForum. Page generated in 0.03321 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top