Chappelear, Jack | 12 Oct 20:23
Picon

RE: java.security.AccessControlException

In the middle of port, so I will not get to it till next week.
Thank you for your prompt attention to this

-----Original Message-----
From: Konstantin L. Metlov [mailto:metlov <at> kinetic.ac.donetsk.ua] 
Sent: Friday, October 12, 2007 2:22 PM
To: Chappelear, Jack
Cc: help-jel <at> gnu.org
Subject: Re: [Help-jel] java.security.AccessControlException

Dear Jack,

I was able to reproduce the problem (thanks to your nice testcase) and
have fixed it. Now JEL expressions inherit the security context of JEL
itself. Please download the new version 2.0.1 and try it.

Either from homepage 

http://kinetic.ac.donetsk.ua/JEL/ 

or directly from

ftp://ftp.gnu.org/pub/gnu/jel/jel-2.0.1.tar.gz
ftp://ftp.gnu.org/pub/gnu/jel/jel-2_0_1.zip

It works for me (although I did not try signing the jars, but set their
permissions by code source through .java.policy file) under the default
Java Security Manager.

Please also note that JEL is now distributed under GPLv3 license.
(Continue reading)

Chappelear, Jack | 5 Oct 19:40
Picon

java.security.AccessControlException

Recently added access to System.getProperties and when we run as a java webstart (with full security permissions) I am seeing

java.security.AccessControlException: access denied (java.util.PropertyPermission timestamp read)      
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)   
at java.security.AccessController.checkPermission(AccessController.java:401)   
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524) 
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1276)    
at java.lang.System.getProperty(System.java:573)       
at com.gs.mac.eval.JWSTestStatics.getTimestamp(JWSTestStatics.java:5)  
at dump.evaluate(Unknown Source)       
at com.gs.mac.eval.JWSTest.main(JWSTest.java:31)       
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)       
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)       
at java.lang.reflect.Method.invoke(Method.java:324)    
at com.sun.javaws.Launcher.executeApplication(Unknown Source)  
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)    
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)      
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)       
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)     at com.sun.javaws.Launcher.run(Unknown Source) 
at java.lang.Thread.run(Thread.java:534)

Jel 9.11 works fine running as a native program
All jars are signed and java WS is admitting that I have all-permissions

Java Web Start 1.2 Console, started Fri Oct 05 13:12:20 EDT 2007
Java 2 Runtime Environment: Version 1.4.2_13 by Sun Microsystems Inc.
Permission requested for: file:/C:/temp/javaws/cache/http/Dnhdtdsa01.ny.fw.gs.com/P8080/RMJWSTest.jar
Found certificate chain of length 2 in codesource
Found certificate chain of length 2 in cache
adding all-permissions object
Permission requested for: file:/C:/temp/javaws/cache/http/Dnhdtdsa01.ny.fw.gs.com/P8080/RMjel.jar
Found certificate chain of length 2 in codesource
Found certificate chain of length 2 in cache
adding all-permissions object


Work great w/o the system.getProperty()

Is this related to the custom class loader? Do I need to add System as a static lib?

package com.gs.mac.eval;
import gnu.jel.CompiledExpression;
import gnu.jel.Evaluator;
import gnu.jel.Library;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class JWSTest {
        private static String version = "1.2";
        public static void main(String[] args) throws Throwable {
                String expr = "getTimestamp()";
                // Set up the library
                Class[] staticLib = new Class[1];
                staticLib[0] = JWSTestStatics.class;
                Library lib = new Library(staticLib, null, null, null);
                lib.markStateDependent("getTimestamp", null);
                CompiledExpression c = Evaluator.compile(expr, lib);
                String s = (String) c.evaluate(null);
                System.out
                                .println("This is version " + JWSTest.version + " (the timestamp value is "
                                                + System.getProperty("timestamp") + ")" + System.getProperty("line.separator")

                                                + System.getProperties());
                JFrame frame = new JFrame();
                Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
                frame.setTitle("JWSTest version " + JWSTest.version);
                frame.setSize(d.width * 3 / 4, d.height * 3 / 4);
                frame.setLocation(d.width / 8, d.height / 8);
                frame.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                                System.exit(0);
                        }
                });
                JTextArea textArea = new JTextArea(20, 60);
                textArea
                                .setText("This is version " + JWSTest.version + " (the timestamp value is "
                                                + System.getProperty("timestamp") + ")" + System.getProperty("line.separator")

                                                + System.getProperties());
                JScrollPane scrollPane = new JScrollPane(textArea);
                frame.getContentPane().add(scrollPane);
                frame.setVisible(true);
        }
}

