facebook

variables of primitive Java types not shown [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #203328 Reply

    b0rg
    Member

    Hi,

    WinXPprofSp1, JSK 1.4.2_03, Eclipse 2.1.2, MyEclipseIDE 2.7 RC2, Tomcat 5.0.18.

    Simple JSP, put breakpoint into it:
    <%
    String s = “hiho”;
    int i = 7;

    log(s + ” ” + i); // <== put breakpoint here.
    %>
    Debugger stops at the breakpoint, but the variable “i” is not shown into the local variables list!

    I reconstructed the code from memory, becaue my ME trial expired today and I can’t try it out again.

    Thanks in advance,
    Victor

    #203391 Reply

    Scott Anderson
    Participant

    Victor,

    One of the things that can cause this is the compiler optimizing your variable out of existence. In the code snippet you supplied, since ‘i’ is initialized and never changed most compilers will simply replace it with the constant its been initialized to in order to improve performance.

    #203561 Reply

    b0rg
    Member

    Scott,

    you were absolutely right.

    Victor

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: variables of primitive Java types not shown [Closed]

You must be logged in to post in the forum log in