[Libreoffice-commits] core.git: 11 commits - bean/com javaunohelper/com nlpsolver/src odk/source qadevOOo/runner qadevOOo/tests scripting/java swext/mediawiki xmerge/source
Caolán McNamara
caolanm at redhat.com
Thu Oct 15 06:26:30 PDT 2015
bean/com/sun/star/comp/beans/LocalOfficeConnection.java | 7 -
javaunohelper/com/sun/star/comp/helper/Bootstrap.java | 8 -
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java | 2
odk/source/com/sun/star/lib/loader/InstallationFinder.java | 70 +++++-----
qadevOOo/runner/helper/APIDescGetter.java | 6
qadevOOo/tests/java/ifc/awt/_XCurrencyField.java | 5
qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java | 10 -
scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java | 18 +-
scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java | 9 +
scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java | 7 -
swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java | 2
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java | 4
xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java | 41 ++---
13 files changed, 99 insertions(+), 90 deletions(-)
New commits:
commit 5baef3adfe47407a16f219760554ced678cb0842
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 13:13:26 2015 +0100
coverity#1326266 Explicit null dereferenced
Change-Id: Ic6971a9006f82528a9943f8d425389545403162a
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java
index f83b43b..7e97033 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java
@@ -65,34 +65,23 @@ public final class Driver {
* @param args The argument passed on the command line.
*/
public static void main(String args[]) {
-
- // Register jarfiles
- String propFile = "ConverterInfoList.properties";
- ConverterInfoList cil = null;
try {
- cil = new ConverterInfoList(propFile);
- } catch (Exception e) {
- System.out.println("\nCannot not load " + propFile +
- " property file");
- }
+ // Register jarfiles
+ String propFile = "ConverterInfoList.properties";
+ ConverterInfoList cil = new ConverterInfoList(propFile);
- Iterator<ConverterInfo> jarInfoEnumeration;
- ConverterInfoReader cir;
-
- Iterator<String> jarFileEnum = cil.getJarFileEnum();
- while (jarFileEnum.hasNext()) {
- String jarName = jarFileEnum.next();
- try {
- cir = new ConverterInfoReader(jarName, false);
- jarInfoEnumeration = cir.getConverterInfoEnumeration();
- ConverterInfoMgr.addPlugIn(jarInfoEnumeration);
- } catch (Exception e) {
- System.out.println("\nCannot not load <" + jarName +
- "> from the <" + propFile + "> property file");
+ Iterator<String> jarFileEnum = cil.getJarFileEnum();
+ while (jarFileEnum.hasNext()) {
+ String jarName = jarFileEnum.next();
+ try {
+ ConverterInfoReader cir = new ConverterInfoReader(jarName, false);
+ Iterator<ConverterInfo> jarInfoEnumeration = cir.getConverterInfoEnumeration();
+ ConverterInfoMgr.addPlugIn(jarInfoEnumeration);
+ } catch (Exception e) {
+ System.out.println("\nCannot not load <" + jarName +
+ "> from the <" + propFile + "> property file");
+ }
}
- }
-
- try {
Driver app = new Driver();
app.parseCommandLine(args);
@@ -293,4 +282,4 @@ public final class Driver {
String str = zipName.toLowerCase();
return str.endsWith("sxw") || zipName.endsWith("sxc");
}
-}
\ No newline at end of file
+}
commit 21c30f6e416ba25908e9633733a09ba38b8e1a2a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 13:10:49 2015 +0100
coverity#1326262 Dereference after null check
Change-Id: I2c426e140ff3fde2ffaa2c5b6fc676d8d77e6afa
diff --git a/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java b/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java
index 4062893..33b082f 100644
--- a/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java
+++ b/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java
@@ -139,9 +139,9 @@ public class _XMultiLayerStratum extends MultiMethodTest {
if (aLayer == null) {
log.println("\treturned Layer is NULL -- FAILED");
+ } else {
+ res &= checkLayer(aLayer);
}
-
- res &= checkLayer(aLayer);
} catch (com.sun.star.configuration.backend.BackendAccessException e) {
log.println("unexpected Exception -- FAILED");
res = false;
commit 5e5f3a3b0f58ac97fd3744cca46ed96e7031299e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 13:10:17 2015 +0100
coverity#1326261 Dereference after null check
Change-Id: If6d30d9d6217917dc577b35b9d17f1cc6e4566a9
diff --git a/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java b/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java
index 0bbadd2..4062893 100644
--- a/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java
+++ b/qadevOOo/tests/java/ifc/configuration/backend/_XMultiLayerStratum.java
@@ -49,9 +49,9 @@ public class _XMultiLayerStratum extends MultiMethodTest {
if (aLayer == null) {
log.println("\treturned Layer is NULL -- FAILED");
+ } else {
+ res &= checkLayer(aLayer);
}
-
- res &= checkLayer(aLayer);
} catch (com.sun.star.configuration.backend.BackendAccessException e) {
log.println("unexpected Exception -- FAILED");
res = false;
@@ -300,4 +300,4 @@ public class _XMultiLayerStratum extends MultiMethodTest {
return res;
}
-}
\ No newline at end of file
+}
commit 7c465e7f9e8b5c34a4926fb0de84de70aee8f37d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 13:08:01 2015 +0100
coverity#1326260 Explicit null dereferenced
Change-Id: I75b9cb661a7a45304bf32395ad980f83621f4612
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
index fbb53f9..16bb7e8 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
@@ -247,7 +247,7 @@ public abstract class BaseNLPSolver extends WeakBase
int lastSheet = -1, lastRow = -1;
for (int i = 0; i < m_variableCount; i++) {
if (lastSheet == m_variables[i].Sheet && lastRow == m_variables[i].Row &&
- currentRow.EndCol == m_variables[i].Column - 1)
+ currentRow != null && currentRow.EndCol == m_variables[i].Column - 1)
currentRow.EndCol++;
else {
currentRow = new RowInfo(m_variables[i].Sheet, m_variables[i].Row);
commit eacf46e60babff61370dd5e5a4d3bc73fd04d184
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 13:05:12 2015 +0100
coverity#1326241 Dereference after null check
Change-Id: I54c00e1d4e5ebccf141293cd97d99efeebda1083
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java
index ad9e2ca..e1f1aac 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java
@@ -308,7 +308,7 @@ public class WikiEditSettingDialog extends WikiDialog
null,
false );
}
- } while ( sRedirectURL.length() > 0 );
+ } while (sRedirectURL != null && sRedirectURL.length() > 0);
}
catch ( WikiCancelException ce )
{
commit 585757d3fe0ae9f796042d75e38b6b1226cdd4a5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 13:02:56 2015 +0100
coverity#1326240 Explicit null dereferenced
Change-Id: Ic84b5fbff0fbd7b8a750a7e40f2dffafe868b5d5
diff --git a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
index 868af08..17064de 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
@@ -145,8 +145,13 @@ public class ProviderBrowseNode extends PropertySet implements
result = false;
}
- LogUtils.DEBUG("***** ProviderBrowseNode.hasChildNodes(): " + "name=" + name +
+ if (container == null) {
+ LogUtils.DEBUG("***** ProviderBrowseNode.hasChildNodes(): " + "name=" + name +
+ ", path=<none>, result=" + result);
+ } else {
+ LogUtils.DEBUG("***** ProviderBrowseNode.hasChildNodes(): " + "name=" + name +
", path=" + container.getParcelContainerDir() + ", result=" + result);
+ }
return result;
}
@@ -256,4 +261,4 @@ public class ProviderBrowseNode extends PropertySet implements
public boolean hasProperty(String aName) {
return false;
}
-}
\ No newline at end of file
+}
commit f1e4e73dfc55ab5a2d2e53b9e64bb012dedf5873
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 13:00:47 2015 +0100
coverity#1326238 Explicit null dereferenced
Change-Id: Id02dcf1a1fac22eae0a2e01596521eefee9ecbf3
diff --git a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
index 71535e1..abe00e1 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
@@ -20,7 +20,10 @@ package com.sun.star.script.framework.browse;
import com.sun.star.beans.XIntrospectionAccess;
+import com.sun.star.container.NoSuchElementException;
+
import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lib.uno.helper.PropertySet;
@@ -62,19 +65,14 @@ public class ParcelBrowseNode extends PropertySet implements
public boolean renamable = true;
public ParcelBrowseNode(ScriptProvider provider, ParcelContainer container,
- String parcelName) {
+ String parcelName) throws
+ com.sun.star.container.NoSuchElementException,
+ com.sun.star.lang.WrappedTargetException {
this.provider = provider;
this.container = container;
- // TODO decide whether exception is propagated out or not
- try {
- this.parcel = (Parcel)this.container.getByName(parcelName);
- } catch (Exception e) {
- LogUtils.DEBUG("** Exception: " + e);
- LogUtils.DEBUG(" ** Failed to get parcel named " + parcelName +
- " from container");
- }
+ this.parcel = (Parcel)this.container.getByName(parcelName);
registerProperty("Deletable", new Type(boolean.class), (short)0, "deletable");
registerProperty("Editable", new Type(boolean.class), (short)0, "editable");
@@ -314,4 +312,4 @@ public class ParcelBrowseNode extends PropertySet implements
public boolean hasProperty(String aName) {
return false;
}
-}
\ No newline at end of file
+}
commit 9fd8c18948dda3559f01073996804a5ab66b34e1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 12:56:29 2015 +0100
coverity#1326237 Explicit null dereferenced
Change-Id: Ic3ab796da48e28efaf1628f28b8632dd00c041b2
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java
index 9d6ddbc..bfd7fb3 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java
@@ -494,7 +494,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants,
int newCol = decoder.getColNumber();
// Check to see if some columns were skipped
- if (newCol != col) {
+ if (newCol != col && rowElement != null) {
// How many columns have we skipped?
int numColsSkipped = newCol - col;
@@ -738,4 +738,4 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants,
}
}
}
-}
\ No newline at end of file
+}
commit 52e8a8062852c10cb8f37402a97f5475db78b472
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 12:54:13 2015 +0100
coverity#1326236 Explicit null dereferenced
Change-Id: Ic89c9b39f5f9c260581130da528bc0f514d4ef06
diff --git a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java
index 8433203..2d293be 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java
@@ -144,17 +144,16 @@ public class ScriptBrowseNode extends PropertySet implements
public void updateURI(Parcel p) {
parent = p;
- ScriptMetaData data = null;
try {
- data = (ScriptMetaData)parent.getByName(name);
+ ScriptMetaData data = (ScriptMetaData)parent.getByName(name);
+ uri = data.getShortFormScriptURL();
}
// TODO fix exception types to be caught here, should we rethrow?
catch (Exception e) {
LogUtils.DEBUG("** caught exception getting script data for " + name +
" ->" + e.toString());
}
- uri = data.getShortFormScriptURL();
}
// implementation of XInvocation interface
@@ -301,4 +300,4 @@ public class ScriptBrowseNode extends PropertySet implements
public boolean hasProperty(String aName) {
return false;
}
-}
\ No newline at end of file
+}
commit 528d2ce57ac5736860b69d9a2f414daa79b98794
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 12:46:50 2015 +0100
see if this will silence cid#1326879 FE: Test for floating point equality
Change-Id: I1b5cdad7bda19c7cab19b062ad15cf67282ecefb
diff --git a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
index 01bb603..3b03b86 100644
--- a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
+++ b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
@@ -154,9 +154,10 @@ public class _XCurrencyField extends MultiMethodTest {
requiredMethod("getFirst()");
boolean result = true;
- oObj.setFirst(first + 1.1);
+ double value = first + 1.1;
+ oObj.setFirst(value);
double ret = oObj.getFirst();
- result = ret == first + 1.1;
+ result = ret == value;
tRes.tested("setFirst()", result);
}
commit ab22d11279db912f1b69a48b0fa676972b189aea
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 15 12:04:03 2015 +0100
coverity#1326731 Dm: Dubious method used
and
coverity#1326732 Dm: Dubious method used
coverity#1326734 Dm: Dubious method used
coverity#1326735 Dm: Dubious method used
coverity#1326739 Dm: Dubious method used
Change-Id: Id9d39decf7442b503079ebcfe8c881f0f2fe3eb3
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
index 70d51df..d58a30f 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
@@ -755,9 +755,10 @@ public class LocalOfficeConnection
@Override
public void run() {
- java.io.BufferedReader r = new java.io.BufferedReader(
- new java.io.InputStreamReader(m_in) );
try {
+ java.io.BufferedReader r = new java.io.BufferedReader(
+ new java.io.InputStreamReader(m_in, "UTF-8") );
+
for ( ; ; ) {
String s = r.readLine();
if ( s == null ) {
@@ -765,6 +766,8 @@ public class LocalOfficeConnection
}
m_print.println(s);
}
+ } catch ( UnsupportedEncodingException e ) {
+ e.printStackTrace( System.err );
} catch ( java.io.IOException e ) {
e.printStackTrace( System.err );
}
diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
index 70328ce..a36f16c 100644
--- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
+++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
@@ -38,6 +38,7 @@ import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
@@ -333,9 +334,10 @@ public class Bootstrap {
new Thread( "Pipe: " + prefix) {
@Override
public void run() {
- BufferedReader r = new BufferedReader(
- new InputStreamReader( in ) );
try {
+ BufferedReader r = new BufferedReader(
+ new InputStreamReader(in, "UTF-8") );
+
for ( ; ; ) {
String s = r.readLine();
if ( s == null ) {
@@ -343,6 +345,8 @@ public class Bootstrap {
}
out.println( prefix + s );
}
+ } catch ( UnsupportedEncodingException e ) {
+ e.printStackTrace( System.err );
} catch ( java.io.IOException e ) {
e.printStackTrace( System.err );
}
diff --git a/odk/source/com/sun/star/lib/loader/InstallationFinder.java b/odk/source/com/sun/star/lib/loader/InstallationFinder.java
index d1f8738..b04b6f8 100644
--- a/odk/source/com/sun/star/lib/loader/InstallationFinder.java
+++ b/odk/source/com/sun/star/lib/loader/InstallationFinder.java
@@ -310,45 +310,53 @@ final class InstallationFinder {
StreamGobbler gobbler = new StreamGobbler( proc.getErrorStream() );
gobbler.start();
- // read the which output from standard input stream
- BufferedReader br = new BufferedReader(
- new InputStreamReader( proc.getInputStream() ) );
- String line = null;
try {
- while ( ( line = br.readLine() ) != null ) {
- if ( path == null ) {
- // get the path from the which output
- int index = line.lastIndexOf( SOFFICE );
- if ( index != -1 ) {
- int end = index + SOFFICE.length();
- for ( int i = 0; i <= index; i++ ) {
- File file = new File( line.substring( i, end ) );
- try {
- if ( file.exists() ) {
- // resolve symlink
- path = file.getCanonicalFile().getParent();
- if ( path != null )
- break;
+ // read the which output from standard input stream
+ BufferedReader br = new BufferedReader(
+ new InputStreamReader( proc.getInputStream(), "UTF-8" ) );
+ String line = null;
+ try {
+ while ( ( line = br.readLine() ) != null ) {
+ if ( path == null ) {
+ // get the path from the which output
+ int index = line.lastIndexOf( SOFFICE );
+ if ( index != -1 ) {
+ int end = index + SOFFICE.length();
+ for ( int i = 0; i <= index; i++ ) {
+ File file = new File( line.substring( i, end ) );
+ try {
+ if ( file.exists() ) {
+ // resolve symlink
+ path = file.getCanonicalFile().getParent();
+ if ( path != null )
+ break;
+ }
+ } catch ( SecurityException e ) {
+ return null;
}
- } catch ( SecurityException e ) {
- return null;
}
}
}
}
+ } catch ( IOException e ) {
+ // if an I/O exception is thrown, return <code>null</null>
+ System.err.println( "com.sun.star.lib.loader." +
+ "InstallationFinder::getPathFromWhich: " +
+ "reading which command output failed: " + e );
+ return null;
+ } finally {
+ try {
+ br.close();
+ } catch ( IOException e ) {
+ // closing standard input stream failed, ignore
+ }
}
- } catch ( IOException e ) {
- // if an I/O exception is thrown, return <code>null</null>
+ } catch ( UnsupportedEncodingException e ) {
+ // if an Encoding exception is thrown, return <code>null</null>
System.err.println( "com.sun.star.lib.loader." +
"InstallationFinder::getPathFromWhich: " +
- "reading which command output failed: " + e );
+ "encoding failed: " + e );
return null;
- } finally {
- try {
- br.close();
- } catch ( IOException e ) {
- // closing standard input stream failed, ignore
- }
}
try {
@@ -563,12 +571,14 @@ final class InstallationFinder {
public void run() {
try {
BufferedReader br = new BufferedReader(
- new InputStreamReader( m_istream ) );
+ new InputStreamReader( m_istream, "UTF-8" ) );
// read from input stream
while ( br.readLine() != null ) {
// don't handle line content
}
br.close();
+ } catch (UnsupportedEncodingException e) {
+ // cannot read from input stream
} catch ( IOException e ) {
// stop reading from input stream
}
diff --git a/qadevOOo/runner/helper/APIDescGetter.java b/qadevOOo/runner/helper/APIDescGetter.java
index 60304c8..55a2698 100644
--- a/qadevOOo/runner/helper/APIDescGetter.java
+++ b/qadevOOo/runner/helper/APIDescGetter.java
@@ -580,7 +580,7 @@ public class APIDescGetter extends DescGetter
entry.endsWith(sEndsWithCSVName))
{
InputStream input = this.getClass().getResourceAsStream("/" + entry);
- csvFile = new BufferedReader(new InputStreamReader(input));
+ csvFile = new BufferedReader(new InputStreamReader(input, "UTF-8"));
break;
}
}
@@ -588,7 +588,7 @@ public class APIDescGetter extends DescGetter
else
{
InputStream in = con.getInputStream();
- java.io.BufferedReader buf = new java.io.BufferedReader(new InputStreamReader(in));
+ java.io.BufferedReader buf = new java.io.BufferedReader(new InputStreamReader(in, "UTF-8"));
while (true)
{
String entry = buf.readLine();
@@ -602,7 +602,7 @@ public class APIDescGetter extends DescGetter
module +
"/" +
entry);
- csvFile = new BufferedReader(new InputStreamReader(input));
+ csvFile = new BufferedReader(new InputStreamReader(input, "UTF-8"));
break;
}
}
More information about the Libreoffice-commits
mailing list