зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1209574 - Generate constants for non-accessible static final fields; r=snorp
We try to generate a C++ constant for static final fields, but that was failing for inaccessible fields. Now we set the field to be accessible so that we do end up generating a C++ constant.
This commit is contained in:
Родитель
4ab3b96976
Коммит
eb54e04df1
|
@ -392,6 +392,7 @@ public class CodeGenerator {
|
||||||
if (isStatic && isFinal && (type.isPrimitive() || type == String.class)) {
|
if (isStatic && isFinal && (type.isPrimitive() || type == String.class)) {
|
||||||
Object val = null;
|
Object val = null;
|
||||||
try {
|
try {
|
||||||
|
field.setAccessible(true);
|
||||||
val = field.get(null);
|
val = field.get(null);
|
||||||
} catch (final IllegalAccessException e) {
|
} catch (final IllegalAccessException e) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1507,14 +1507,6 @@ auto SQLiteBridgeException::New(mozilla::jni::String::Param a0) -> SQLiteBridgeE
|
||||||
return mozilla::jni::Constructor<New2_t>::Call(nullptr, nullptr, a0);
|
return mozilla::jni::Constructor<New2_t>::Call(nullptr, nullptr, a0);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr char SQLiteBridgeException::SerialVersionUID_t::name[];
|
|
||||||
constexpr char SQLiteBridgeException::SerialVersionUID_t::signature[];
|
|
||||||
|
|
||||||
auto SQLiteBridgeException::SerialVersionUID() -> int64_t
|
|
||||||
{
|
|
||||||
return mozilla::jni::Field<SerialVersionUID_t>::Get(nullptr, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr char Clipboard::name[];
|
constexpr char Clipboard::name[];
|
||||||
|
|
||||||
constexpr char Clipboard::ClearText_t::name[];
|
constexpr char Clipboard::ClearText_t::name[];
|
||||||
|
|
|
@ -3647,21 +3647,7 @@ public:
|
||||||
static auto New(mozilla::jni::String::Param) -> SQLiteBridgeException::LocalRef;
|
static auto New(mozilla::jni::String::Param) -> SQLiteBridgeException::LocalRef;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct SerialVersionUID_t {
|
static const int64_t SerialVersionUID = 1;
|
||||||
typedef SQLiteBridgeException Owner;
|
|
||||||
typedef int64_t ReturnType;
|
|
||||||
typedef int64_t SetterType;
|
|
||||||
typedef mozilla::jni::Args<> Args;
|
|
||||||
static constexpr char name[] = "serialVersionUID";
|
|
||||||
static constexpr char signature[] =
|
|
||||||
"J";
|
|
||||||
static const bool isStatic = true;
|
|
||||||
static const bool isMultithreaded = true;
|
|
||||||
static const mozilla::jni::ExceptionMode exceptionMode =
|
|
||||||
mozilla::jni::ExceptionMode::ABORT;
|
|
||||||
};
|
|
||||||
|
|
||||||
static auto SerialVersionUID() -> int64_t;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче