summaryrefslogtreecommitdiff
path: root/libjava/classpath/external/jsr166/java/util/concurrent/atomic
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/external/jsr166/java/util/concurrent/atomic')
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java12
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java44
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java12
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java86
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java52
5 files changed, 103 insertions, 103 deletions
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java
index dc4d470c32a..0f723f61362 100644
--- a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java
@@ -103,7 +103,7 @@ public class AtomicInteger extends Number implements java.io.Serializable {
* the actual value was not equal to the expected value.
*/
public final boolean compareAndSet(int expect, int update) {
- return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
+ return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
}
/**
@@ -117,7 +117,7 @@ public class AtomicInteger extends Number implements java.io.Serializable {
* @return true if successful.
*/
public final boolean weakCompareAndSet(int expect, int update) {
- return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
+ return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
}
/**
@@ -216,19 +216,19 @@ public class AtomicInteger extends Number implements java.io.Serializable {
public int intValue() {
- return get();
+ return get();
}
public long longValue() {
- return (long)get();
+ return (long)get();
}
public float floatValue() {
- return (float)get();
+ return (float)get();
}
public double doubleValue() {
- return (double)get();
+ return (double)get();
}
}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
index 102c2a7c9bd..c957bbf3f98 100644
--- a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
@@ -240,15 +240,15 @@ public abstract class AtomicIntegerFieldUpdater<T> {
AtomicIntegerFieldUpdaterImpl(Class<T> tclass, String fieldName) {
Field field = null;
- Class caller = null;
- int modifiers = 0;
+ Class caller = null;
+ int modifiers = 0;
try {
field = tclass.getDeclaredField(fieldName);
- caller = sun.reflect.Reflection.getCallerClass(3);
- modifiers = field.getModifiers();
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
- caller, tclass, null, modifiers);
- sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
} catch(Exception ex) {
throw new RuntimeException(ex);
}
@@ -256,12 +256,12 @@ public abstract class AtomicIntegerFieldUpdater<T> {
Class fieldt = field.getType();
if (fieldt != int.class)
throw new IllegalArgumentException("Must be integer type");
-
+
if (!Modifier.isVolatile(modifiers))
throw new IllegalArgumentException("Must be volatile type");
-
- this.cclass = (Modifier.isProtected(modifiers) &&
- caller != tclass) ? caller : null;
+
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
this.tclass = tclass;
offset = unsafe.objectFieldOffset(field);
}
@@ -269,8 +269,8 @@ public abstract class AtomicIntegerFieldUpdater<T> {
private void fullCheck(T obj) {
if (!tclass.isInstance(obj))
throw new ClassCastException();
- if (cclass != null)
- ensureProtectedAccess(obj);
+ if (cclass != null)
+ ensureProtectedAccess(obj);
}
public boolean compareAndSet(T obj, int expect, int update) {
@@ -298,19 +298,19 @@ public abstract class AtomicIntegerFieldUpdater<T> {
return unsafe.getIntVolatile(obj, offset);
}
- private void ensureProtectedAccess(T obj) {
- if (cclass.isInstance(obj)) {
- return;
- }
- throw new RuntimeException(
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException(
new IllegalAccessException("Class " +
- cclass.getName() +
+ cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
- " using an instance of " +
+ " using an instance of " +
obj.getClass().getName()
- )
- );
- }
+ )
+ );
+ }
}
}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java
index 136dc60fb7d..fa254ba626d 100644
--- a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java
@@ -117,7 +117,7 @@ public class AtomicLong extends Number implements java.io.Serializable {
* the actual value was not equal to the expected value.
*/
public final boolean compareAndSet(long expect, long update) {
- return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
+ return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
}
/**
@@ -131,7 +131,7 @@ public class AtomicLong extends Number implements java.io.Serializable {
* @return true if successful.
*/
public final boolean weakCompareAndSet(long expect, long update) {
- return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
+ return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
}
/**
@@ -230,19 +230,19 @@ public class AtomicLong extends Number implements java.io.Serializable {
public int intValue() {
- return (int)get();
+ return (int)get();
}
public long longValue() {
- return (long)get();
+ return (long)get();
}
public float floatValue() {
- return (float)get();
+ return (float)get();
}
public double doubleValue() {
- return (double)get();
+ return (double)get();
}
}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
index dafd089236e..f6135d1fc84 100644
--- a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
@@ -239,15 +239,15 @@ public abstract class AtomicLongFieldUpdater<T> {
CASUpdater(Class<T> tclass, String fieldName) {
Field field = null;
- Class caller = null;
- int modifiers = 0;
+ Class caller = null;
+ int modifiers = 0;
try {
field = tclass.getDeclaredField(fieldName);
- caller = sun.reflect.Reflection.getCallerClass(3);
- modifiers = field.getModifiers();
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
- caller, tclass, null, modifiers);
- sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
} catch(Exception ex) {
throw new RuntimeException(ex);
}
@@ -259,8 +259,8 @@ public abstract class AtomicLongFieldUpdater<T> {
if (!Modifier.isVolatile(modifiers))
throw new IllegalArgumentException("Must be volatile type");
- this.cclass = (Modifier.isProtected(modifiers) &&
- caller != tclass) ? caller : null;
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
this.tclass = tclass;
offset = unsafe.objectFieldOffset(field);
}
@@ -268,9 +268,9 @@ public abstract class AtomicLongFieldUpdater<T> {
private void fullCheck(T obj) {
if (!tclass.isInstance(obj))
throw new ClassCastException();
- if (cclass != null)
- ensureProtectedAccess(obj);
- }
+ if (cclass != null)
+ ensureProtectedAccess(obj);
+ }
public boolean compareAndSet(T obj, long expect, long update) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
@@ -297,20 +297,20 @@ public abstract class AtomicLongFieldUpdater<T> {
return unsafe.getLongVolatile(obj, offset);
}
- private void ensureProtectedAccess(T obj) {
- if (cclass.isInstance(obj)) {
- return;
- }
- throw new RuntimeException (
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException (
new IllegalAccessException("Class " +
- cclass.getName() +
+ cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
- " using an instance of " +
+ " using an instance of " +
obj.getClass().getName()
- )
- );
- }
+ )
+ );
+ }
}
@@ -322,15 +322,15 @@ public abstract class AtomicLongFieldUpdater<T> {
LockedUpdater(Class<T> tclass, String fieldName) {
Field field = null;
- Class caller = null;
- int modifiers = 0;
+ Class caller = null;
+ int modifiers = 0;
try {
field = tclass.getDeclaredField(fieldName);
- caller = sun.reflect.Reflection.getCallerClass(3);
- modifiers = field.getModifiers();
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
- caller, tclass, null, modifiers);
- sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
} catch(Exception ex) {
throw new RuntimeException(ex);
}
@@ -342,8 +342,8 @@ public abstract class AtomicLongFieldUpdater<T> {
if (!Modifier.isVolatile(modifiers))
throw new IllegalArgumentException("Must be volatile type");
- this.cclass = (Modifier.isProtected(modifiers) &&
- caller != tclass) ? caller : null;
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
this.tclass = tclass;
offset = unsafe.objectFieldOffset(field);
}
@@ -351,9 +351,9 @@ public abstract class AtomicLongFieldUpdater<T> {
private void fullCheck(T obj) {
if (!tclass.isInstance(obj))
throw new ClassCastException();
- if (cclass != null)
- ensureProtectedAccess(obj);
- }
+ if (cclass != null)
+ ensureProtectedAccess(obj);
+ }
public boolean compareAndSet(T obj, long expect, long update) {
if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
@@ -378,7 +378,7 @@ public abstract class AtomicLongFieldUpdater<T> {
}
public void lazySet(T obj, long newValue) {
- set(obj, newValue);
+ set(obj, newValue);
}
public long get(T obj) {
@@ -388,19 +388,19 @@ public abstract class AtomicLongFieldUpdater<T> {
}
}
- private void ensureProtectedAccess(T obj) {
- if (cclass.isInstance(obj)) {
- return;
- }
- throw new RuntimeException (
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException (
new IllegalAccessException("Class " +
- cclass.getName() +
+ cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
- " using an instance of " +
+ " using an instance of " +
obj.getClass().getName()
- )
- );
- }
+ )
+ );
+ }
}
}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
index 5c18eca33cf..24014a9df75 100644
--- a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
@@ -149,7 +149,7 @@ public abstract class AtomicReferenceFieldUpdater<T, V> {
}
private static final class AtomicReferenceFieldUpdaterImpl<T,V>
- extends AtomicReferenceFieldUpdater<T,V> {
+ extends AtomicReferenceFieldUpdater<T,V> {
private static final Unsafe unsafe = Unsafe.getUnsafe();
private final long offset;
private final Class<T> tclass;
@@ -169,19 +169,19 @@ public abstract class AtomicReferenceFieldUpdater<T, V> {
*/
AtomicReferenceFieldUpdaterImpl(Class<T> tclass,
- Class<V> vclass,
- String fieldName) {
+ Class<V> vclass,
+ String fieldName) {
Field field = null;
Class fieldClass = null;
- Class caller = null;
- int modifiers = 0;
+ Class caller = null;
+ int modifiers = 0;
try {
field = tclass.getDeclaredField(fieldName);
- caller = sun.reflect.Reflection.getCallerClass(3);
- modifiers = field.getModifiers();
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
sun.reflect.misc.ReflectUtil.ensureMemberAccess(
- caller, tclass, null, modifiers);
- sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
fieldClass = field.getType();
} catch (Exception ex) {
throw new RuntimeException(ex);
@@ -189,12 +189,12 @@ public abstract class AtomicReferenceFieldUpdater<T, V> {
if (vclass != fieldClass)
throw new ClassCastException();
-
+
if (!Modifier.isVolatile(modifiers))
throw new IllegalArgumentException("Must be volatile type");
- this.cclass = (Modifier.isProtected(modifiers) &&
- caller != tclass) ? caller : null;
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
this.tclass = tclass;
if (vclass == Object.class)
this.vclass = null;
@@ -206,16 +206,16 @@ public abstract class AtomicReferenceFieldUpdater<T, V> {
void targetCheck(T obj) {
if (!tclass.isInstance(obj))
throw new ClassCastException();
- if (cclass != null)
- ensureProtectedAccess(obj);
+ if (cclass != null)
+ ensureProtectedAccess(obj);
}
void updateCheck(T obj, V update) {
if (!tclass.isInstance(obj) ||
(update != null && vclass != null && !vclass.isInstance(update)))
throw new ClassCastException();
- if (cclass != null)
- ensureProtectedAccess(obj);
+ if (cclass != null)
+ ensureProtectedAccess(obj);
}
public boolean compareAndSet(T obj, V expect, V update) {
@@ -257,19 +257,19 @@ public abstract class AtomicReferenceFieldUpdater<T, V> {
return (V)unsafe.getObjectVolatile(obj, offset);
}
- private void ensureProtectedAccess(T obj) {
- if (cclass.isInstance(obj)) {
- return;
- }
- throw new RuntimeException (
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException (
new IllegalAccessException("Class " +
- cclass.getName() +
+ cclass.getName() +
" can not access a protected member of class " +
tclass.getName() +
- " using an instance of " +
+ " using an instance of " +
obj.getClass().getName()
- )
- );
- }
+ )
+ );
+ }
}
}