[hg] main-silver: Must not return inside a finally block - that ...

  • From: Jan Lahoda < >
  • To:
  • Subject: [hg] main-silver: Must not return inside a finally block - that ...
  • Date: Sun, 20 Jan 2013 16:35:46 -0800

changeset 96476cbd5a45 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/96476cbd5a45
description:
        Must not return inside a finally block - that causes any exceptions 
thrown from the try block to be thrown away without any logging.

diffstat:

 parsing.api/src/org/netbeans/modules/parsing/impl/TaskProcessor.java |  8 
+++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (23 lines):

diff --git 
a/parsing.api/src/org/netbeans/modules/parsing/impl/TaskProcessor.java 
b/parsing.api/src/org/netbeans/modules/parsing/impl/TaskProcessor.java
--- a/parsing.api/src/org/netbeans/modules/parsing/impl/TaskProcessor.java
+++ b/parsing.api/src/org/netbeans/modules/parsing/impl/TaskProcessor.java
@@ -555,14 +555,16 @@
             assert !Thread.holdsLock(INTERNAL_LOCK);
             assert parserLock.isHeldByCurrentThread();
             sampler.enableSampling();
+            final long now;
+            final long cancelTime;
             try {
                 task.run(result, event);
             } finally {
-                final long now = System.currentTimeMillis();
-                final long cancelTime = sampler.disableSampling();
+                now = System.currentTimeMillis();
+                cancelTime = sampler.disableSampling();
+            }
                 return cancelTime == 0 ? 0 : now - cancelTime;
             }
-    }
 
     static List<Embedding> callEmbeddingProvider(
             final @NonNull EmbeddingProvider embeddingProvider,

[hg] main-silver: Must not return inside a finally block - that ...

Jan Lahoda 01/21/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close