Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Strange watch variables behavior
Strange watch variables behavior [message #148443] Sat, 13 March 2004 00:57 Go to next message
Oliver Dain is currently offline Oliver DainFriend
Messages: 3
Registered: July 2009
Junior Member
I've just started using Eclipse, and so far I really like it, but I
have one major problem I can't seem to fix. I finally tracked the
problem down so its repeatable, but its very strange. Do the
following:

Create a new project and a package called foo. Now create a class
called foo in that package like this:

package foo;

public class foo
{
int var;

public foo(int x)
{
var = x;
}

public void print()
{
System.out.println("HI");
}

}

Now create a file in the default package with a class main in
Main.java:

import foo.*;

public class Main {

public static void main(String[] args)
{
//this is as simple as they come
int i, j;
i = 10;
j = 20;
i = 3*j;
foo x = new foo(7);
System.out.println("i : " + Integer.toString(i));
}
}

OK. Now start debugging the app and put a breakpoint on the j=20
line. When you get there find the value of i in the variables window
and choose "watch" from the context menu. As expected it shows up in
the expressions window. Now step through the code. The value of i
is correctly updated in the expressions window until you execute the
foo x = new foo(7); line. At that point the value of i in the
expressions window is displayed as "<error(s) during the
evaluation>".

From this point on (I have other code that does a lot more than this)
its impossible to put a watch on ANY variable in ANY method!! What's
up with that?? If I rename the class in the package from foo to bar
it doesn't matter. All that matters is that I've accessed something
from that package! Am I doing something wrong or is this a bug?
Re: Strange watch variables behavior [message #148459 is a reply to message #148443] Sat, 13 March 2004 09:51 Go to previous messageGo to next message
Johan Compagner is currently offline Johan CompagnerFriend
Messages: 148
Registered: July 2009
Senior Member
seems like a bug to me.
dit you file a bug report?

johan

Oliver wrote:
> I've just started using Eclipse, and so far I really like it, but I
> have one major problem I can't seem to fix. I finally tracked the
> problem down so its repeatable, but its very strange. Do the
> following:
>
> Create a new project and a package called foo. Now create a class
> called foo in that package like this:
>
> package foo;
>
> public class foo
> {
> int var;
>
> public foo(int x)
> {
> var = x;
> }
>
> public void print()
> {
> System.out.println("HI");
> }
>
> }
>
> Now create a file in the default package with a class main in
> Main.java:
>
> import foo.*;
>
> public class Main {
>
> public static void main(String[] args)
> {
> //this is as simple as they come
> int i, j;
> i = 10;
> j = 20;
> i = 3*j;
> foo x = new foo(7);
> System.out.println("i : " + Integer.toString(i));
> }
> }
>
> OK. Now start debugging the app and put a breakpoint on the j=20
> line. When you get there find the value of i in the variables window
> and choose "watch" from the context menu. As expected it shows up in
> the expressions window. Now step through the code. The value of i
> is correctly updated in the expressions window until you execute the
> foo x = new foo(7); line. At that point the value of i in the
> expressions window is displayed as "<error(s) during the
> evaluation>".
>
> From this point on (I have other code that does a lot more than this)
> its impossible to put a watch on ANY variable in ANY method!! What's
> up with that?? If I rename the class in the package from foo to bar
> it doesn't matter. All that matters is that I've accessed something
> from that package! Am I doing something wrong or is this a bug?
Re: Strange watch variables behavior [message #148491 is a reply to message #148459] Sat, 13 March 2004 15:25 Go to previous messageGo to next message
Oliver Dain is currently offline Oliver DainFriend
Messages: 3
Registered: July 2009
Junior Member
No. I did look in the bug database and I didn't see it. Since it
seems so big I figured if it really was a bug somebody else would
have seen it by now, so I figured I was doing something wrong.

Johan Compagner wrote:

> seems like a bug to me.
> dit you file a bug report?
>
> johan
>
> Oliver wrote:
>> I've just started using Eclipse, and so far I really like it, but I
>> have one major problem I can't seem to fix. I finally tracked the
>> problem down so its repeatable, but its very strange. Do the
>> following:
>>
>> Create a new project and a package called foo. Now create a class
>> called foo in that package like this:
>>
>> package foo;
>>
>> public class foo
>> {
>> int var;
>>
>> public foo(int x)
>> {
>> var = x;
>> }
>>
>> public void print()
>> {
>> System.out.println("HI");
>> }
>>
>> }
>>
>> Now create a file in the default package with a class main in
>> Main.java:
>>
>> import foo.*;
>>
>> public class Main {
>>
>> public static void main(String[] args)
>> {
>> //this is as simple as they come
>> int i, j;
>> i = 10;
>> j = 20;
>> i = 3*j;
>> foo x = new foo(7);
>> System.out.println("i : " + Integer.toString(i));
>> }
>> }
>>
>> OK. Now start debugging the app and put a breakpoint on the j=20
>> line. When you get there find the value of i in the variables
>> window
>> and choose "watch" from the context menu. As expected it shows up
>> in
>> the expressions window. Now step through the code. The value of i
>> is correctly updated in the expressions window until you execute
>> the
>> foo x = new foo(7); line. At that point the value of i in the
>> expressions window is displayed as "<error(s) during the
>> evaluation>".
>>
>> From this point on (I have other code that does a lot more than
>> this) its impossible to put a watch on ANY variable in ANY method!!
>> What's
>> up with that?? If I rename the class in the package from foo to
>> bar
>> it doesn't matter. All that matters is that I've accessed
>> something
>> from that package! Am I doing something wrong or is this a bug?
Re: Strange watch variables behavior [message #148835 is a reply to message #148491] Tue, 16 March 2004 10:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Oliver wrote:

>No. I did look in the bug database and I didn't see it. Since it
>seems so big I figured if it really was a bug somebody else would
>have seen it by now, so I figured I was doing something wrong.
>
>
I assume you now filed the bug ;-)

Dani

>Johan Compagner wrote:
>
>
>
>>seems like a bug to me.
>>dit you file a bug report?
>>
>>johan
>>
>>Oliver wrote:
>>
>>
>>>I've just started using Eclipse, and so far I really like it, but I
>>>have one major problem I can't seem to fix. I finally tracked the
>>>problem down so its repeatable, but its very strange. Do the
>>>following:
>>>
>>>Create a new project and a package called foo. Now create a class
>>>called foo in that package like this:
>>>
>>>package foo;
>>>
>>>public class foo
>>>{
>>> int var;
>>>
>>> public foo(int x)
>>> {
>>> var = x;
>>> }
>>>
>>> public void print()
>>> {
>>> System.out.println("HI");
>>> }
>>>
>>>}
>>>
>>>Now create a file in the default package with a class main in
>>>Main.java:
>>>
>>>import foo.*;
>>>
>>>public class Main {
>>>
>>> public static void main(String[] args)
>>> {
>>> //this is as simple as they come
>>> int i, j;
>>> i = 10;
>>> j = 20;
>>> i = 3*j;
>>> foo x = new foo(7);
>>> System.out.println("i : " + Integer.toString(i));
>>> }
>>>}
>>>
>>>OK. Now start debugging the app and put a breakpoint on the j=20
>>>line. When you get there find the value of i in the variables
>>>window
>>>and choose "watch" from the context menu. As expected it shows up
>>>in
>>>the expressions window. Now step through the code. The value of i
>>>is correctly updated in the expressions window until you execute
>>>the
>>>foo x = new foo(7); line. At that point the value of i in the
>>>expressions window is displayed as "<error(s) during the
>>>evaluation>".
>>>
>>>From this point on (I have other code that does a lot more than
>>>this) its impossible to put a watch on ANY variable in ANY method!!
>>>What's
>>>up with that?? If I rename the class in the package from foo to
>>>bar
>>>it doesn't matter. All that matters is that I've accessed
>>>something
>>>from that package! Am I doing something wrong or is this a bug?
>>>
>>>
>
>
>
Re: Strange watch variables behavior [message #148967 is a reply to message #148835] Wed, 17 March 2004 13:32 Go to previous message
Oliver Dain is currently offline Oliver DainFriend
Messages: 3
Registered: July 2009
Junior Member
Daniel Megert wrote:

> Oliver wrote:
>
>>No. I did look in the bug database and I didn't see it. Since it
>>seems so big I figured if it really was a bug somebody else would
>>have seen it by now, so I figured I was doing something wrong.
>>
>>
> I assume you now filed the bug ;-)

yes. Thanks to all for their help.
Previous Topic:Strange behavior when Ctrl-Left Click on symbol
Next Topic:Ant tasks and types have leading / in M7
Goto Forum:
  


Current Time: Fri Dec 27 05:45:37 GMT 2024

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

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

Back to the top