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
This commit is contained in:
@@ -755,9 +755,10 @@ public class LocalOfficeConnection
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
java.io.BufferedReader r = new java.io.BufferedReader(
|
|
||||||
new java.io.InputStreamReader(m_in) );
|
|
||||||
try {
|
try {
|
||||||
|
java.io.BufferedReader r = new java.io.BufferedReader(
|
||||||
|
new java.io.InputStreamReader(m_in, "UTF-8") );
|
||||||
|
|
||||||
for ( ; ; ) {
|
for ( ; ; ) {
|
||||||
String s = r.readLine();
|
String s = r.readLine();
|
||||||
if ( s == null ) {
|
if ( s == null ) {
|
||||||
@@ -765,6 +766,8 @@ public class LocalOfficeConnection
|
|||||||
}
|
}
|
||||||
m_print.println(s);
|
m_print.println(s);
|
||||||
}
|
}
|
||||||
|
} catch ( UnsupportedEncodingException e ) {
|
||||||
|
e.printStackTrace( System.err );
|
||||||
} catch ( java.io.IOException e ) {
|
} catch ( java.io.IOException e ) {
|
||||||
e.printStackTrace( System.err );
|
e.printStackTrace( System.err );
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,7 @@ import java.io.File;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -333,9 +334,10 @@ public class Bootstrap {
|
|||||||
new Thread( "Pipe: " + prefix) {
|
new Thread( "Pipe: " + prefix) {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
BufferedReader r = new BufferedReader(
|
|
||||||
new InputStreamReader( in ) );
|
|
||||||
try {
|
try {
|
||||||
|
BufferedReader r = new BufferedReader(
|
||||||
|
new InputStreamReader(in, "UTF-8") );
|
||||||
|
|
||||||
for ( ; ; ) {
|
for ( ; ; ) {
|
||||||
String s = r.readLine();
|
String s = r.readLine();
|
||||||
if ( s == null ) {
|
if ( s == null ) {
|
||||||
@@ -343,6 +345,8 @@ public class Bootstrap {
|
|||||||
}
|
}
|
||||||
out.println( prefix + s );
|
out.println( prefix + s );
|
||||||
}
|
}
|
||||||
|
} catch ( UnsupportedEncodingException e ) {
|
||||||
|
e.printStackTrace( System.err );
|
||||||
} catch ( java.io.IOException e ) {
|
} catch ( java.io.IOException e ) {
|
||||||
e.printStackTrace( System.err );
|
e.printStackTrace( System.err );
|
||||||
}
|
}
|
||||||
|
@@ -310,9 +310,10 @@ final class InstallationFinder {
|
|||||||
StreamGobbler gobbler = new StreamGobbler( proc.getErrorStream() );
|
StreamGobbler gobbler = new StreamGobbler( proc.getErrorStream() );
|
||||||
gobbler.start();
|
gobbler.start();
|
||||||
|
|
||||||
|
try {
|
||||||
// read the which output from standard input stream
|
// read the which output from standard input stream
|
||||||
BufferedReader br = new BufferedReader(
|
BufferedReader br = new BufferedReader(
|
||||||
new InputStreamReader( proc.getInputStream() ) );
|
new InputStreamReader( proc.getInputStream(), "UTF-8" ) );
|
||||||
String line = null;
|
String line = null;
|
||||||
try {
|
try {
|
||||||
while ( ( line = br.readLine() ) != null ) {
|
while ( ( line = br.readLine() ) != null ) {
|
||||||
@@ -350,6 +351,13 @@ final class InstallationFinder {
|
|||||||
// closing standard input stream failed, ignore
|
// closing standard input stream failed, ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch ( UnsupportedEncodingException e ) {
|
||||||
|
// if an Encoding exception is thrown, return <code>null</null>
|
||||||
|
System.err.println( "com.sun.star.lib.loader." +
|
||||||
|
"InstallationFinder::getPathFromWhich: " +
|
||||||
|
"encoding failed: " + e );
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// wait until the which process has terminated
|
// wait until the which process has terminated
|
||||||
@@ -563,12 +571,14 @@ final class InstallationFinder {
|
|||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
BufferedReader br = new BufferedReader(
|
BufferedReader br = new BufferedReader(
|
||||||
new InputStreamReader( m_istream ) );
|
new InputStreamReader( m_istream, "UTF-8" ) );
|
||||||
// read from input stream
|
// read from input stream
|
||||||
while ( br.readLine() != null ) {
|
while ( br.readLine() != null ) {
|
||||||
// don't handle line content
|
// don't handle line content
|
||||||
}
|
}
|
||||||
br.close();
|
br.close();
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
// cannot read from input stream
|
||||||
} catch ( IOException e ) {
|
} catch ( IOException e ) {
|
||||||
// stop reading from input stream
|
// stop reading from input stream
|
||||||
}
|
}
|
||||||
|
@@ -580,7 +580,7 @@ public class APIDescGetter extends DescGetter
|
|||||||
entry.endsWith(sEndsWithCSVName))
|
entry.endsWith(sEndsWithCSVName))
|
||||||
{
|
{
|
||||||
InputStream input = this.getClass().getResourceAsStream("/" + entry);
|
InputStream input = this.getClass().getResourceAsStream("/" + entry);
|
||||||
csvFile = new BufferedReader(new InputStreamReader(input));
|
csvFile = new BufferedReader(new InputStreamReader(input, "UTF-8"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -588,7 +588,7 @@ public class APIDescGetter extends DescGetter
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
InputStream in = con.getInputStream();
|
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)
|
while (true)
|
||||||
{
|
{
|
||||||
String entry = buf.readLine();
|
String entry = buf.readLine();
|
||||||
@@ -602,7 +602,7 @@ public class APIDescGetter extends DescGetter
|
|||||||
module +
|
module +
|
||||||
"/" +
|
"/" +
|
||||||
entry);
|
entry);
|
||||||
csvFile = new BufferedReader(new InputStreamReader(input));
|
csvFile = new BufferedReader(new InputStreamReader(input, "UTF-8"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user