octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opportunities for core work on Java


From: Philip Nienhuis
Subject: Re: Opportunities for core work on Java
Date: Sat, 15 Dec 2012 14:30:28 -0800 (PST)

Rik-4 wrote
> 12/14/12
> <snip>
> 1) javaclasspath.m needs to be able to set the classpath.
> 
> Currently the Octave version of javaclasspath only reads the current
> classpath variable.  For compatibility, and because it makes sense, we
> should be able to call javaclasspath (dpath) and directly set the value of
> the classpath.  The functionality we are trying to match is here
> (http://www.mathworks.com/help/matlab/ref/javaclasspath.html).  The change
> is pretty simple as well, call javaMethod with a "setProperty" method
> instead of a "getProperty" method.  Watch out that the path to octave.jar
> should always remain as the first element of the classpath.

Is that really true? 
IIRC octave.jar is implicitly in the path (i.e., in the static classpath). 
>From what I understand of the ML docs, javaclasspath() is supposed to only
be able to change the dynamic classpath (while yes, it can query both the
dynamic and static classpaths).
The static classpath is supposed to be just that: static. (It can be set in
the "classpath.txt" file which is processed at startup of the JVM.)

Anyway, a long time ago I peeked at how Martin Hepperle implemented the
javarmpath() function; AFAIR it looked quite a bit more involved than just
swapping getProperty for setProperty. But then I may be wrong.


> <snip>
> 5) %!test blocks needed for java functions
> 
> The java functions need tests written for them.  The test code is at the
> end of each m-file and should begin with '%!testif HAVE_JAVA' if it uses
> Java.  It can begin with '%!test' if it is an ordinary test block that
> might be checking just input validation.  There are functions in
> libinterp/octave-value/ov-java.cc which also need test blocks.  In the C++
> code the test blocks need to be inside of block comments immediately after
> the DEFUN block.  For example, a totally simple test for the isjava()
> function is:
> 
> /*
> %!testif HAVE_JAVA
> %! jobj = javaObject ("java.lang.StringBuffer");
> %! assert (isjava (jobj));
> */

I'll have a go at javaMethod/java_invoke, javaObject/java_new in the coming
days.

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Opportunities-for-core-work-on-Java-tp4647933p4647964.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]