summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java')
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java44
1 files changed, 22 insertions, 22 deletions
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()
- )
- );
- }
+ )
+ );
+ }
}
}
OpenPOWER on IntegriCloud