Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > design flaw with scope in javax.script??

Reply
Thread Tools

design flaw with scope in javax.script??

 
 
xyzzy12@hotmail.com
Guest
Posts: n/a
 
      04-25-2006
http://download.java.net/jdk6/doc/ap...e-summary.html
I think there may be a large flaw in the javax.script in regards to the
scoping constants of ENGINE_SCOPE and GLOBAL_SCOPE. How I read it,
there may be a limitation of a stack depth of 100.

public static final int ENGINE_SCOPE 100
public static final int GLOBAL_SCOPE 200

Notice these methods:

Object getAttribute(String name) Retrieves the value of the
attribute with the given
name in the scope occurring earliest in the search order. The order
is determined by
the numeric value of the scope parameter (lowest scope values first.)


int getAttributesScope(String name) Get the lowest scope in which an
attribute is
defined. The lowest scope. Returns -1 if no attribute with the given
name is defined
in any scope.

Thus it is clearly implied that as the stack depth increases, the scope
value decreases. However, the lowest value for the scope variable is
defined as -1, thus this limits it to a stack depth of 100. My belief
is that the GLOBAL and ENGINE constants should be set to 0 and 1,
respectively, and allow the the scope stack to grow from 2 to
MAX_VALUE.

Any thoughts?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook TNEF flaw could be much worse than WMF flaw Au79 Computer Support 0 01-13-2006 10:48 PM
Conflicting uses of "ip dhcp-server" -- design flaw? kenw@kmsi.net Cisco 7 08-15-2005 05:14 PM
Design flaw in ASP.NET Certificates? Andrew ASP .Net 0 06-29-2005 09:21 PM
Flaw in JRE DefaultTableModel code? (OO design) Mr Smith Java 0 03-16-2005 04:42 PM
ASP.Net design flaw!? Kevin ASP .Net 6 01-27-2004 09:55 PM



Advertisments