diff options
author | Max Kellermann <max@musicpd.org> | 2018-08-28 13:27:04 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-08-28 13:27:04 +0200 |
commit | 7137ca375afdd258a24f2cb6a50bbac98c16d805 (patch) | |
tree | 3b3006188190e1d0f519b1bfaed0e8aaa7f73c37 /src/java | |
parent | fe2f7a3e5adfb6c6f7d235d21c98e15f4408e58a (diff) | |
parent | 282859a62a4f26093c7d602dbb39a9522d255ce0 (diff) |
Merge branch 'v0.20.x'
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/Class.hxx | 9 | ||||
-rw-r--r-- | src/java/String.cxx | 2 | ||||
-rw-r--r-- | src/java/String.hxx | 3 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/java/Class.hxx b/src/java/Class.hxx index 44425d1b7..82111f01e 100644 --- a/src/java/Class.hxx +++ b/src/java/Class.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Max Kellermann <max.kellermann@gmail.com> + * Copyright (C) 2010-2018 Max Kellermann <max.kellermann@gmail.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,6 +31,7 @@ #define JAVA_CLASS_HXX #include "Ref.hxx" +#include "Exception.hxx" #include <assert.h> @@ -38,7 +39,7 @@ namespace Java { /** * Wrapper for a local "jclass" reference. */ - class Class : public Java::LocalRef<jclass> { + class Class : public LocalRef<jclass> { public: Class(JNIEnv *env, jclass cls) :LocalRef<jclass>(env, cls) {} @@ -68,10 +69,8 @@ namespace Java { assert(name != nullptr); jclass cls = env->FindClass(name); - if (cls == nullptr) { - env->ExceptionClear(); + if (DiscardException(env)) return false; - } Set(env, cls); env->DeleteLocalRef(cls); diff --git a/src/java/String.cxx b/src/java/String.cxx index ec6d7c95c..238d9a16b 100644 --- a/src/java/String.cxx +++ b/src/java/String.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Max Kellermann <max.kellermann@gmail.com> + * Copyright 2010-2018 Max Kellermann <max.kellermann@gmail.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/java/String.hxx b/src/java/String.hxx index 4832a905b..725be69c4 100644 --- a/src/java/String.hxx +++ b/src/java/String.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Max Kellermann <max.kellermann@gmail.com> + * Copyright 2010-2018 Max Kellermann <max.kellermann@gmail.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,7 +34,6 @@ #include <jni.h> -#include <assert.h> #include <stddef.h> namespace Java { |