design flaw with scope in javax.script??

Discussion in 'Java' started by xyzzy12@hotmail.com, Apr 25, 2006.

  1. Guest

    http://download.java.net/jdk6/doc/api/javax/script/package-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?
    , Apr 25, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin

    ASP.Net design flaw!?

    Kevin, Jan 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    913
    Kevin
    Jan 27, 2004
  2. Replies:
    1
    Views:
    741
    Esmond Pitt
    Mar 27, 2005
  3. lizard
    Replies:
    0
    Views:
    1,765
    lizard
    Jan 30, 2006
  4. Andrew Thompson

    javax.servlet and javax.servlet.http

    Andrew Thompson, Apr 24, 2007, in forum: Java
    Replies:
    1
    Views:
    658
    newbie_at_tomcat
    Apr 25, 2007
  5. Lew
    Replies:
    1
    Views:
    614
    newbie_at_tomcat
    Apr 25, 2007
Loading...

Share This Page