Hi,
There is a bug in jess.Main.initialize():
int argIdx = 0;
boolean doLogo = true;
if (argv.length > 0)
while(argv[argIdx].startsWith("-"))
{
if (argv[argIdx].equals("-nologo"))
doLogo = false;
argIdx++;
}
this code will throw an ArrayIndexOutOfBoundsException if I pass any
argument, as the while doesn't test for argIdx being under argv.length.
Example:
java jess.Main -nologo
I suspect the bug has been hidden because you usually use no arguments, or
run batch files which end by shutting down Jess??
BTW, it would be nice for me (even desirable) to sho Jess's startup logo,
but not when I create the Main object, only when I call execute(). The
problem is that my program wil do lots of things, then create the Rete and
Main, then do lots more things by manipulating the Rete, then finally drop
into the Jess shell to let the user play with the produced knowledge. So
showing the logo in the middle of that is very ugly:
----------------------------------------------------------------
T:\>reeng s patt
ReflectReader - (C)1999, Osvaldo Pinali Doederlein
Reading classes...
Classifiers: 9 primitives, 1 unresolved, 10 done.
Building relationships...
Killing classifier proxies...
Collecting interfaces into classes...
Binding methods to operations...
Time: 0.291s - Heap: 3109K used, 3162K of 6272K free.
Starting Inference Engine.
Jess, the Java Expert System Shell
Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
Jess Version 5.0a5 5/27/99
Facts: 134 in 0.14s - Heap: 3400K used, 3547K of 6948K free.
Thinking...
Found pattern: Singleton reeng.test.Singleton.Singleton
Inferencing took 0.01s - Heap: 3416K used, 3531K of 6948K free.
Jess> _
----------------------------------------------------------------
So it's horrible that Jess's logo appears in the middle of my program's
output. What I would like to have is:
----------------------------------------------------------------
T:\>reeng s patt
ReflectReader - (C)1999, Osvaldo Pinali Doederlein
Reading classes...
Classifiers: 9 primitives, 1 unresolved, 10 done.
Building relationships...
Killing classifier proxies...
Collecting interfaces into classes...
Binding methods to operations...
Time: 0.291s - Heap: 3109K used, 3162K of 6272K free.
Starting Inference Engine.
Facts: 134 in 0.14s - Heap: 3400K used, 3547K of 6948K free.
Thinking...
Found pattern: Singleton reeng.test.Singleton.Singleton
Inferencing took 0.01s - Heap: 3416K used, 3531K of 6948K free.
Jess, the Java Expert System Shell
Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
Jess Version 5.0a5 5/27/99
Jess> _
----------------------------------------------------------------
Maybe you could just move the logo println to execute(), or have a
printLogo() public method that I can call after using -nologo to not have it
appearing when I don't want?
If not, I'll be happy simply disabling the logo without a crash, so this
solves the problem:
while(argIdx < argv.length && argv[argIdx].startsWith("-"))
A+
Osvaldo
----------------------------------------------------------------
*** The Free, Open and Pure Java Shell *** Current: Alpha7
http://www.geocities.com/ResearchTriangle/Node/2005/java_shell.htm
http://student.vub.ac.be/~opinalid/java_shell.htm
----------------------------------------------------------------
Osvaldo Pinali Doederlein [EMAIL PROTECTED]
MSc student, Developer, Java & CORBA evangelist, Rainmaker, etc.
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------