2442N/A/*
2442N/A * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
2442N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2442N/A *
2442N/A * This code is free software; you can redistribute it and/or modify it
2442N/A * under the terms of the GNU General Public License version 2 only, as
2442N/A * published by the Free Software Foundation. Oracle designates this
2442N/A * particular file as subject to the "Classpath" exception as provided
2442N/A * by Oracle in the LICENSE file that accompanied this code.
2442N/A *
2442N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2442N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2442N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2442N/A * version 2 for more details (a copy is included in the LICENSE file that
2442N/A * accompanied this code).
2442N/A *
2442N/A * You should have received a copy of the GNU General Public License version
2442N/A * 2 along with this work; if not, write to the Free Software Foundation,
2442N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2442N/A *
2442N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2442N/A * or visit www.oracle.com if you need additional information or have any
2442N/A * questions.
2442N/A */
2442N/A
2442N/Apackage sun.reflect;
2442N/A
2442N/Aimport java.lang.reflect.Field;
2442N/A
2442N/Aclass UnsafeStaticBooleanFieldAccessorImpl extends UnsafeStaticFieldAccessorImpl {
2442N/A UnsafeStaticBooleanFieldAccessorImpl(Field field) {
2442N/A super(field);
2442N/A }
2442N/A
2442N/A public Object get(Object obj) throws IllegalArgumentException {
2442N/A return new Boolean(getBoolean(obj));
2442N/A }
2442N/A
2442N/A public boolean getBoolean(Object obj) throws IllegalArgumentException {
2442N/A return unsafe.getBoolean(base, fieldOffset);
2442N/A }
2442N/A
2442N/A public byte getByte(Object obj) throws IllegalArgumentException {
2442N/A throw newGetByteIllegalArgumentException();
2442N/A }
2442N/A
2442N/A public char getChar(Object obj) throws IllegalArgumentException {
2442N/A throw newGetCharIllegalArgumentException();
2442N/A }
2442N/A
2442N/A public short getShort(Object obj) throws IllegalArgumentException {
2442N/A throw newGetShortIllegalArgumentException();
2442N/A }
2442N/A
2442N/A public int getInt(Object obj) throws IllegalArgumentException {
2442N/A throw newGetIntIllegalArgumentException();
2442N/A }
2442N/A
2442N/A public long getLong(Object obj) throws IllegalArgumentException {
2442N/A throw newGetLongIllegalArgumentException();
2442N/A }
2442N/A
2442N/A public float getFloat(Object obj) throws IllegalArgumentException {
2442N/A throw newGetFloatIllegalArgumentException();
2442N/A }
2442N/A
2442N/A public double getDouble(Object obj) throws IllegalArgumentException {
2442N/A throw newGetDoubleIllegalArgumentException();
2442N/A }
2442N/A
2442N/A public void set(Object obj, Object value)
2442N/A throws IllegalArgumentException, IllegalAccessException
2442N/A {
2442N/A if (isFinal) {
throwFinalFieldIllegalAccessException(value);
}
if (value == null) {
throwSetIllegalArgumentException(value);
}
if (value instanceof Boolean) {
unsafe.putBoolean(base, fieldOffset, ((Boolean) value).booleanValue());
return;
}
throwSetIllegalArgumentException(value);
}
public void setBoolean(Object obj, boolean z)
throws IllegalArgumentException, IllegalAccessException
{
if (isFinal) {
throwFinalFieldIllegalAccessException(z);
}
unsafe.putBoolean(base, fieldOffset, z);
}
public void setByte(Object obj, byte b)
throws IllegalArgumentException, IllegalAccessException
{
throwSetIllegalArgumentException(b);
}
public void setChar(Object obj, char c)
throws IllegalArgumentException, IllegalAccessException
{
throwSetIllegalArgumentException(c);
}
public void setShort(Object obj, short s)
throws IllegalArgumentException, IllegalAccessException
{
throwSetIllegalArgumentException(s);
}
public void setInt(Object obj, int i)
throws IllegalArgumentException, IllegalAccessException
{
throwSetIllegalArgumentException(i);
}
public void setLong(Object obj, long l)
throws IllegalArgumentException, IllegalAccessException
{
throwSetIllegalArgumentException(l);
}
public void setFloat(Object obj, float f)
throws IllegalArgumentException, IllegalAccessException
{
throwSetIllegalArgumentException(f);
}
public void setDouble(Object obj, double d)
throws IllegalArgumentException, IllegalAccessException
{
throwSetIllegalArgumentException(d);
}
}