Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2015-03-05 09:41:23 +0000
committerSarika Sinha2015-03-05 09:41:23 +0000
commit4033dafbeb0b55279a16ddab06d8db5e397f7bb2 (patch)
tree3cb931b4a128efea9f14b3334931555829ab35bd /org.eclipse.debug.examples.ui/src/org
parent25611f0b960f8297cf41ec2a2ffe7d49c22209aa (diff)
downloadeclipse.platform.debug-4033dafbeb0b55279a16ddab06d8db5e397f7bb2.tar.gz
eclipse.platform.debug-4033dafbeb0b55279a16ddab06d8db5e397f7bb2.tar.xz
eclipse.platform.debug-4033dafbeb0b55279a16ddab06d8db5e397f7bb2.zip
Bug 461219 - Compile warnings in official buildI20150305-1200
Diffstat (limited to 'org.eclipse.debug.examples.ui/src/org')
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
index d799e50bf..caa7fea92 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
@@ -127,10 +127,8 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
}
private int findLine(IFile file, String var) throws CoreException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()));
-
int lineNum = 0;
- try {
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()))) {
while(true) {
String line = reader.readLine().trim();
if (line.startsWith("var")) { //$NON-NLS-1$
@@ -144,12 +142,8 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
} catch (IOException e) {
// end of file reached and line wasn't found
return -1;
- } finally {
- try {
- reader.close();
- } catch (IOException e) {}
- }
- return lineNum;
+ }
+ return lineNum;
}
/* (non-Javadoc)

Back to the top