From 6f76bb72e9d65b5e340736c7a61c2ad047d67686 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 28 May 2009 00:12:47 +0000 Subject: [PATCH] 277959: stack depth must be at least one if there is an exception handler --- tests/bugs165/pr277959/AOPTest.java | 32 +++++++++++++++++++ tests/bugs165/pr277959/CodeAspect.java | 14 ++++++++ .../systemtest/ajc165/Ajc165Tests.java | 4 +++ .../org/aspectj/systemtest/ajc165/ajc165.xml | 5 +++ 4 files changed, 55 insertions(+) create mode 100644 tests/bugs165/pr277959/AOPTest.java create mode 100644 tests/bugs165/pr277959/CodeAspect.java diff --git a/tests/bugs165/pr277959/AOPTest.java b/tests/bugs165/pr277959/AOPTest.java new file mode 100644 index 000000000..593e6a3d5 --- /dev/null +++ b/tests/bugs165/pr277959/AOPTest.java @@ -0,0 +1,32 @@ +/* + * AOPTest + * Copyright (c) 2001-2006 MessageOne Inc. + */ +package example; + +public class AOPTest { + public static void doSomething() {} + + public static void cleanup() { + try { + doSomething(); + doSomething(); + } catch(Exception ex) { + // ignore + } + } + public static void cleanup2() { + try { + + doSomething(); + } catch(Exception ex) { + // ignore + } + } + + + public static void main(String[] args) throws Throwable { + AOPTest.cleanup(); + } +} + diff --git a/tests/bugs165/pr277959/CodeAspect.java b/tests/bugs165/pr277959/CodeAspect.java new file mode 100644 index 000000000..dd3017ace --- /dev/null +++ b/tests/bugs165/pr277959/CodeAspect.java @@ -0,0 +1,14 @@ +import java.lang.Class; +import org.aspectj.lang.reflect.MethodSignature; +import org.aspectj.lang.*; + +public aspect CodeAspect { + pointcut getPointcut() + : execution(public * example.AOPTest.cleanup()); + + Object around() : getPointcut() { + System.out.println("ASPECT WORKING"); + //Just call the underlying method + return proceed(); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java index 9d1a6159b..cd67252a0 100644 --- a/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java @@ -20,6 +20,10 @@ import org.aspectj.weaver.LintMessage; public class Ajc165Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testVerifyError_pr277959() { + runTest("verifyerror"); + } + public void testIfNames_pr277508() { runTest("if method names"); } diff --git a/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml index cacaf1b84..dc8d533c9 100644 --- a/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml +++ b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml @@ -2,6 +2,11 @@ + + + + + -- 2.39.5