aboutsummaryrefslogtreecommitdiff
path: root/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets
diff options
context:
space:
mode:
authorMarc R. Hoffmann <hoffmann@mountainminds.com>2015-01-04 18:27:41 +0100
committerMarc R. Hoffmann <hoffmann@mountainminds.com>2015-01-04 18:27:41 +0100
commit7946741470a5c7efc95af2079ad72d334a511b83 (patch)
treede862aec25921ed1fdd7b821425b79887307d24f /org.jacoco.core.test/src/org/jacoco/core/test/validation/targets
parentd31ce3dcc90dead13a1ca8acb0d7a5bfe99e61d6 (diff)
downloadjacoco-7946741470a5c7efc95af2079ad72d334a511b83.tar.gz
Validation test for issue #265.
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/test/validation/targets')
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java
new file mode 100644
index 00000000..804b2b82
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Marc R. Hoffmann - initial API and implementation
+ *
+ *******************************************************************************/
+package org.jacoco.core.test.validation.targets;
+
+import static org.jacoco.core.test.validation.targets.Stubs.nop;
+
+/**
+ * This target uses synchronized blocks which compile to try/catch statements.
+ */
+public class Target12 implements Runnable {
+
+ public void run() {
+ simple();
+ nested();
+ }
+
+ void simple() {
+ synchronized (this) {
+ nop();
+ }
+ }
+
+ void nested() {
+ Object lock1 = new Object();
+ synchronized (lock1) {
+ nop();
+ Object lock2 = new Object();
+ synchronized (lock2) {
+ nop();
+ }
+ nop();
+ }
+
+ }
+
+ public static void main(String[] args) {
+ new Target12().run();
+ }
+
+}