### LIST OF ALL ORIGINAL POINTCUTS IN SPACEWAR CODE ### ### Annotations show: ### - where each pointcut is called from ### - how Open Modules would handle the case (OM:) ### - any other relevant notes ### ### "requires pointcut interface" means that a pointcut would ### have to be defined in the files where the method(s) being called ### are defined. ### ### SUMMARY ### - Debug.java doesn't fit with Open Modules ### - 6 pointcuts require a pointcut interface ### - 4 pointcuts are valid unchanged ### - no problem with context being exposed ### - Registry pointcut is wierd - not clear how it could be redefined Debug.java ### Hopelessly breaks encapsulation ### Encapsulation is simply not relevant here ### No detailed study is performed for this file call(SWFrame+.new(..)) pointcut allConstructorsCut(): call((spacewar.* && !(Debug+ || InfoWin+)).new(..)); pointcut allInitializationsCut(): initialization((spacewar.* && !(Debug+ || InfoWin+)).new(..)); pointcut allMethodsCut(): execution(* (spacewar.* && !(Debug+ || InfoWin+)).*(..)); call(void clockTick()) && (target(obj) && (target(Game) || target(Registry) || target(SpaceObject))) target(registry) && (call(void register(..)) || call(void unregister(..))) { call(void Ship.fire()) call(void Ship.handleCollision(SpaceObject)) && target(ship) && args(obj) execution(void Ship.bounce(Ship, Ship)) && args(shipA, shipB) call(void Ship.inflictDamage(double)) && target(ship) && args(amount) Display1.java call(Ship Game.newShip(Pilot)) && args(pilot) ### called from Game.java and Robot.java ### OM: requires pointcut interface Display2.java call(Ship Game.newShip(Pilot)) && args(pilot) ### called from Game.java and Robot.java ### OM: requires pointcut interface Display.java call(Game+.new(String)) && args(mode) ### called from Game.java ### OM: requires pointcut interface call(Player+.new(..)) ### called from Game.java ### OM: no change necessary call(Display+.new(..)) ### called from Display.java ### OM: requires pointcut interface call(void setSize(..)) && target(display) ### called from SWFrame.java ### OM: no change necessary call(void Game.clockTick()) ### called from Timer.java ### OM: no change necessary GameSynchronization.java protected pointcut synchronizationPoint(): call(void Game.handleCollisions(..)) || call(Ship Game.newShip(..)); ### called from Game.java and Robot.java ### OM: requires pointcut interface Registry.java (call(void Registry.register(SpaceObject)) || call(void Registry.unregister(SpaceObject))) && !(within(SpaceObject) && (withincode(new(..)) || withincode(void die()))) { ### Wierd case: within/withincode violates encapsulation ### boundary of global code ### OM: Would have to be modified, not clear how RegistrySynchronization.java protected pointcut synchronizationPoint(): call(void Registry.register(..)) || call(void Registry.unregister(..)) || call(SpaceObject[] Registry.getObjects(..)) || call(Ship[] Registry.getShips(..)); ### called from various places, including Registry.java ### OM: requires pointcut interface Ship.java pointcut helmCommandsCut(Ship ship): target(ship) && ( call(void rotate(int)) || call(void thrust(boolean)) || call(void fire()) ); ### example of pointcut interface ### used in EnsureShipIsAlive.java ### defined in same file as called functions ### OM: no change necessary