Skip to content

Problem with enforce #188

@kheradmand

Description

@kheradmand

I have a very simple mop file that enforces a thread schedule:

package mop;

enforce myEnforce() {
    event one before():
        execution(* *run(..)) && threadName("Thread-1") {
            System.out.println("one");
        }
    event two before():
        execution(* *run(..)) && threadName("Thread-2") {
            System.out.println("two");
        }
    ere : one two

    @fail {
        System.out.println("failed");
    }


}

when I try to generate agent for this file I get the following error:

javamop -agent enforce.mop
-Processing 1 specification(s)
 enforce.rvm is generated
 enforceMonitorAspect.aj is generated
-Processing 1 specification(s)
 enforceRuntimeMonitor.java is generated
(ajc) Failed to produce aop-ajc.xml

Also when I try to use ajc to instrument my code, I get the following:

/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:37 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
cloned_monitor_condition_satisfied = clonedMonitor.Prop_1_event_one();
^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:38 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
if (!cloned_monitor_condition_satisfied) {
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:76 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
cloned_monitor_condition_satisfied = clonedMonitor.Prop_1_event_two();
^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:77 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
if (!cloned_monitor_condition_satisfied) {
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:292 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
cloned_monitor_condition_satisfied = clonedMonitor.Prop_1_event_one();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:293 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
if (!cloned_monitor_condition_satisfied) {
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:338 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
cloned_monitor_condition_satisfied = clonedMonitor.Prop_1_event_two();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:339 [error] cloned_monitor_condition_satisfied cannot be resolved to a variable
if (!cloned_monitor_condition_satisfied) {
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:400 [error] myEnforceRuntimeMonitor cannot be resolved
myEnforceRuntimeMonitor.startDeadlockDetection();
^^^^^^^^^^^^^^^^^^^^
/Users/Ali/FSL/replay/example/enforceMonitorAspect.aj:406 [error] myEnforce_ThreadMonitor_ThreadSet cannot be resolved
myEnforce_ThreadMonitor_ThreadSet.add(t);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

10 errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions