bugGNU Octave - Bugs: bug #48820, Java interface: documentation of...

 
 

bug #48820: Java interface: documentation of type conversions Java<=>Octave

Submitter:  Ernst Reissner <ernstreissner>
Submitted:  Thu 18 Aug 2016 06:53:49 PM UTC
   
 
Category:  Documentation Severity:  2 - Minor
Priority:  3 - Low Item Group:  Documentation
Status:  Postponed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 08 Mar 2017 09:24:56 AM UTC, comment #10: 

a few comments on file 39826:

line 45:
+@code{byte}, @code{short}, @code{int}, and @code{long}
without comma before 'and'

line 68:
The special value @code{null} has node associated wrapper class. 
You mean:
The special value @code{null} has no associated wrapper class.
I think the problem occurs when unwrapping not wrapping.
So I would write:
Trying to unbox the special reference @code{null}
results in a NullPointerException because the primitive types
offer no counterpart to @code{null} in java.

line 92
Most of the conversion is straight forward. 
More subtile are the integer types

This does not fit.
I would write:
Most of the conversion is straight forward. 
Care has to be taken with conversion of octave unsigned integer types since they can exceed the range of Java's according signed integer types...

line 95:
'as a consequence' does not fit.
I just would write: 'Thus'

line 96:
singed-->signed.

line 116:
another two exceptions are the @code{void} and @code{null}.
should be
another two exceptions are the return type @code{void} and the return value @code{null}.

The rest seems ok.
Note that this is not the full truth!

Ernst Reissner <ernstreissner>
Thu 02 Mar 2017 11:46:04 PM UTC, comment #9: 

Thank you for comments. Please, can you insert the ideas of comment #7 into file #39826 for a second (final) revision?

Let us get this item done and we proceed with patch #9085.

Kai Torben Ohlhus <siko1056>
Group Member
Thu 02 Mar 2017 04:22:43 PM UTC, comment #8: 

by the way,
this is the place where to include the patch for bug 9085:
besides methods and fieldnames
also constructors shall be accessible.

Ernst Reissner <ernstreissner>
Thu 02 Mar 2017 04:20:17 PM UTC, comment #7: 

@Kai,
seems fine.
A few comments: Using isjava.. whether a variable contains...
But it is not only applicable to variables
I would write

With isjava it is possible to check whether an expression
results in a java object
and if so class returns the name of its java class.

The next example is really great!


Sentence: But ambiguities may arise...
is not so good.
I think, the point is that Double is converted into double
when used as a parameter.


Below:
I would rewrite "method and constructor parameters"
as "parameters of methods and constructors"


Well, whether calling static methods and getting static fields
in a special way is a workaround... hm..
I think, it is the way it is done.
Note that also javaObject
is a kind of workaround since java.long.Double(3.4)
does not work (as it does in matlab)...


I would not write about "empty brackets"
it is the empty array I think.

You write "It is not recommended",
but in fact, the user has no choice.
One could write: be careful: ... [] has type double whereas null has no type.

I would talk about debug_java right after mentioning exceptions.

Also I would not write
"In octave it is possible to provide..."
but just "Octave provides ..."


I think for methods and fieldnames one should provide links
als you do for the other functions.

also I have forgotten to mention, that octave also allows to display constructors.

Ernst Reissner <ernstreissner>
Sat 25 Feb 2017 12:23:33 AM UTC, comment #6: 

@Ernst: Sorry for the delay, we had a new bug fixing release, including your documentation right now:

https://www.gnu.org/software/octave/doc/interpreter/How-to-use-Java-from-within-Octave.html#How-to-use-Java-from-within-Octave

Kai Torben Ohlhus <siko1056>
Group Member
Sat 25 Feb 2017 12:21:47 AM UTC, comment #5: 

In the file bug_48820_revision1.patch I tried to merge patches A file #38262 and B file #38263. These are very verbost. My focus was not to explain Java, not to compare to Matlab and given the user the most information with fewest possible words.  Do you agree on the changes?

I still don't like Patch C file #38267. Is it later of any use? Otherwise I reject it.

(file #39826)

Kai Torben Ohlhus <siko1056>
Group Member
Thu 23 Feb 2017 03:17:25 PM UTC, comment #4: 

Dear Ernst,

I think in the mailing list, we should stay with one thread one to organize which item to attack next. Thus keeping the noise low there and the discussions about specific items here at Savannah.

Alright, a first discussion I want to do about Patch C file #38267. Basically it only renames functions. Is the term (un-)boxing so confusing? I know it is something very Java-related.

My votes against doing this is, that it is only "internal" no user working with the interface will ever see these function names.

The remaining two patches are in progress right now.

Kai Torben Ohlhus <siko1056>
Group Member
Fri 19 Aug 2016 01:42:56 AM UTC, comment #3: 

As subsection 'Java types and Octave types'
uses the terms (un)boxing in the context of Java,
the same term shall not be used for octave.
Thus renamed ov-java::box,unbox

(file #38267)

Ernst Reissner <ernstreissner>
Thu 18 Aug 2016 10:36:35 PM UTC, comment #2: 

Well, had to add further information:
types void, null-value, char-types.

Still a lot of material is missing:
- for numeric types and for char types
  manual conversions shall be mentioned: double(.) and others.
- Alternative conversions of return values
- preferences in conversions of argument types
  and why the matlab rules are not well defined.
...


(file #38263)

Ernst Reissner <ernstreissner>
Thu 18 Aug 2016 10:33:00 PM UTC, comment #1: 

Added a patch which provides the most basic information

(file #38262)

Ernst Reissner <ernstreissner>
Thu 18 Aug 2016 06:53:49 PM UTC, original submission:  

The subject of conversion of Octave types to Java types
e.g. when invoking Java methods
and back conversion, e.g. of the return values
is a complex subject.
Also Matlab documentation expands a lot on that.

I feel,
an according section in Octave's manual is strongly required.

Ernst Reissner <ernstreissner>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #39826:  bug_48820_revision1.patch added by siko1056 (6KiB - text/x-patch)
file #38267:  patchBug48820C.patch added by ernstreissner (8KiB - text/x-patch)
file #38263:  patchBug48820B.patch added by ernstreissner (8KiB - text/x-patch)
file #38262:  patchBug48820.patch added by ernstreissner (8KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by ernstreissner (Submitted the item)
  • -email is unavailable- added by ernstreissner
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-02-28 siko1056 StatusIn Progress Postponed
        Assigned tosiko1056 None
    2017-03-02 siko1056 StatusNeed Info In Progress
    2017-03-02 siko1056 StatusIn Progress Need Info
    2017-02-25 siko1056 Attached File- Added bug_48820_revision1.patch, #39826
    2017-02-23 siko1056 StatusPatch Submitted In Progress
    2017-02-23 siko1056 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        Assigned toNone siko1056
    2016-08-23 siko1056 Item GroupNone Documentation
        StatusNone Patch Submitted
    2016-08-19 ernstreissner Attached File- Added patchBug48820C.patch, #38267
    2016-08-18 ernstreissner Attached File- Added patchBug48820B.patch, #38263
    2016-08-18 ernstreissner Attached File- Added patchBug48820.patch, #38262
    2016-08-18 ernstreissner Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code