package com.gs.mac.eval;

public class JWSTestStatics {
        public static String getTimestamp() {
                return System.getProperty("timestamp");
        }

}

_______________________________________________
Help-jel mailing list
Help-jel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-jel
Chappelear, Jack | 25 Jul 13:31
Picon

RE: Identifying version of jel

Thanx, I'll go to the latest 0.9 first and see if I have time to go to
2.0 . I know that the code uses DVResolver, but I'll have to prioritize
that change with all the rest of the refactoring.

-----Original Message-----
From: Konstantin L. Metlov [mailto:metlov <at> kinetic.ac.donetsk.ua] 
Sent: Wednesday, July 25, 2007 5:39 AM
To: Chappelear, Jack
Cc: help-jel <at> gnu.org
Subject: RE: [Help-jel] Identifying version of jel

> The class files in the jar file were compiled on Feb 20, 2001
Then you have the version 0.9.7 exactly.

The "major" changelog is the following:

0.9.8: 
*   Overridable String comparisons using the usual relational operators 
    ">", ">=", "<", "<=", "==", "!=" and employing the current locale.
*   User-definable explicit casts of non-primitive types.
0.9.9:
*   The library size is reduced by 11%
*   The compiler performance is improved by 14% (running the 0.9.8
TestSuite)
*   New DVMap class, allowing optional compile-time translation of
    dynamic variable names from Strings into other Java primitive types
    for improved performance.
*   Deprecated (scheduled for removal in JEL >1.0)
    1) gnu.jel.Library constructors except the 5-argument full version,
       please add null arguments to your calls to the Library
constructor
    2) gnu.jel.DVResolver interface, please use DVMap instead.
0.9.10:
*   The code is now represented by tree internally.
*   A new hand-written parser. JEL does not depend on JavaCC anymore.
*   The compiler size is reduced by >30%, it is now <34Kb compressed
JAR.
*   Performance was also enchanced by new parser, which does
    significantly less heap allocations.
0.9.11:
*   JDK 1.4 source compatibility.
*   Detailed identification of the result type prior to expression 
    evaluation (see method getTypeC() in gnu.jel.CompiledExpression)
2.0.0:
*   JDK 5 source compatibility.
    This release is built (and tested) under JDK 5 using all of the
    new features (such as Generics). It will not work with older JDK
    releases (because JDK 1.5 itself is not backwards compatible).
    Please use older releases of JEL with old JDKs and JREs.
*   JEL is now built with ant.
*   Documentation is improved and is now in DocBook format.
*   Numerous doc commentsfixes.

> The 'real' question is how painful and what benefits would I get by 
> upgrading to the latest version as part of a migration to Java 5.
> The other option is to just go to 0.9.11 , which sound pretty stable (

> going on 3 1/2 years ...)
All these versions are stable with no critical bugs. The versions 0.9.*
are API-compatible, whereas the version 2.0 is "mostly" API-compatible
to
0.9.* (and even then the migration should be easy).

So, my suggestion would be to just try 2.0. There is a big chance it
will just work. You will also benefit from numerous and significant
performance enchancements since 0.9.7.

With the best regards,
                         Konstantin.
Chappelear, Jack | 24 Jul 21:18
Picon

RE: Identifying version of jel

 Ah, look at the dates in the jar file...
