Bug 28702 - Code that hangs 1.1 beta 2
Summary: Code that hangs 1.1 beta 2
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-19 17:58 EST by Ron Bodkin CLA
Modified: 2003-01-07 15:34 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2002-12-19 17:58:15 EST
import java.util.Stack;

 

interface Connection {

            Connection open();

            void close();

}

 

aspect CloseConnectionsCflow percflow(layerEntryMethods()) {

   Stack openConnections;

   pointcut layerMethods() : 

       execution(public * com.example.businessFacade.*.*(..));

   pointcut layerEntryMethods() : 

       layerMethods() && !cflowbelow(layerMethods());

   pointcut openedConnection() : 

       call(* Connection.open(..));

   pointcut layerBoundary() : cflow(layerEntryMethods());

 

   after() returning (Connection conn) : 

           openedConnection() && layerBoundary() {

       openConnections.push(conn);

   }

   after() : layerBoundary() {

       while (!openConnections.empty()) {

           Connection conn = (Connection)openConnections.pop();

           conn.close();

        }

   }

}
Comment 1 Jim Hugunin CLA 2003-01-07 15:34:02 EST
has been fixed in current cvs version and added to test suite (see 
tests/bugs/CloseConnectionsCflow.java)