octave-maintainers
[Top][All Lists]
Advanced

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

Re: Java Bool type


From: Rik
Subject: Re: Java Bool type
Date: Wed, 13 Mar 2013 08:13:16 -0700

> Message: 1
> Date: Tue, 12 Mar 2013 13:37:45 -0700 (PDT)
> From: PhilipNienhuis <address@hidden>
> To: address@hidden
> Subject: Re: Java Bool type
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> Rik-4 wrote
>> > On 03/11/2013 02:35 PM, Philip Nienhuis wrote:
>>> >> (maintainers ML added)
>>> >>
>>> >> Rik wrote:
>>>> >>> On 03/11/2013 12:46 PM, Philip Nienhuis wrote:
>>>>> >>>> Rik wrote:
>>>>>> >>>>> On 03/10/2013 02:00 PM, 
>> > octave-maintainers-request@
>> >  wrote:
>>>>>>> >>>>>> The issue turned out to be that Octave "logical" class isn't
>>>>>>> >>>>>> automatically
>>>>>>> >>>>>> "casted" (?) into a Java Boolean class anymore, as it was in the 
>>>>>>> >>>>>> OF
>>>>>>> >>>>>> Java
>>>>>>> >>>>>> package.
>>>>>>> >>>>>> Somewhere higher up in the relevant code I had a statement:
>>>>>>> >>>>>>
>>>>>>> >>>>>> lProp = javaObject ("com.sun.star.beans.PropertyValue", 
>>>>>>> >>>>>> "Hidden", 0,
>>>>>>> >>>>>> true,
>>>>>>> >>>>>> []);
>>>>>>> >>>>>>
>>>>>>> >>>>>> which had to be replaced by:
>>>>>>> >>>>>>
>>>>>>> >>>>>> jtrue = javaObject ("java.lang.Boolean", "true");
>>>>>>> >>>>>> lProp = javaObject ("com.sun.star.beans.PropertyValue", 
>>>>>>> >>>>>> "Hidden", 0,
>>>>>>> >>>>>> jtrue,
>>>>>>> >>>>>> []);
>>>>>>> >>>>>>
>>>>>>> >>>>>> (Same had to be done in other parts of the code.)
>>>>>>> >>>>>> After that I could use Open/LibreOffice as before from Octave.
>>>>>>> >>>>>>
>>>>>>> >>>>>> I can't judge whether this is a bug or just new behavior. If you
>>>>>>> >>>>>> think
>>>>>>> >>>>>> it's
>>>>>>> >>>>>> a bug I'll file a bug report.
>>>>>> >>>>> 3/10/13
>>>>>> >>>>>
>>>>>> >>>>> Philip,
>>>>>> >>>>>
>>>>>> >>>>> I would report this as a bug so we can track it.  For compatibility
>>>>>> >>>>> with
>>>>>> >>>>> Matlab
>>>>>> >>>>> (http://www.mathworks.com/help/matlab/matlab_external/passing-data-to-a-java-method.html),
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> and because it is the sensible thing to do, logical values should 
>>>>>> >>>>> be
>>>>>> >>>>> converted to native boolean Java types where possible.  The code 
>>>>>> >>>>> for
>>>>>> >>>>> doing
>>>>>> >>>>> this is still in the unbox routine, but it looks like it may not be
>>>>>> >>>>> activated because it is too low down in the if/else if tree.  
>>>>>> >>>>> Please
>>>>>> >>>>> try
>>>>>> >>>>> the attached patch (patch -p1<   patch.java_bool) and see whether 
>>>>>> >>>>> it
>>>>>> >>>>> eliminates the need to create a jtrue object.
> Rik,
>
> With your patch OpenOffice / LibreOffice works again, the
> io_ods_testscript.m & io_xls_testscript.m gave no errors.
> I wonder if I still need to file a bug report (for the statistics?)
Great.  I'll push the changeset.  No need to file a bug report on this now.

--Rik



reply via email to

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