Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35344

Re: Syntax error on token "taskTEList", VariableDeclaratorId expected after this token

Newsgroups comp.lang.java.programmer
Date 2016-08-14 12:50 -0700
References <nop34r$1f19$1@gioia.aioe.org>
Message-ID <e8a2d0eb-fa7e-4b69-aeb8-dc915632ee97@googlegroups.com> (permalink)
Subject Re: Syntax error on token "taskTEList", VariableDeclaratorId expected after this token
From Lew <lewbloch@gmail.com>

Show all headers | View raw


parmenides wrote:
> Hi,
> 
> In a JSP page, the following code:
> 
> <%
> ...
> ArrayList<TaskTableEntry> taskTEList;
> @SuppressWarnings("unchecked")
> taskTEList = (ArrayList<TaskTableEntry>)session.getAttribute("taskTEList");
> ...
> %>
> 
> will result in compilling error:
> 
> Syntax error on token "taskTEList", VariableDeclaratorId expected after 
> this token

The annotation is in an illegal place. You cannot annotate a statement, only a declaration.

> 
> But, by modifing the code as:
> 
> <%
> ...
> @SuppressWarnings("unchecked")
> ArrayList<TaskTableEntry> taskTEList = 
> (ArrayList<TaskTableEntry>)session.getAttribute("taskTEList");
> ...
> %>
> 
> there is no the above error message at all. Why?

Because here you annotate the declaration.

-- 
Lew

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Syntax error on token "taskTEList", VariableDeclaratorId expected after this token parmenides <xparmenides@yahoo.com> - 2016-08-14 14:29 +0800
  Re: Syntax error on token "taskTEList", VariableDeclaratorId expected after this token Lew <lewbloch@gmail.com> - 2016-08-14 12:50 -0700

csiph-web