>From the manifest, it was built with an IBM JDK (1.3), so I expect that
it was build from some long lost source onsite ...
The class files in the jar file were compiled on Feb 20, 2001

The 'real' question is how painful and what benefits would I get by
upgrading to the latest version as part of a migration to Java 5.
The other option is to just go to 0.9.11 , which sound pretty stable (
going on 3 1/2 years ...)

-----Original Message-----
From: Konstantin L. Metlov [mailto:metlov <at> kinetic.ac.donetsk.ua] 
Sent: Tuesday, July 24, 2007 1:32 PM
To: Chappelear, Jack
Cc: help-jel <at> gnu.org
Subject: Re: [Help-jel] Identifying version of jel

JEL version is specified at the beginning of the README file in the
distribution. But not in the included binary jar file. :-(

The version can be guessed from the jar file size (if it is the original
one, distributed by me) or from file dates.

In your case the main contenders are:

JEL 0.9.10 (distributed since 13 Feb 2002), jar size = 33570 bytes
JEL 0.9.11 (    -"-"-"-"-"-   15 Oct 2003), jar size = 34270 bytes
JEL 2.0.0  (    -"-"-"-"-"-    1 Oct 2006), jar size = 33790 bytes

You can also distinguish between JEL 0.9 and JEL 2.0 by the absence (in
2.0) of the "gnu/jel/DVResolver.class" in the jar.

If you only have sources in CVS, then the situation is more difficult. 
First of all, because, if the sources are modified, the notion of JEL
version becomes diluted and ultimately meaningless. Also, when the
sources are imported into CVS the contents of my $id:$ tags will be
replaced and the file sizes will change... In any case, all JEL versions
are distributed through http://kinetic.ac.donetsk.ua/JEL/ (please see
the "Old Releases" section).

With the best regards,
                          Konstantin.
Chappelear, Jack | 24 Jul 19:05
Picon

Identifying version of jel

I have a 3+ year old jel jar file. How can I determine what version of the source it was built from? Nothing obvious from the jar file...

It was entered into our cvs system on August 23, 2005 so it is at least that old (more likely from 2003)

Thanx

Jack Chappelear

_______________________________________________
Help-jel mailing list
Help-jel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-jel
Sreenivasan G | 5 Sep 11:30

Problem wih arrays


Sir,
  I have Integer[] i = new Integer[]{ new Integer(2), new Integer(3) };

I want to have an expression like "i[0].intValue() * 3". Is it is possible to do
with JEL. If so, please give solution

"Knowledge speaks, but wisdom listens"

Sreenivasan G
Software Engineer
Amrita Technologies
Mob No: 09447116263

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
damien benoist | 24 May 11:04
Picon
Favicon

Re: method call in expressions pb

That's it!

Thank you.

--- "Konstantin L. Metlov" <metlov <at> fzu.cz> wrote:
> 
> Very very probably, it means that your resolver is
> defined in such a way 
> that YourDVResolver.getTypeName("all") returns
> non-null, telling JEL that 
> there is a dynamic variable named "all".
> 
> Once you have both dynamic variable and method with
> the same name in the 
> namespace, the dynamic variable resolution takes a
> priority. Thus, "all" 
> is a dynamic variable to JEL and it can't have
> formal parameters.
> 
> If this scheme of namespace conflict resolution is
> undesirable, You will 
> need to ensure that there are no conflicts between
> the library and the 
> dynamic variables.
> 
> With the best regards,
>                            Konstantin.
> 
> 
> On Mon, 16 May 2005, damien benoist wrote:
> 
> > Hello,
> >
> > I have a list of dynamic variables.
> > Those variables are boolean and have a name
> (String).
> > I would like to add a function which returns true
> > if all the variables matching a regexp are true:
> >
> >       all("dum*")
> >
> > When compiling the expression, i get the following
> > exception:
> >
> >       gnu.jel.CompilationException:
> > Dynamic variable cant have the formal parameters.
> >
> > I've set a dynamic lib with an "all" method:
> >
> > public boolean                  all(
> > String                          reStr) {
> >
> >    ...
> > }
> >
> > What am i doing wrong (again)?
> >
> > Thanks for your help.
> >
> >
> >
> >
> > Yahoo! Mail
> > Stay connected, organized, and protected. Take the
> tour:
> > http://tour.mail.yahoo.com/mailtour.html
> >
> >
> >
> > _______________________________________________
> > Help-jel mailing list
> > Help-jel <at> gnu.org
> > http://lists.gnu.org/mailman/listinfo/help-jel
> >
> 

		
__________________________________ 
Discover Yahoo! 
Stay in touch with email, IM, photo sharing and more. Check it out! 
http://discover.yahoo.com/stayintouch.html
damien benoist | 16 May 18:51
Picon
Favicon

method call in expressions pb

Hello,

I have a list of dynamic variables.
Those variables are boolean and have a name (String).
I would like to add a function which returns true
if all the variables matching a regexp are true:

       all("dum*")

When compiling the expression, i get the following
exception:

       gnu.jel.CompilationException: 
Dynamic variable cant have the formal parameters.

I've set a dynamic lib with an "all" method: 

public boolean                  all(
String                          reStr) {

    ...
}

What am i doing wrong (again)?

Thanks for your help.

		
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html
damien benoist | 7 Apr 14:12
Picon
Favicon

question

Hello,

Is there a way to get the list of variables
referenced/used in an expression?

Using the resolver it could be possible:
- create an empty list before compiling
- compiling
  - in getTypeName calls, add the var to the list

Is it right? Is there a better way?

Thanks.

		
__________________________________ 
Do you Yahoo!? 
Yahoo! Personals - Better first dates. More second dates. 
http://personals.yahoo.com
damien benoist | 5 Apr 18:38
Picon
Favicon

resolver problem

Hello,

With the folowing expression:

	getIntegerProperty("repHdrLen")-2

- When setting no resolver: compiles and evaluates
with no pb.

- When setting a resolver I get the following
Exception when compiling:

	gnu.jel.CompilationException: Dynamic variable cant
have the formal parameters.

I don't understand why setting a resolver changes the
behaviour with this expression.
Can someone explain this?

- keeping the resolver and setting the expression to:

	repHdrLen-2

I get the following Excetpion:

Caused by: java.lang.NullPointerException
        at gnu.jel.Library.describe(Unknown Source)
        at gnu.jel.Library.getMember(Unknown Source)
        at gnu.jel.Parser.functionCall(Unknown Source)
        at gnu.jel.Parser.genDVCall(Unknown Source)
        at gnu.jel.Parser.element(Unknown Source)
        at gnu.jel.Parser.unary(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.binOP(Unknown Source)
        at gnu.jel.Parser.conditional(Unknown Source)
        at gnu.jel.Parser.expression(Unknown Source)
        at gnu.jel.Parser.parse(Unknown Source)
        at gnu.jel.Evaluator.parse(Unknown Source)
        at gnu.jel.Evaluator.compileBits(Unknown
Source)
        at gnu.jel.Evaluator.compile(Unknown Source)
        at gnu.jel.Evaluator.compile(Unknown Source)
	my call to compiler

What am i doing wrong?

Thanks.

		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 
robert_gary | 2 Feb 18:16
Favicon

RE: JEL expression syntax

Awesome! A BNF was just what I was looking for!

-----Original Message-----
From: Konstantin L. Metlov [mailto:metlov <at> fzu.cz] 
Sent: Wednesday, February 02, 2005 1:50 AM
To: robert_gary <at> agilent.com
Cc: help-jel <at> gnu.org
Subject: Re: [Help-jel] JEL expression syntax

> Is there a document that describes the syntax for JEL expressions?

Yes, you can find the BNF for the expressions language in the file 
docs/EC.html of JEL distribution, or, online at 
http://galaxy.fzu.cz/JEL/EC.html .

With the best regards,
                           Konstantin.

Gmane