mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-25 07:29:01 +08:00
7db51521a0
* mauve-libgcj: Activated serialization tests. * gcj/field.h (getModifiers): Mask off unknown flags. * gnu/java/security/provider/SHA.java (munch): Reset buffer to 0 so spurious bits don't cause discrepancies. * java/io/ObjectOutputStream.java: Fixed typo in comment. * java/io/ObjectStreamClass.java: Fixed typos in comments. (lookup): Applied patch from Brian Jones <cbj@gnu.org> to optimize. (hasClassInitializer): Call getDeclaredMethod instead of getMethod. * java/lang/Throwable.java (serialVersionUID): New field. * java/lang/reflect/Modifier.java (ALL_FLAGS): Preserve STRICT if used. * java/lang/reflect/natConstructor.cc (getModifiers): Mask off unknown flags. * java/lang/reflect/natMethod.cc: Ditto. * java/security/Key.java (serialVersionUID): Removed field for now. * java/security/interfaces/DSAPrivateKey.java (serialVersionUID): Ditto. * java/security/interfaces/DSAPublicKey.java (serialVersionUID): Ditto. Serialization mods. From-SVN: r35302
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// natConstructor.cc - Native code for Constructor class.
|
|
|
|
/* Copyright (C) 1999, 2000 Free Software Foundation
|
|
|
|
This file is part of libgcj.
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|
details. */
|
|
|
|
#include <config.h>
|
|
|
|
#include <gcj/cni.h>
|
|
#include <jvm.h>
|
|
|
|
#include <java/lang/reflect/Constructor.h>
|
|
#include <java/lang/reflect/Method.h>
|
|
#include <java/lang/reflect/InvocationTargetException.h>
|
|
#include <java/lang/reflect/Modifier.h>
|
|
#include <java/lang/InstantiationException.h>
|
|
#include <gcj/method.h>
|
|
|
|
jint
|
|
java::lang::reflect::Constructor::getModifiers ()
|
|
{
|
|
// Ignore all unknown flags.
|
|
return _Jv_FromReflectedConstructor (this)->accflags & Modifier::ALL_FLAGS;
|
|
}
|
|
|
|
void
|
|
java::lang::reflect::Constructor::getType ()
|
|
{
|
|
_Jv_GetTypesFromSignature (_Jv_FromReflectedConstructor (this),
|
|
declaringClass,
|
|
¶meter_types,
|
|
NULL);
|
|
}
|
|
|
|
jobject
|
|
java::lang::reflect::Constructor::newInstance (jobjectArray args)
|
|
{
|
|
if (parameter_types == NULL)
|
|
getType ();
|
|
|
|
using namespace java::lang::reflect;
|
|
if (Modifier::isAbstract (declaringClass->getModifiers()))
|
|
JvThrow (new InstantiationException);
|
|
|
|
jmethodID meth = _Jv_FromReflectedConstructor (this);
|
|
// In the constructor case the return type is the type of the
|
|
// constructor.
|
|
return _Jv_CallAnyMethodA (NULL, declaringClass, meth, true,
|
|
parameter_types, args);
|
|
}
|