Skip to content

Commit d54dfbe

Browse files
Degiorgiopeterschrammel
authored andcommitted
Renamed the field 'monitorCount' in 'java.lang.Object.java' to
'cproverMonitorCount'
1 parent 645b049 commit d54dfbe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/java/java/lang/Object.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public class Object {
3434
// lock needed for synchronization in cbmc
3535
// used by monitorenter, monitorexit, wait, and notify
3636
// Not present in the original Object class
37-
public int monitorCount;
37+
public int cproverMonitorCount;
3838

3939
public Object() {
40-
monitorCount = 0;
40+
cproverMonitorCount = 0;
4141
}
4242

4343
public final Class<?> getClass() {
@@ -128,8 +128,8 @@ public static void monitorenter(Object object)
128128
CProver.atomicBegin();
129129
// this assume blocks this execution path in JBMC and simulates
130130
// the thread having to wait because the monitor is not available
131-
CProver.assume(object.monitorCount == 0);
132-
object.monitorCount++;
131+
CProver.assume(object.cproverMonitorCount == 0);
132+
object.cproverMonitorCount++;
133133
CProver.atomicEnd();
134134
}
135135

@@ -138,8 +138,8 @@ public static void monitorenter(Object object)
138138
* It will be called by JBMC when the monitor in this instance
139139
* is being released as a result of either the execution of a
140140
* monitorexit bytecode instruction or the return (normal or exceptional)
141-
* of a synchronized method. It decrements the monitorCounter that had
142-
* been incremented in monitorenter().
141+
* of a synchronized method. It decrements the cproverMonitorCount that
142+
* had been incremented in monitorenter().
143143
*/
144144
public static void monitorexit(Object object)
145145
{
@@ -148,10 +148,10 @@ public static void monitorexit(Object object)
148148
// if (object == null)
149149
// throw new NullPointerException();
150150

151-
// if (object.monitorCount == 0)
151+
// if (object.cproverMonitorCount == 0)
152152
// throw new IllegalMonitorStateException();
153153
CProver.atomicBegin();
154-
object.monitorCount--;
154+
object.cproverMonitorCount--;
155155
CProver.atomicEnd();
156156
}
157157

0 commit comments

Comments
 (0)