Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-02-05 03:47:10 -0500
committerMichael Keppler2019-02-05 03:47:10 -0500
commit5782320f342727e3fff68eae13169170f7656125 (patch)
tree6dac701f187e2835acb3a3100ddc76c7afbaecde /org.eclipse.egit.ui.test/src/org
parent83d739c1308dcc5647503ad0153d3ca4b0386ac5 (diff)
downloadegit-5782320f342727e3fff68eae13169170f7656125.tar.gz
egit-5782320f342727e3fff68eae13169170f7656125.tar.xz
egit-5782320f342727e3fff68eae13169170f7656125.zip
Close resources
Found running deepcode.ai on the egit repository. Many of the other suggestions by the tool are not that good and just don't fit to our situation. Change-Id: Ib934a0bcfeda7285824c41fc5ede29dbc847ca9a Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java
index 9a51d6397..a8537e863 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java
@@ -68,7 +68,7 @@ public class MockLogicalResourceMapping extends ResourceMapping {
public ResourceTraversal[] getTraversals(ResourceMappingContext context,
IProgressMonitor monitor) throws CoreException {
SubMonitor sm = SubMonitor.convert(monitor, 3);
- Set<IFile> result = new LinkedHashSet<IFile>();
+ Set<IFile> result = new LinkedHashSet<>();
result.add(file);
try {
List<IFile> dependencies = getDependencies(file, file.getParent());
@@ -103,9 +103,9 @@ public class MockLogicalResourceMapping extends ResourceMapping {
private List<IFile> getDependencies(IStorage storage, IContainer c)
throws CoreException, IOException {
List<IFile> result = new ArrayList<>();
- try (InputStream contents = storage.getContents();) {
- BufferedReader r = new BufferedReader(
- new InputStreamReader(contents, Charset.forName("UTF-8")));
+ try (InputStream contents = storage.getContents();
+ BufferedReader r = new BufferedReader(new InputStreamReader(
+ contents, Charset.forName("UTF-8")))) {
try {
while (true) {
String line = r.readLine();

Back to the top