Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2015-03-05 04:41:23 -0500
committerSarika Sinha2015-03-05 04:41:23 -0500
commit4033dafbeb0b55279a16ddab06d8db5e397f7bb2 (patch)
tree3cb931b4a128efea9f14b3334931555829ab35bd /org.eclipse.debug.examples.ui
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')
-rw-r--r--org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java12
2 files changed, 5 insertions, 10 deletions
diff --git a/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs
index 091dbe0d4..854ba028d 100644
--- a/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs
@@ -35,7 +35,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -110,6 +110,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
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