Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
402c8f5f
Kaydet (Commit)
402c8f5f
authored
May 03, 2013
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Java cleanup, close file handles when done with them
Change-Id: I79e6e0b8f53ae6f232c34aa8e833853d2ec24cf0
üst
7cba598a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
67 additions
and
64 deletions
+67
-64
GlobalFile.java
...utionarySolver/src/net/adaptivebox/global/GlobalFile.java
+1
-0
java_fat.java
qadevOOo/runner/base/java_fat.java
+22
-23
FileUpdater.java
scripting/workben/installer/FileUpdater.java
+3
-0
InstUtil.java
scripting/workben/installer/InstUtil.java
+3
-2
ZipData.java
scripting/workben/installer/ZipData.java
+31
-37
TestDataLoader.java
scripting/workben/mod/_scripting/TestDataLoader.java
+3
-2
ActiveSyncDriver.java
...rge/java/org/openoffice/xmerge/util/ActiveSyncDriver.java
+3
-0
Main.java
xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java
+1
-0
No files found.
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalFile.java
Dosyayı görüntüle @
402c8f5f
...
@@ -184,6 +184,7 @@ public class GlobalFile {
...
@@ -184,6 +184,7 @@ public class GlobalFile {
}
}
}
}
}
}
inReader
.
close
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
//showMessage();
//showMessage();
return
null
;
//Uncertain data file error.
return
null
;
//Uncertain data file error.
...
...
qadevOOo/runner/base/java_fat.java
Dosyayı görüntüle @
402c8f5f
...
@@ -511,40 +511,39 @@ public class java_fat implements TestBase
...
@@ -511,40 +511,39 @@ public class java_fat implements TestBase
return
entryList
;
return
entryList
;
}
}
while
(
line
!=
null
)
try
{
{
try
while
(
line
!=
null
)
{
{
if
(!
line
.
startsWith
(
"#"
)
&&
(
line
.
length
()
>
1
))
try
{
{
entryList
.
add
(
line
.
trim
());
if
(!
line
.
startsWith
(
"#"
)
&&
(
line
.
length
()
>
1
))
}
{
entryList
.
add
(
line
.
trim
());
}
line
=
exclusion
.
readLine
();
line
=
exclusion
.
readLine
();
}
catch
(
java
.
io
.
IOException
ioe
)
{
if
(
debug
)
{
System
.
out
.
println
(
"Exception while reading exclusion list"
);
}
}
catch
(
java
.
io
.
IOException
ioe
)
{
if
(
debug
)
{
System
.
out
.
println
(
"Exception while reading exclusion list"
);
}
return
entryList
;
return
entryList
;
}
}
}
}
}
finally
try
{
exclusion
.
close
();
}
catch
(
java
.
io
.
IOException
ioe
)
{
{
if
(
debug
)
try
{
exclusion
.
close
();
}
catch
(
java
.
io
.
IOException
ioe
)
{
{
System
.
out
.
println
(
"Couldn't close file "
+
url
);
}
}
return
entryList
;
}
}
return
entryList
;
return
entryList
;
...
...
scripting/workben/installer/FileUpdater.java
Dosyayı görüntüle @
402c8f5f
...
@@ -42,6 +42,7 @@ public class FileUpdater {
...
@@ -42,6 +42,7 @@ public class FileUpdater {
s
.
trim
();
s
.
trim
();
xmlArray
[
count
]
=
s
;
xmlArray
[
count
]
=
s
;
}
}
reader
.
close
();
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
String
message
=
"\nError reading ProtocolHandler.xcu, please view SFrameworkInstall.log."
;
String
message
=
"\nError reading ProtocolHandler.xcu, please view SFrameworkInstall.log."
;
...
@@ -112,6 +113,7 @@ public class FileUpdater {
...
@@ -112,6 +113,7 @@ public class FileUpdater {
s
.
trim
();
s
.
trim
();
xmlArray
[
count
]
=
s
;
xmlArray
[
count
]
=
s
;
}
}
reader
.
close
();
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
String
message
=
"Error reading script.xlc, please view SFrameworkInstall.log."
;
String
message
=
"Error reading script.xlc, please view SFrameworkInstall.log."
;
...
@@ -184,6 +186,7 @@ public class FileUpdater {
...
@@ -184,6 +186,7 @@ public class FileUpdater {
s
.
trim
();
s
.
trim
();
xmlArray
[
count
]
=
s
;
xmlArray
[
count
]
=
s
;
}
}
reader
.
close
();
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
...
...
scripting/workben/installer/InstUtil.java
Dosyayı görüntüle @
402c8f5f
...
@@ -237,6 +237,7 @@ public class InstUtil {
...
@@ -237,6 +237,7 @@ public class InstUtil {
break
;
break
;
}
}
}
}
reader
.
close
();
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
System
.
out
.
println
(
"Error reading Netbeans location information"
);
System
.
out
.
println
(
"Error reading Netbeans location information"
);
...
@@ -285,6 +286,7 @@ public class InstUtil {
...
@@ -285,6 +286,7 @@ public class InstUtil {
jeditDetails
[
1
]
=
version
;
jeditDetails
[
1
]
=
version
;
}
}
}
}
reader
.
close
();
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
System
.
out
.
println
(
"Error reading Jedit location information"
);
System
.
out
.
println
(
"Error reading Jedit location information"
);
...
@@ -292,7 +294,6 @@ public class InstUtil {
...
@@ -292,7 +294,6 @@ public class InstUtil {
//catch( FileNotFoundException fnfe ) {
//catch( FileNotFoundException fnfe ) {
//System.out.println( "Jedit activity.log FileNotFoundException" );
//System.out.println( "Jedit activity.log FileNotFoundException" );
//}
//}
return
jeditDetails
;
return
jeditDetails
;
}
}
...
@@ -408,7 +409,7 @@ public class InstUtil {
...
@@ -408,7 +409,7 @@ public class InstUtil {
}
}
}
}
}
}
reader
.
close
();
return
results
;
return
results
;
}
}
...
...
scripting/workben/installer/ZipData.java
Dosyayı görüntüle @
402c8f5f
...
@@ -21,13 +21,12 @@ package installer;
...
@@ -21,13 +21,12 @@ package installer;
import
java.io.*
;
import
java.io.*
;
import
javax.swing.*
;
import
javax.swing.*
;
public
class
ZipData
public
class
ZipData
{
{
public
ZipData
(
String
file
)
{
public
ZipData
(
String
file
)
{
}
}
public
boolean
extractEntry
(
String
entry
,
String
destination
,
public
boolean
extractEntry
(
String
entry
,
String
destination
,
JLabel
statusLabel
)
{
JLabel
statusLabel
)
{
OutputStream
out
=
null
;
OutputStream
out
=
null
;
InputStream
in
=
null
;
InputStream
in
=
null
;
...
@@ -35,23 +34,22 @@ public class ZipData
...
@@ -35,23 +34,22 @@ public class ZipData
System
.
out
.
println
(
"Copying: "
+
entry
);
System
.
out
.
println
(
"Copying: "
+
entry
);
System
.
out
.
println
(
"To: "
+
destination
);
System
.
out
.
println
(
"To: "
+
destination
);
if
(
statusLabel
!=
null
)
{
if
(
statusLabel
!=
null
)
{
statusLabel
.
setText
(
"Copying "
+
entry
);
statusLabel
.
setText
(
"Copying "
+
entry
);
}
}
String
entryName
;
String
entryName
;
if
(
entry
.
lastIndexOf
(
"/"
)
!=
-
1
)
{
if
(
entry
.
lastIndexOf
(
"/"
)
!=
-
1
)
{
entryName
=
entry
.
substring
(
entry
.
lastIndexOf
(
"/"
)
+
1
);
entryName
=
entry
.
substring
(
entry
.
lastIndexOf
(
"/"
)
+
1
);
}
}
else
{
else
{
entryName
=
entry
;
entryName
=
entry
;
}
}
String
destName
;
String
destName
;
if
(
destination
.
lastIndexOf
(
File
.
separator
)
!=
-
1
)
{
if
(
destination
.
lastIndexOf
(
File
.
separator
)
!=
-
1
)
{
destName
=
destination
.
substring
(
destination
.
lastIndexOf
(
File
.
separator
)
+
1
);
destName
=
destination
.
substring
(
destination
}
.
lastIndexOf
(
File
.
separator
)
+
1
);
else
{
}
else
{
destName
=
destination
;
destName
=
destination
;
}
}
...
@@ -60,20 +58,6 @@ public class ZipData
...
@@ -60,20 +58,6 @@ public class ZipData
System
.
out
.
println
(
"Unzipping "
+
entry
+
" to "
+
destination
);
System
.
out
.
println
(
"Unzipping "
+
entry
+
" to "
+
destination
);
try
{
out
=
new
FileOutputStream
(
destination
);
}
catch
(
IOException
ioe
)
{
System
.
err
.
println
(
"Error opening "
+
destination
+
": "
+
ioe
.
getMessage
());
if
(
statusLabel
!=
null
)
statusLabel
.
setText
(
"Error opening"
+
destination
+
"see SFramework.log for more information"
);
return
false
;
}
if
(
entry
.
startsWith
(
"/"
)
==
false
)
if
(
entry
.
startsWith
(
"/"
)
==
false
)
entry
=
"/"
+
entry
;
entry
=
"/"
+
entry
;
...
@@ -82,8 +66,21 @@ public class ZipData
...
@@ -82,8 +66,21 @@ public class ZipData
System
.
err
.
println
(
"File "
+
entry
+
" not found in jar file"
);
System
.
err
.
println
(
"File "
+
entry
+
" not found in jar file"
);
if
(
statusLabel
!=
null
)
if
(
statusLabel
!=
null
)
statusLabel
.
setText
(
"Failed extracting "
+
entry
+
statusLabel
.
setText
(
"Failed extracting "
+
entry
"see SFramework.log for more information"
);
+
"see SFramework.log for more information"
);
return
false
;
}
try
{
out
=
new
FileOutputStream
(
destination
);
}
catch
(
IOException
ioe
)
{
System
.
err
.
println
(
"Error opening "
+
destination
+
": "
+
ioe
.
getMessage
());
if
(
statusLabel
!=
null
)
statusLabel
.
setText
(
"Error opening"
+
destination
+
"see SFramework.log for more information"
);
return
false
;
return
false
;
}
}
...
@@ -94,22 +91,19 @@ public class ZipData
...
@@ -94,22 +91,19 @@ public class ZipData
while
((
len
=
in
.
read
(
bytes
))
!=
-
1
)
while
((
len
=
in
.
read
(
bytes
))
!=
-
1
)
out
.
write
(
bytes
,
0
,
len
);
out
.
write
(
bytes
,
0
,
len
);
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
System
.
err
.
println
(
"Error writing "
+
destination
+
": "
System
.
err
.
println
(
"Error writing "
+
destination
+
": "
+
+
ioe
.
getMessage
());
ioe
.
getMessage
());
if
(
statusLabel
!=
null
)
if
(
statusLabel
!=
null
)
statusLabel
.
setText
(
"Failed writing "
+
destination
+
statusLabel
.
setText
(
"Failed writing "
+
destination
"see SFramework.log for more information"
);
+
"see SFramework.log for more information"
);
return
false
;
return
false
;
}
}
finally
{
finally
{
try
{
try
{
in
.
close
();
in
.
close
();
out
.
close
();
out
.
close
();
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
}
}
}
}
return
true
;
return
true
;
...
...
scripting/workben/mod/_scripting/TestDataLoader.java
Dosyayı görüntüle @
402c8f5f
...
@@ -44,10 +44,9 @@ public class TestDataLoader {
...
@@ -44,10 +44,9 @@ public class TestDataLoader {
if
(!
f
.
exists
())
if
(!
f
.
exists
())
return
;
return
;
BufferedReader
in
;
try
{
try
{
in
=
new
BufferedReader
(
new
FileReader
(
f
));
BufferedReader
in
=
new
BufferedReader
(
new
FileReader
(
f
));
String
s
,
previous
,
current
;
String
s
,
previous
,
current
;
ArrayList
<
Parameters
>
list
=
new
ArrayList
<
Parameters
>(
11
);
ArrayList
<
Parameters
>
list
=
new
ArrayList
<
Parameters
>(
11
);
...
@@ -59,6 +58,7 @@ public class TestDataLoader {
...
@@ -59,6 +58,7 @@ public class TestDataLoader {
list
.
add
(
getParameters
(
st
));
list
.
add
(
getParameters
(
st
));
}
}
else
{
else
{
in
.
close
();
return
;
return
;
}
}
...
@@ -77,6 +77,7 @@ public class TestDataLoader {
...
@@ -77,6 +77,7 @@ public class TestDataLoader {
}
}
tEnv
.
addObjRelation
(
previous
,
list
);
tEnv
.
addObjRelation
(
previous
,
list
);
in
.
close
();
}
}
catch
(
IOException
ioe
)
{
catch
(
IOException
ioe
)
{
}
}
...
...
xmerge/source/xmerge/java/org/openoffice/xmerge/util/ActiveSyncDriver.java
Dosyayı görüntüle @
402c8f5f
...
@@ -113,16 +113,19 @@ public class ActiveSyncDriver {
...
@@ -113,16 +113,19 @@ public class ActiveSyncDriver {
dataOut
=
conv
.
convert
();
dataOut
=
conv
.
convert
();
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
fos
.
close
();
return
false
;
return
false
;
}
}
if
(
dataOut
==
null
)
{
if
(
dataOut
==
null
)
{
fos
.
close
();
return
false
;
return
false
;
}
}
// Get the document and write it out.
// Get the document and write it out.
Document
doc
=
(
Document
)
dataOut
.
getDocumentEnumeration
().
next
();
Document
doc
=
(
Document
)
dataOut
.
getDocumentEnumeration
().
next
();
if
(
doc
==
null
)
{
if
(
doc
==
null
)
{
fos
.
close
();
return
false
;
return
false
;
}
}
...
...
xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java
Dosyayı görüntüle @
402c8f5f
...
@@ -142,6 +142,7 @@ class MyHandler implements HttpHandler {
...
@@ -142,6 +142,7 @@ class MyHandler implements HttpHandler {
byte
[]
data
=
new
byte
[(
int
)
fileRequest
.
length
()];
byte
[]
data
=
new
byte
[(
int
)
fileRequest
.
length
()];
FileInputStream
fr
=
new
FileInputStream
(
fileRequest
);
FileInputStream
fr
=
new
FileInputStream
(
fileRequest
);
int
count
=
fr
.
read
(
data
);
int
count
=
fr
.
read
(
data
);
fr
.
close
();
//set the Content-type header
//set the Content-type header
Headers
h
=
xchange
.
getResponseHeaders
();
Headers
h
=
xchange
.
getResponseHeaders
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment