facebook

[Closed] Empty Block definition

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #259203 Reply

    rogue_dev
    Member

    I have the following code snippet

    <% if ( myCondition ) { %>
    <%= conditionMessage %>
    <% } %>

    ME reports this as a warning that there is an empty block without a comment. True enough if we look just at the Java code. But if the entire snippet is looked at, then indeed something is happening within the block.

    #259222 Reply

    Riyad Kalla
    Member

    I cannot reproduce this using:

    
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <body>
            <% boolean myCondition = true;
        String conditionMessage = "Hello"; %>
            <% if ( myCondition ) { %>
            <%= conditionMessage %>
            <% } %>
        </body>
    </html>
    
    #259272 Reply

    rogue_dev
    Member

    See “Variable is never read”

    #259276 Reply

    Riyad Kalla
    Member

    If you are referring to this thread:
    https://www.genuitec.com/forums/topic/closed-variable-is-never-read/#post-259275

    I still did not see this problem with the example you gave here or in that thread. Or are you saying forget about this issue and instead focus on the other one?

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: [Closed] Empty Block definition

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