[Libreoffice-commits] core.git: 7 commits - qadevOOo/tests scripting/java testtools/com xmerge/source
Caolán McNamara
caolanm at redhat.com
Sun Oct 25 15:41:25 UTC 2015
qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java | 32 ----------
qadevOOo/tests/java/ifc/text/_NumberingLevel.java | 13 +---
qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java | 2
scripting/java/com/sun/star/script/framework/container/ParcelContainer.java | 2
scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java | 22 +++---
testtools/com/sun/star/comp/bridge/TestComponentMain.java | 1
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java | 7 +-
7 files changed, 25 insertions(+), 54 deletions(-)
New commits:
commit 21679f7e0d5c53cc9f18be0447f78091e61ca961
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 25 15:19:12 2015 +0000
coverity#1326344 Infinite loop is deliberate
Change-Id: Ieeae14607127c442b987afc51f2b59692f5334ca
diff --git a/testtools/com/sun/star/comp/bridge/TestComponentMain.java b/testtools/com/sun/star/comp/bridge/TestComponentMain.java
index e394f19..2c83161 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponentMain.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponentMain.java
@@ -99,6 +99,7 @@ public class TestComponentMain
XAcceptor xAcceptor = Acceptor.create(ctx);
+ // coverity[loop_top] - deliberate 'infinite' loop.
while( true )
{
System.err.println("waiting for connect...");
commit 2f9bd9ac4dfe31ba58a660fd341be03648a8c9b7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 25 15:15:14 2015 +0000
cid#1326721 to cid#1326726 Dm: Dubious method used
Change-Id: I5578dc3885945c013064cecf2ca86e7ca734368f
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
index 7c28efb..b77394d 100644
--- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
+++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
@@ -50,9 +50,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor {
private static Main rhinoWindow;
private URL scriptURL;
- // global list of ScriptEditors, key is URL of file being edited
- private static Map<URL, ScriptEditorForJavaScript> BEING_EDITED = new
- HashMap<URL, ScriptEditorForJavaScript>();
+ // global list of ScriptEditors, key is [external form of URL] of file being edited
+ private static Map<String, ScriptEditorForJavaScript> BEING_EDITED = new
+ HashMap<String, ScriptEditorForJavaScript>();
static {
try {
@@ -98,7 +98,7 @@ public class ScriptEditorForJavaScript implements ScriptEditor {
*/
public static ScriptEditorForJavaScript getEditor(URL url) {
synchronized (BEING_EDITED) {
- return BEING_EDITED.get(url);
+ return BEING_EDITED.get(url.toExternalForm());
}
}
@@ -168,11 +168,11 @@ public class ScriptEditorForJavaScript implements ScriptEditor {
new Runnable() {
public void run() {
synchronized (BEING_EDITED) {
- ScriptEditorForJavaScript editor = BEING_EDITED.get(url);
+ ScriptEditorForJavaScript editor = BEING_EDITED.get(url.toExternalForm());
if (editor == null) {
editor = new ScriptEditorForJavaScript(context, url);
- BEING_EDITED.put(url, editor);
+ BEING_EDITED.put(url.toExternalForm(), editor);
}
}
@@ -264,11 +264,11 @@ public class ScriptEditorForJavaScript implements ScriptEditor {
// remove all scripts from BEING_EDITED
synchronized (BEING_EDITED) {
- java.util.Iterator<URL> iter = BEING_EDITED.keySet().iterator();
- java.util.ArrayList<URL> keysToRemove = new java.util.ArrayList<URL>();
+ java.util.Iterator<String> iter = BEING_EDITED.keySet().iterator();
+ java.util.ArrayList<String> keysToRemove = new java.util.ArrayList<String>();
while (iter.hasNext()) {
- URL key = iter.next();
+ String key = iter.next();
keysToRemove.add(key);
}
@@ -304,8 +304,8 @@ public class ScriptEditorForJavaScript implements ScriptEditor {
public void run() {
synchronized (BEING_EDITED) {
- BEING_EDITED.remove(this.url);
+ BEING_EDITED.remove(this.url.toExternalForm());
}
}
}
-}
\ No newline at end of file
+}
commit 1db8bc211fba3759769db6698bb73a74da742512
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 25 15:08:52 2015 +0000
coverity#1326137 Logically dead code
Change-Id: Ib0dcae05793927ecca4e8031e66b6ca1bf4721f7
diff --git a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
index a23c7fb..27e59aa 100644
--- a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
+++ b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
@@ -123,14 +123,13 @@ public class _NumberingLevel {
if ( NumberingLevel.containsKey(propertyName) ) {
NumberingLevel.remove(propertyName);
} else {
- status = false;
- if ( status ) {
- log.println("FAILED: com.sun.star.text.NumberingLevel -> " +
- "found not described property:");
- }
+ if ( status ) {
+ log.println("FAILED: com.sun.star.text.NumberingLevel -> " +
+ "found not described property:");
+ }
- status = false;
- log.println("-> '" + propertyName + "'");
+ status = false;
+ log.println("-> '" + propertyName + "'");
}
}
commit 32ca4302efb6a6de89fd63877ee990c4ac5b9d7c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 25 15:07:06 2015 +0000
coverity#1326136 Logically dead code
Change-Id: I17c0f7e22e63823c16ebcdc1db1e4f618aad22a1
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java b/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java
index 538f1fc..e309c9a1 100644
--- a/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java
@@ -147,7 +147,6 @@ public class _XSheetCellCursor extends MultiMethodTest {
public void _collapseToCurrentRegion(){
boolean bResult = true;
int width = 4, height = 4;
- int leftCol = -1, topRow = -1;
XSpreadsheet oSheet = oObj.getSpreadsheet();
UnoRuntime.queryInterface(
@@ -165,37 +164,6 @@ public class _XSheetCellCursor extends MultiMethodTest {
+ " but it is " + cols + "x" + rows);
}
- // if previous test was successful try more complicated case
- if (bResult) {
- if (leftCol != -1 && topRow != -1) {
- try {
- oSheet.getCellByPosition(
- leftCol + width, topRow + height).setValue(1);
- } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
- log.print("Can't get cell by position:");
- e.printStackTrace(log);
- bResult = false;
- }
-
- oObj.collapseToCurrentRegion() ;
-
- // checking results
- cols = UnoRuntime.queryInterface(
- XColumnRowRange.class, oObj).getColumns().getCount();
- rows = UnoRuntime.queryInterface(
- XColumnRowRange.class, oObj).getRows().getCount();
-
- if (cols == width + 1 && rows == height + 1) {
- bResult &= true;
- } else {
- bResult = false;
- log.println("After collapseToCurrentRegion() call [2]"
- + " region must have size " + (width+1) + "x"
- + (height + 1) + " but it is " + cols + "x" + rows );
- }
- }
- }
-
tRes.tested("collapseToCurrentRegion()", bResult);
// restore original size
commit 10db9232eaab2c53e84a7521e3f55579ce0c1bef
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 25 15:02:57 2015 +0000
coverity#1326117 Unchecked return value
Change-Id: I448f59fd43d90d3ad42ba55dbadee0664984e53a
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java
index 3518feb..b3fbd4d 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java
@@ -97,7 +97,10 @@ public final class PdbDecoder {
//dis.seek(recOffset[i]);
dis.reset();
- dis.skip(recOffset[i]);
+ int nBytesToSkip = recOffset[i];
+ while (nBytesToSkip > 0) {
+ nBytesToSkip -= dis.skip(nBytesToSkip);
+ }
int len = recOffset[i+1] - recOffset[i];
byte[] bytes = new byte[len];
dis.readFully(bytes);
@@ -122,4 +125,4 @@ public final class PdbDecoder {
return pdb;
}
-}
\ No newline at end of file
+}
commit d6a3c5786b836c6b776c54c949e0cf6cb081a7e5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 25 15:00:22 2015 +0000
coverity#1326446 Dereference null return value
Change-Id: I18b3e0cc30e05e9a53a0f7ae9997b9f190f192f4
diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
index d7dd252..febd65a 100644
--- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
+++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
@@ -144,7 +144,7 @@ public class ParcelContainer implements XNameAccess {
}
String location =
- ScriptMetaData.getLocationPlaceHolder(c.containerUrl, c.getName());
+ ScriptMetaData.getLocationPlaceHolder(c.containerUrl, name);
if (key.equals(location)) {
result = c;
commit cd75c25be836c2a626f375ce3a16dfa6f164c831
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 25 14:56:52 2015 +0000
coverity#1328719 SIC: Inner class could be made static
Change-Id: I88188482af59bb94f1869a1ad4fb3c72c71789b7
diff --git a/qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java b/qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java
index ecf27e2..22fa066 100644
--- a/qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java
@@ -42,7 +42,7 @@ import com.sun.star.util.XModifyListener;
public class _XModifyBroadcaster extends MultiMethodTest {
public XModifyBroadcaster oObj = null;
- protected class TestModifyListener implements XModifyListener {
+ private static class TestModifyListener implements XModifyListener {
public void disposing ( EventObject oEvent ) {}
public void modified (EventObject aEvent ) {}
}
More information about the Libreoffice-commits
mailing list