src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
Print this page
*** 276,286 ****
caller = sun.reflect.Reflection.getCallerClass(3);
modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
caller, tclass, null, modifiers);
sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
! } catch(Exception ex) {
throw new RuntimeException(ex);
}
Class fieldt = field.getType();
if (fieldt != long.class)
--- 276,286 ----
caller = sun.reflect.Reflection.getCallerClass(3);
modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
caller, tclass, null, modifiers);
sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
! } catch (Exception ex) {
throw new RuntimeException(ex);
}
Class fieldt = field.getType();
if (fieldt != long.class)
*** 329,339 ****
private void ensureProtectedAccess(T obj) {
if (cclass.isInstance(obj)) {
return;
}
! throw new RuntimeException (
new IllegalAccessException("Class " +
cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
" using an instance of " +
--- 329,339 ----
private void ensureProtectedAccess(T obj) {
if (cclass.isInstance(obj)) {
return;
}
! throw new RuntimeException(
new IllegalAccessException("Class " +
cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
" using an instance of " +
*** 359,369 ****
caller = sun.reflect.Reflection.getCallerClass(3);
modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
caller, tclass, null, modifiers);
sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
! } catch(Exception ex) {
throw new RuntimeException(ex);
}
Class fieldt = field.getType();
if (fieldt != long.class)
--- 359,369 ----
caller = sun.reflect.Reflection.getCallerClass(3);
modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
caller, tclass, null, modifiers);
sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
! } catch (Exception ex) {
throw new RuntimeException(ex);
}
Class fieldt = field.getType();
if (fieldt != long.class)
*** 385,395 ****
ensureProtectedAccess(obj);
}
public boolean compareAndSet(T obj, long expect, long update) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
! synchronized(this) {
long v = unsafe.getLong(obj, offset);
if (v != expect)
return false;
unsafe.putLong(obj, offset, update);
return true;
--- 385,395 ----
ensureProtectedAccess(obj);
}
public boolean compareAndSet(T obj, long expect, long update) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
! synchronized (this) {
long v = unsafe.getLong(obj, offset);
if (v != expect)
return false;
unsafe.putLong(obj, offset, update);
return true;
*** 400,410 ****
return compareAndSet(obj, expect, update);
}
public void set(T obj, long newValue) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
! synchronized(this) {
unsafe.putLong(obj, offset, newValue);
}
}
public void lazySet(T obj, long newValue) {
--- 400,410 ----
return compareAndSet(obj, expect, update);
}
public void set(T obj, long newValue) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
! synchronized (this) {
unsafe.putLong(obj, offset, newValue);
}
}
public void lazySet(T obj, long newValue) {
*** 411,430 ****
set(obj, newValue);
}
public long get(T obj) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
! synchronized(this) {
return unsafe.getLong(obj, offset);
}
}
private void ensureProtectedAccess(T obj) {
if (cclass.isInstance(obj)) {
return;
}
! throw new RuntimeException (
new IllegalAccessException("Class " +
cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
" using an instance of " +
--- 411,430 ----
set(obj, newValue);
}
public long get(T obj) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
! synchronized (this) {
return unsafe.getLong(obj, offset);
}
}
private void ensureProtectedAccess(T obj) {
if (cclass.isInstance(obj)) {
return;
}
! throw new RuntimeException(
new IllegalAccessException("Class " +
cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
" using an instance of " +