Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatasha Carson2019-01-28 22:47:46 +0000
committerNatasha Carson2019-01-28 23:56:03 +0000
commitcdf66b6641ef4ffbe9da189f96a6744fc2a3f0bd (patch)
treea0245ea173f057821ad7eb45d1e348bbe8b43b43 /org.eclipse.mylyn.tasks.core/src
parent552922712edf3a1c49f00e9662ccac27462cfcff (diff)
downloadorg.eclipse.mylyn.tasks-cdf66b6641ef4ffbe9da189f96a6744fc2a3f0bd.tar.gz
org.eclipse.mylyn.tasks-cdf66b6641ef4ffbe9da189f96a6744fc2a3f0bd.tar.xz
org.eclipse.mylyn.tasks-cdf66b6641ef4ffbe9da189f96a6744fc2a3f0bd.zip
543815: Mylyn should use buffered output streamsR_3_25_0
Buffered output streams and replaced try-finally with try resource Change-Id: I504647dc1a608df3502158eded47a917e9be37df Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=543815 Signed-off-by: Natasha Carson <natasha.carson@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryClientManager.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryClientManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryClientManager.java
index 252373c80..428a1df0d 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryClientManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryClientManager.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.mylyn.tasks.core;
+import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -160,9 +161,8 @@ public abstract class RepositoryClientManager<T, C extends Serializable> impleme
return;
}
- ObjectOutputStream out = null;
- try {
- out = new ObjectOutputStream(new FileOutputStream(cacheFile));
+ try (ObjectOutputStream out = new ObjectOutputStream(
+ new BufferedOutputStream(new FileOutputStream(cacheFile)))) {
out.writeInt(respoitoryConfigurationByUrl.size());
for (String url : respoitoryConfigurationByUrl.keySet()) {
out.writeObject(url);
@@ -170,14 +170,6 @@ public abstract class RepositoryClientManager<T, C extends Serializable> impleme
}
} catch (IOException e) {
handleError("The respository configuration cache could not be written", e); //$NON-NLS-1$
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (IOException e) {
- // ignore
- }
- }
}
}

Back to the top