[Libreoffice-commits] core.git: ridljar/com

2023-09-05 Thread Caolán McNamara (via logerrit)
 ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java |1 
+
 1 file changed, 1 insertion(+)

New commits:
commit 185ca3f1010283f84009c160f0dc564f71039b0c
Author: Caolán McNamara 
AuthorDate: Tue Sep 5 16:48:08 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 5 18:37:19 2023 +0200

call WebSocketClient.close from XConnection.close

to drop the connection, otherwise we stick around until we timeout
after trying to exit

Change-Id: Ia4ca95b022b9234219da4658512603ebf918ff35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156577
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git 
a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java 
b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
index fb81c4ff8801..9f3c0afbb5fe 100644
--- a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
+++ b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
@@ -222,6 +222,7 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
  */
 public void close() throws com.sun.star.uno.RuntimeException {
 if (DEBUG) System.err.println("# " + getClass().getName() + " - 
socket closed");
+super.close();
 }
 
 /**


[Libreoffice-commits] core.git: ridljar/com

2023-09-05 Thread Caolán McNamara (via logerrit)
 ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java |   35 
+++---
 1 file changed, 11 insertions(+), 24 deletions(-)

New commits:
commit da558946bec0f052fd6f3815faf859b69262a2b0
Author: Caolán McNamara 
AuthorDate: Tue Sep 5 13:03:41 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 5 16:02:56 2023 +0200

websocket URP flush hangs with large buffer

over 4k hits limit so flush waits until something reads, but the
read is in the same thread after the flush.

We are just using _outputStream to accumulate the bytes to be send
so change this to use a ByteArrayOutputStream and take over its bytes
and clear it when we flush.

Change-Id: I17b90e1c7d4302f153b5832e60ac0e0f2b86ace9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156565
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git 
a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java 
b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
index a3aed227c81d..fb81c4ff8801 100644
--- a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
+++ b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
@@ -20,7 +20,7 @@ package com.sun.star.lib.connections.websocket;
 
 
 import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -61,10 +61,8 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 
 protected String   _description;
 protected InputStream  _inputStream;
-protected OutputStream _outputStream;
-
-protected InputStream _outputStreamReader;
 protected OutputStream _inputStreamWriter;
+protected ByteArrayOutputStream _outputStream;
 
 protected ArrayList   _listeners;
 
@@ -83,14 +81,10 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 
 PipedOutputStream inputStreamWriter = new PipedOutputStream();
 PipedInputStream inputPipe = new PipedInputStream(inputStreamWriter);
-PipedOutputStream outputPipe = new PipedOutputStream();
-PipedInputStream outputStreamReader = new PipedInputStream(outputPipe);
-
 
 _inputStream = new BufferedInputStream(inputPipe);
 _inputStreamWriter = inputStreamWriter;
-_outputStream = new BufferedOutputStream(outputPipe);
-_outputStreamReader = outputStreamReader;
+_outputStream = new ByteArrayOutputStream();
 
 _listeners = new ArrayList();
 
@@ -206,23 +200,16 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
  */
 public void flush() throws com.sun.star.io.IOException,
 com.sun.star.uno.RuntimeException {
-try {
-_outputStream.flush();
-
-Integer available = _outputStreamReader.available();
-
-byte[] outputBytes = new byte[available + outgoingPrefix.length];
-System.arraycopy(outgoingPrefix, 0, outputBytes, 0, 
outgoingPrefix.length);
-
-_outputStreamReader.read(outputBytes, outgoingPrefix.length, 
available);
 
-send(outputBytes);
-} catch(IOException ioException) {
-com.sun.star.io.IOException unoIOException = new 
com.sun.star.io.IOException(ioException);
-notifyListeners_error(unoIOException);
-
-throw unoIOException;
+byte[] accumulatedBytes;
+synchronized (_outputStream) {
+accumulatedBytes = _outputStream.toByteArray();
+_outputStream.reset();
 }
+byte[] outputBytes = new byte[accumulatedBytes.length + 
outgoingPrefix.length];
+System.arraycopy(outgoingPrefix, 0, outputBytes, 0, 
outgoingPrefix.length);
+System.arraycopy(accumulatedBytes, 0, outputBytes, 
outgoingPrefix.length, accumulatedBytes.length);
+send(outputBytes);
 
 if (DEBUG)
 System.err.println(String.format("# %s - flushed", 
getClass().getName()));


[Libreoffice-commits] core.git: ridljar/com

2023-09-03 Thread Caolán McNamara (via logerrit)
 ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java |2 
++
 1 file changed, 2 insertions(+)

New commits:
commit 8f7d3d0e39025b6019922b62fc60961e09c5296d
Author: Caolán McNamara 
AuthorDate: Sun Sep 3 17:00:20 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sun Sep 3 20:29:03 2023 +0200

each websocket URP message is taking a full second

because the data written here doesn't appear to the reader
on the other end until a full second expires.

https: //bugs.openjdk.org/browse/JDK-8014239
Change-Id: I9b6f4d51562f4dd0866ff0fccd5951b1efe38f25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156488
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git 
a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java 
b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
index 16a5ad17f1e6..a3aed227c81d 100644
--- a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
+++ b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
@@ -278,6 +278,7 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 
 try {
 _inputStreamWriter.write(messageBytes);
+_inputStreamWriter.flush();
 } catch (IOException e) {
 notifyListeners_error(new com.sun.star.uno.Exception(e));
 return;
@@ -317,6 +318,7 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 
 try {
 _inputStreamWriter.write(messageBytes);
+_inputStreamWriter.flush();
 } catch (IOException e) {
 notifyListeners_error(new com.sun.star.uno.Exception(e));
 return;


[Libreoffice-commits] core.git: ridljar/com

2023-09-01 Thread Caolán McNamara (via logerrit)
 ridljar/com/sun/star/lib/uno/helper/UnoUrl.java |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 136fbdec2cd3b3364c6d054793bdcb3b32d562eb
Author: Caolán McNamara 
AuthorDate: Fri Sep 1 10:46:58 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 1 21:28:38 2023 +0200

prefix the UNO-Url example with recommended 'uno:'

as http://www.openoffice.org/udk/common/man/spec/uno-url.html suggests.

Change-Id: Ifce9a9944f1a25bc0b6f89e5cec127a22bc6f990
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156399
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/ridljar/com/sun/star/lib/uno/helper/UnoUrl.java 
b/ridljar/com/sun/star/lib/uno/helper/UnoUrl.java
index 8bb4d26432d9..22ea695f5bc4 100644
--- a/ridljar/com/sun/star/lib/uno/helper/UnoUrl.java
+++ b/ridljar/com/sun/star/lib/uno/helper/UnoUrl.java
@@ -46,7 +46,7 @@ import java.util.HashMap;
  * Usage:
  *
  * 
- *   UnoUrl url = 
UnoUrl.parseUnoUrl("socket,host=localhost,port=2002;urp;StarOffice.ServiceManager");
+ *   UnoUrl url = 
UnoUrl.parseUnoUrl("uno:socket,host=localhost,port=2002;urp;StarOffice.ServiceManager");
  * 
  */
 public class UnoUrl {


[Libreoffice-commits] core.git: ridljar/com

2023-09-01 Thread Andrea Gelmini (via logerrit)
 ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java |   10 
+-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 982bd513c65add804e83e2e74782740a5653742f
Author: Andrea Gelmini 
AuthorDate: Fri Sep 1 18:17:19 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Sep 1 21:28:20 2023 +0200

Fix typo

Change-Id: I63b019aa12eb4898374162b0226728fd49bef93c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156427
Reviewed-by: Julien Nabet 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git 
a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java 
b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
index 7f522df409d1..16a5ad17f1e6 100644
--- a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
+++ b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java
@@ -262,7 +262,7 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 String[] messageParts = message.split(": ", 2);
 if (messageParts.length != 2)
 {
-notifyListeners_error(new com.sun.star.uno.Exception(new 
ProtocolException(String.format("Recieved URP/WS message (%s) without a type 
specifier. Messages must be proceeded by 'urp: '", message;
+notifyListeners_error(new com.sun.star.uno.Exception(new 
ProtocolException(String.format("Received URP/WS message (%s) without a type 
specifier. Messages must be proceeded by 'urp: '", message;
 return;
 }
 
@@ -283,7 +283,7 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 return;
 }
 
-if (DEBUG) System.err.println(String.format("# %s - recieved %s 
chars", getClass().getName(), Integer.toString(messageBytes.length)));
+if (DEBUG) System.err.println(String.format("# %s - received %s 
chars", getClass().getName(), Integer.toString(messageBytes.length)));
 }
 
 @Override
@@ -302,14 +302,14 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 }
 
 if(!hasType) {
-notifyListeners_error(new com.sun.star.uno.Exception(new 
ProtocolException(String.format("Recieved URP/WS message (%s) without a type 
specifier. Binary messages must be proceeded by 'urp: ' or 'urp:\\n'", 
message;
+notifyListeners_error(new com.sun.star.uno.Exception(new 
ProtocolException(String.format("Received URP/WS message (%s) without a type 
specifier. Binary messages must be proceeded by 'urp: ' or 'urp:\\n'", 
message;
 return;
 }
 
 int messageStartIndex = i + 2;
 
 if (!messageType.equals("urp")) {
-if (DEBUG) System.err.println(String.format("# %s - recieved 
%s binary message but that is not URP", getClass().getName(), messageType));
+if (DEBUG) System.err.println(String.format("# %s - received 
%s binary message but that is not URP", getClass().getName(), messageType));
 return;
 }
 
@@ -322,7 +322,7 @@ public class WebsocketConnection extends WebSocketClient 
implements XConnection,
 return;
 }
 
-if (DEBUG) System.err.println(String.format("# %s - recieved %s 
bytes", getClass().getName(), Integer.toString(prefixedMessageBytes.length)));
+if (DEBUG) System.err.println(String.format("# %s - received %s 
bytes", getClass().getName(), Integer.toString(prefixedMessageBytes.length)));
 }
 
 @Override


[Libreoffice-commits] core.git: ridljar/com

2023-02-28 Thread Damjan Jovanovic (via logerrit)
 ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java |   
18 ++
 1 file changed, 18 insertions(+)

New commits:
commit 618e8e30a21efea41b9a4e63219de20e38987f4a
Author: Damjan Jovanovic 
AuthorDate: Mon Feb 27 20:15:20 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 28 10:05:12 2023 +

Fix the java.lang.NullPointerException in readBytes() and readSomeBytes()...

methods in InputStreamToXInputStreamAdapter when called from the 
inter-process UNO bridge.

XInputStream::readBytes() documents how the buffer is an "out" parameter, 
and isn't passed
to the implementing end, which is why we get the buffer as a "byte[][] b" 
and b[0] == null.
Its role is to box a byte[] array to be returned the client. Thus, allocate 
the buffer if
it is missing or too small.

Additionally, virtually all other readBytes() and readSomeBytes() 
implementations trim this
sequence to the actual number of bytes read. This presumably reduces the 
inter-process
traffic, but some callers even rely on the sequence to be trimmed, eg.
main/sax/source/expatwrap/xml2utf.cxx. Thus trim our returned array too.

(cherry-picked from 6cb06142790376a2c58e6392182eb071420a4221)

Change-Id: I42eb209b68f7c13a34670d03c2ca61d76672385b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147933
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git 
a/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java 
b/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
index a81bb85b1c57..d547b1e7ce17 100644
--- a/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
+++ b/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
@@ -79,6 +79,9 @@ public final class InputStreamToXInputStreamAdapter 
implements XInputStream {
 {
 try {
 long bytesRead;
+if (b[0] == null || b[0].length < len) {
+b[0] = new byte[len];
+}
 if (len >iIn.available()) {
 bytesRead = iIn.read(b[0], 0, iIn.available());
 }
@@ -89,6 +92,12 @@ public final class InputStreamToXInputStreamAdapter 
implements XInputStream {
 // Casting bytesRead to an int is okay, since the user can
 // only pass in an integer length to read, so the bytesRead
 // must <= len.
+if (bytesRead < b[0].length) {
+int outSize = bytesRead > 0 ? (int)bytesRead : 0;
+byte[] out = new byte[outSize];
+System.arraycopy(b[0], 0, out, 0, outSize);
+b[0] = out;
+}
 if (bytesRead <= 0) {
 return 0;
 }
@@ -103,6 +112,9 @@ public final class InputStreamToXInputStreamAdapter 
implements XInputStream {
 {
 try {
 long bytesRead;
+if (b[0] == null || b[0].length < len) {
+b[0] = new byte[len];
+}
 if (len >iIn.available()) {
 bytesRead = iIn.read(b[0], 0, iIn.available());
 }
@@ -113,6 +125,12 @@ public final class InputStreamToXInputStreamAdapter 
implements XInputStream {
 // Casting bytesRead to an int is okay, since the user can
 // only pass in an integer length to read, so the bytesRead
 // must <= len.
+if (bytesRead < b[0].length) {
+int outSize = bytesRead > 0 ? (int)bytesRead : 0;
+byte[] out = new byte[outSize];
+System.arraycopy(b[0], 0, out, 0, outSize);
+b[0] = out;
+}
 if (bytesRead <= 0) {
 return 0;
 }


[Libreoffice-commits] core.git: ridljar/com

2023-02-28 Thread Caolán McNamara (via logerrit)
 ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java |   
47 --
 1 file changed, 23 insertions(+), 24 deletions(-)

New commits:
commit c6052ce76a25408e2a8b6221d9cc0098365dc22d
Author: Caolán McNamara 
AuthorDate: Mon Feb 27 20:23:49 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 28 08:39:53 2023 +

fix up misleading mismatching indent and add mode lines

Change-Id: Id0abfc6d2962223bd0f7f0864a53e94bb7ec5052
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147932
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git 
a/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java 
b/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
index 3d60e5a1181a..a81bb85b1c57 100644
--- a/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
+++ b/ridljar/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -15,6 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
 package com.sun.star.lib.uno.adapter;
 
 import java.io.IOException;
@@ -76,23 +78,21 @@ public final class InputStreamToXInputStreamAdapter 
implements XInputStream {
 com.sun.star.io.IOException
 {
 try {
-long bytesRead;
-if (len >iIn.available()) {
-bytesRead = iIn.read(b[0], 0, iIn.available());
-}
-else{
-bytesRead = iIn.read(b[0], 0, len);
-}
+long bytesRead;
+if (len >iIn.available()) {
+bytesRead = iIn.read(b[0], 0, iIn.available());
+}
+else{
+bytesRead = iIn.read(b[0], 0, len);
+}
+
 // Casting bytesRead to an int is okay, since the user can
 // only pass in an integer length to read, so the bytesRead
 // must <= len.
-
 if (bytesRead <= 0) {
 return 0;
-}
-return ((int)bytesRead);
-
-
+}
+return ((int)bytesRead);
 } catch (IOException e) {
 throw new com.sun.star.io.IOException("reader error", e);
 }
@@ -102,23 +102,21 @@ public final class InputStreamToXInputStreamAdapter 
implements XInputStream {
 com.sun.star.io.IOException
 {
 try {
-long bytesRead;
-if (len >iIn.available()) {
-bytesRead = iIn.read(b[0], 0, iIn.available());
-}
-else{
-bytesRead = iIn.read(b[0], 0, len);
-}
+long bytesRead;
+if (len >iIn.available()) {
+bytesRead = iIn.read(b[0], 0, iIn.available());
+}
+else{
+bytesRead = iIn.read(b[0], 0, len);
+}
+
 // Casting bytesRead to an int is okay, since the user can
 // only pass in an integer length to read, so the bytesRead
 // must <= len.
-
 if (bytesRead <= 0) {
 return 0;
-}
-return ((int)bytesRead);
-
-
+}
+return ((int)bytesRead);
 } catch (IOException e) {
 throw new com.sun.star.io.IOException("reader error", e);
 }
@@ -143,3 +141,4 @@ public final class InputStreamToXInputStreamAdapter 
implements XInputStream {
 }
 }
 
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */


[Libreoffice-commits] core.git: ridljar/com

2022-08-12 Thread Caolán McNamara (via logerrit)
 ridljar/com/sun/star/uno/IBridge.java |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f4027dd967a3292cfba689ca735d839b16ac2d92
Author: Caolán McNamara 
AuthorDate: Fri Aug 12 09:24:26 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Aug 13 00:35:17 2022 +0200

warning: empty  tag

Change-Id: I6fb9dd331fe6ff9e35477a122a84ab0a6d3d8426
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138179
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/ridljar/com/sun/star/uno/IBridge.java 
b/ridljar/com/sun/star/uno/IBridge.java
index 51babcdfc101..5cd9fda704e1 100644
--- a/ridljar/com/sun/star/uno/IBridge.java
+++ b/ridljar/com/sun/star/uno/IBridge.java
@@ -24,7 +24,7 @@ import java.io.IOException;
  * This is abstract interface for bridges.
  *
  * Bridges are able to map one object from one UNO environment to another 
and
- * vice versa.
+ * vice versa.
  *
  * @see com.sun.star.uno.IBridge
  * @see com.sun.star.uno.IQueryInterface


[Libreoffice-commits] core.git: ridljar/com

2020-09-25 Thread Noel Grandin (via logerrit)
 ridljar/com/sun/star/lib/connections/socket/socketConnector.java |8 
+++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit b6a26170b6145f7af057538f38fc656823726a0d
Author: Noel Grandin 
AuthorDate: Fri Sep 25 11:58:47 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 25 17:56:33 2020 +0200

socket cannot be null at this point

Change-Id: I2027478d1dfa64a3841027d94d8eaa140fe319dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103382
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/ridljar/com/sun/star/lib/connections/socket/socketConnector.java 
b/ridljar/com/sun/star/lib/connections/socket/socketConnector.java
index 484ffd135e92..c9a15d1f5d4a 100644
--- a/ridljar/com/sun/star/lib/connections/socket/socketConnector.java
+++ b/ridljar/com/sun/star/lib/connections/socket/socketConnector.java
@@ -158,11 +158,9 @@ public final class socketConnector implements XConnector {
 
 con = new SocketConnection(connectionDescription, socket);
 } catch (IOException e) {
-if (socket != null) {
-try {
-socket.close();
-} catch(IOException ioException) {
-}
+try {
+socket.close();
+} catch(IOException ioException) {
 }
 throw new NoConnectException(e);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: ridljar/com udkapi/com unotools/source xmloff/dtd xmloff/inc xmloff/source

2019-07-26 Thread Andrea Gelmini (via logerrit)
 ridljar/com/sun/star/uno/Enum.java  |2 +-
 udkapi/com/sun/star/container/XEnumerableMap.idl|6 +++---
 unotools/source/config/viewoptions.cxx  |2 +-
 xmloff/dtd/chart.mod|2 +-
 xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx  |4 ++--
 xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx |4 ++--
 xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx |4 ++--
 xmloff/inc/XMLRectangleMembersHandler.hxx   |4 ++--
 xmloff/source/core/xmlimp.cxx   |4 ++--
 xmloff/source/draw/propimp0.cxx |2 +-
 xmloff/source/draw/shapeexport.cxx  |8 
 xmloff/source/draw/ximpcustomshape.cxx  |2 +-
 xmloff/source/draw/ximpshap.cxx |6 +++---
 xmloff/source/forms/elementexport.cxx   |2 +-
 xmloff/source/forms/elementimport.cxx   |4 ++--
 xmloff/source/forms/elementimport.hxx   |4 ++--
 xmloff/source/forms/formattributes.hxx  |   18 +-
 xmloff/source/forms/formcellbinding.hxx |2 +-
 xmloff/source/forms/layerexport.cxx |2 +-
 xmloff/source/forms/layerexport.hxx |2 +-
 xmloff/source/forms/propertyexport.cxx  |2 +-
 xmloff/source/forms/propertyexport.hxx  |4 ++--
 xmloff/source/forms/propertyimport.hxx  |2 +-
 xmloff/source/style/xmlimppr.cxx|2 +-
 xmloff/source/text/XMLRedlineExport.cxx |2 +-
 xmloff/source/text/XMLRedlineExport.hxx |4 ++--
 xmloff/source/text/XMLTextFrameContext.cxx  |2 +-
 xmloff/source/text/txtimp.cxx   |2 +-
 xmloff/source/text/txtimppr.cxx |2 +-
 xmloff/source/text/txtparaimphint.hxx   |2 +-
 xmloff/source/text/txtstyli.cxx |2 +-
 xmloff/source/transform/DocumentTContext.hxx|2 +-
 xmloff/source/transform/FormPropOASISTContext.cxx   |2 +-
 xmloff/source/transform/IgnoreTContext.hxx  |4 ++--
 xmloff/source/transform/MetaTContext.hxx|2 +-
 xmloff/source/transform/PersAttrListTContext.hxx|4 ++--
 xmloff/source/transform/TransformerBase.cxx |2 +-
 xmloff/source/transform/TransformerContext.hxx  |4 ++--
 38 files changed, 65 insertions(+), 65 deletions(-)

New commits:
commit 937440b65368e832a9e9fba92dfdb2efec4e06b5
Author: Andrea Gelmini 
AuthorDate: Fri Jul 26 15:18:52 2019 +0200
Commit: Andrea Gelmini 
CommitDate: Fri Jul 26 18:50:35 2019 +0200

Fix typos

Change-Id: I60261b937215340d2eb6f439234e99a300b0e189
Reviewed-on: https://gerrit.libreoffice.org/76380
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/ridljar/com/sun/star/uno/Enum.java 
b/ridljar/com/sun/star/uno/Enum.java
index 90ac08ead25a..f18015d9558d 100644
--- a/ridljar/com/sun/star/uno/Enum.java
+++ b/ridljar/com/sun/star/uno/Enum.java
@@ -32,7 +32,7 @@ public abstract class Enum {
 private final int m_value;
 
 /**
- * Constructs a enum value.
+ * Constructs an enum value.
  * @param  value   the integer value of this enum value.
  */
 protected Enum(int value) {
diff --git a/udkapi/com/sun/star/container/XEnumerableMap.idl 
b/udkapi/com/sun/star/container/XEnumerableMap.idl
index 1be6ec8a4e38..06d982447069 100644
--- a/udkapi/com/sun/star/container/XEnumerableMap.idl
+++ b/udkapi/com/sun/star/container/XEnumerableMap.idl
@@ -54,7 +54,7 @@ module com { module sun { module star { module container {
  */
 interface XEnumerableMap : XMap
 {
-/** creates a enumerator for the keys of the map
+/** creates an enumerator for the keys of the map
 
 @param Isolated
 controls whether the newly create enumerator should be isolated 
from the map.
@@ -65,7 +65,7 @@ interface XEnumerableMap : XMap
 XEnumeration createKeyEnumeration( [in] boolean Isolated )
 raises ( ::com::sun::star::lang::NoSupportException );
 
-/** creates a enumerator for the values of the map
+/** creates an enumerator for the values of the map
 
 @param Isolated
 controls whether the newly create enumerator should be isolated 
from the map.
@@ -76,7 +76,7 @@ interface XEnumerableMap : XMap
 XEnumeration createValueEnumeration( [in] boolean Isolated )
 raises ( ::com::sun::star::lang::NoSupportException );
 
-/** creates a enumerator for the key-value pairs of the map
+/** creates an enumerator for the key-value pairs of the map
 
 The elements returned by the enumerator are instances of 
com::sun::star::beans::Pair,
 holding the key-value-pairs which are part of the map.
diff --git a/unotools/source/config/viewoptions.cxx 
b/unotools/source/config/viewoptions.cxx
index b88fddf630d3..b7cfc9e063c3 100644
--- 

[Libreoffice-commits] core.git: ridljar/com

2017-08-25 Thread Damjan Jovanovic
 ridljar/com/sun/star/uno/UnoRuntime.java |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 3f84390f585cf71331a77ab5ca632cacaf3ad7b9
Author: Damjan Jovanovic 
Date:   Sun Aug 20 06:22:29 2017 +

i#32546# - Java UnoRuntime.getUniqueKey/generateOid do not work reliably

In the Java UNO bridge, UnoRuntime.generateOid() generated the
object-specific part of the OID using java.lang.Object.hashCode(),
which is only 32 bits long, and is commonly overriden and could thus
return values from an even smaller range, so OID collisions were quite
likely.

This changes UnoRuntime.generateOid() to use 128 bit UUIDs for the
object-specific part of the OID, and store these in an object => oid
java.util.WeakHashMap, making OID collisions almost impossible.

Patch by: me
Suggested by: Stephan Bergmann (stephan dot bergmann dot secondary at
googlemail dot com)

(cherry picked from commit 6dd83d1c6c5c580d14ca3d0458be4020603ba118)

Change-Id: I8e851a7a69ac2defefa15e9a00118d8f9fc0da95
Reviewed-on: https://gerrit.libreoffice.org/41576
Reviewed-by: Stephan Bergmann 
Reviewed-by: Noel Grandin 
Tested-by: Jenkins 

diff --git a/ridljar/com/sun/star/uno/UnoRuntime.java 
b/ridljar/com/sun/star/uno/UnoRuntime.java
index 1cba9d8b0258..99da56aa9ea8 100644
--- a/ridljar/com/sun/star/uno/UnoRuntime.java
+++ b/ridljar/com/sun/star/uno/UnoRuntime.java
@@ -23,6 +23,8 @@ import java.lang.reflect.Array;
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.UUID;
+import java.util.WeakHashMap;
 
 import com.sun.star.lib.uno.typedesc.FieldDescription;
 import com.sun.star.lib.uno.typedesc.TypeDescription;
@@ -106,7 +108,16 @@ public class UnoRuntime {
 if (object instanceof IQueryInterface) {
 oid = ((IQueryInterface) object).getOid();
 }
-return oid == null ? object.hashCode() + oidSuffix : oid;
+if (oid == null) {
+synchronized (oidMap) {
+ oid = oidMap.get(object);
+ if (oid == null) {
+ oid = UUID.randomUUID().toString() + oidSuffix;
+ oidMap.put(object, oid);
+ }
+}
+}
+return oid;
 }
 
 /**
@@ -690,6 +701,7 @@ public class UnoRuntime {
 private final IBridge bridge;
 }
 
+private static final WeakHashMap oidMap = new 
WeakHashMap();
 private static final String uniqueKeyHostPrefix
 = Integer.toString(new Object().hashCode(), 16) + ":";
 private static final Object uniqueKeyLock = new Object();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: ridljar/com

2016-06-07 Thread Stephan Bergmann
 ridljar/com/sun/star/uno/Type.java |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit d8df3ed9dfef931d5384a18f3ac3b1f49ee3200c
Author: Stephan Bergmann 
Date:   Tue Jun 7 11:11:25 2016 +0200

error: unknown tag: internal

Change-Id: Ie96b4ed27060498a39bb5fb1ea7a4cb3e17408ff

diff --git a/ridljar/com/sun/star/uno/Type.java 
b/ridljar/com/sun/star/uno/Type.java
index 355d3f8..0589b64 100644
--- a/ridljar/com/sun/star/uno/Type.java
+++ b/ridljar/com/sun/star/uno/Type.java
@@ -274,7 +274,8 @@ public class Type {
 /**
  * Constructs a new Type from the given type description.
  *
- * @internal
+ * For internal URE use only. Not to be used by client code.
+ *
  * @param typeDescription a type description.  Must not be
  * null.
  */
@@ -370,7 +371,8 @@ public class Type {
 /**
  * Gives the type description of this type.
  *
- * @internal
+ * For internal URE use only. Not to be used by client code.
+ *
  * @return the type description; may be null
  */
 public TypeDescription getTypeDescription() {
@@ -380,7 +382,8 @@ public class Type {
 /**
  * Sets the type description for this type.
  *
- * @internal
+ * For internal URE use only. Not to be used by client code.
+ *
  * @param typeDescription the type description
  */
 public void setTypeDescription(TypeDescription typeDescription) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: ridljar/com

2014-07-22 Thread rbuj
 ridljar/com/sun/star/uno/Any.java|   66 ++-
 ridljar/com/sun/star/uno/Enum.java   |5 -
 ridljar/com/sun/star/uno/IMemberDescription.java |5 -
 ridljar/com/sun/star/uno/IMethodDescription.java |6 --
 ridljar/com/sun/star/uno/ITypeDescription.java   |   14 
 ridljar/com/sun/star/uno/Type.java   |   26 -
 ridljar/com/sun/star/uno/Union.java  |3 -
 ridljar/com/sun/star/uno/UnoRuntime.java |2 
 8 files changed, 70 insertions(+), 57 deletions(-)

New commits:
commit 0340e62fc9fa78cfe0a6718ac07f1ba31260ff5c
Author: rbuj robert@gmail.com
Date:   Tue Jul 22 12:33:50 2014 +0200

ridljar: javadoc  Override

Javadoc: apply formatting and remove the warning empty p tag.

@Override public String toString()
@Override public boolean equals(Object obj)
@Override public int hashCode()

Change-Id: I64b63d01015535d386ac584831c4ef6e371e863d
Reviewed-on: https://gerrit.libreoffice.org/10453
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/ridljar/com/sun/star/uno/Any.java 
b/ridljar/com/sun/star/uno/Any.java
index ba1d9f6..8da2bfb 100644
--- a/ridljar/com/sun/star/uno/Any.java
+++ b/ridljar/com/sun/star/uno/Any.java
@@ -28,19 +28,19 @@ package com.sun.star.uno;
  * an interprocess connection using an any, you should use this class to add
  * an explicit interface type, so the remote counterpart doesn't need to invoke
  * a queryInterface).
- * p
+ * /p
  */
 public class Any {
 /**
  * The type of the any.
- * p
+ *
  * @see #getType
  */
 protected Type  _type;
 
 /**
  * The data of the any.
- * p
+ *
  * @see #getObject
  */
 protected Object _object;
@@ -52,7 +52,7 @@ public class Any {
 
 /**
  * Constructs a new any.
- * p
+ *
  * @param   zInterface  the type of the any.
  * @param   object  the data of the any.
  * @deprecated as of UDK 2.0
@@ -61,9 +61,11 @@ public class Any {
 this(new Type(zInterface), object);
 }
 
-/** Constructs a new any with a given type and value
-@param type the UNO type of the any.
-@param object the value of the any.
+/**
+ * Constructs a new any with a given type and value
+ *
+ * @param type the UNO type of the any.
+ * @param object the value of the any.
  */
 public Any(Type type, Object object) {
 if (type.equals(Type.ANY)) {
@@ -74,15 +76,13 @@ public class Any {
 }
 
 /**
-   Complete a UNO codeANY/code (make sure it is wrapped up as an
-   codeAny/code instance).
-
-   @param any a Java value representing a UNO codeANY/code value.
-
-   @return a complete Java value (that is, an codeAny/code instance)
-   representing the same UNO codeANY/code value as the given argument.
-
-   @since UDK 3.2.3
+ * Complete a UNO codeANY/code (make sure it is wrapped up as an
+ * codeAny/code instance).
+ *
+ * @param any a Java value representing a UNO codeANY/code value.
+ * @return a complete Java value (that is, an codeAny/code instance)
+ * representing the same UNO codeANY/code value as the given argument.
+ * @since UDK 3.2.3
 */
 public static final Any complete(Object any) {
 return any instanceof Any
@@ -93,8 +93,8 @@ public class Any {
 
 /**
  * Gets the type of the value within the any.
- * p
- * @return   the type of the value within the any.
+ *
+ * @return the type of the value within the any.
  */
 public Type getType() {
 return _type;
@@ -102,14 +102,22 @@ public class Any {
 
 /**
  * Gets the value within the any.
- * p
- * @return   gets the value within the any.
+ *
+ * @return gets the value within the any.
  */
 public Object getObject() {
 return _object;
 }
 
-// @see java.lang.Object#equals
+/**
+ * Indicates whether some other object is equal to this one.
+ *
+ * @param obj the reference object with which to compare.
+ * @return codetrue/code if this object is the same as the obj 
argument;
+ * codefalse/code otherwise.
+ * @see java.lang.Object#equals
+ */
+@Override
 public boolean equals(Object obj) {
 return obj instanceof Any  _type.equals(((Any) obj)._type)
  (_object == null
@@ -117,13 +125,25 @@ public class Any {
 : _object.equals(((Any) obj)._object));
 }
 
-// @see java.lang.Object#hashCode
+/**
+ * Returns a hash code value for the object.
+ *
+ * @return a hash code value for this object.
+ * @see java.lang.Object#hashCode
+ */
+@Override
 public int hashCode() {
 return _type.hashCode() * 13
 + (_object == null ? 0 : _object.hashCode());
 }
 
-// @see java.lang.Object#toString
+