Skip to content

Commit 1c33679

Browse files
LeviticusMBjoeferner
authored andcommitted
Fixed methodAmbigious tests for ibm-semeru-open-11.jdk.
1 parent b679dd1 commit 1c33679

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/utils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,15 +797,16 @@ jobject javaFindMethod(JNIEnv *env, jclass clazz, const std::string& methodName,
797797
std::string methodSig = methodName.substr(parenLoc);
798798
std::string methodRealName = methodName.substr(0, parenLoc);
799799
jmethodID methodID = env->GetStaticMethodID(clazz, methodRealName.c_str(), methodSig.c_str());
800+
env->ExceptionClear(); // If GetStaticMethodID can't find the method it throws an exception and we need to just return NULL
800801
if(methodID != 0) {
801802
method = env->ToReflectedMethod(clazz, methodID, true);
802803
} else {
803804
methodID = env->GetMethodID(clazz, methodRealName.c_str(), methodSig.c_str());
805+
env->ExceptionClear(); // If GetMethodID can't find the method it throws an exception and we need to just return NULL
804806
if(methodID != 0) {
805807
method = env->ToReflectedMethod(clazz, methodID, true);
806808
}
807809
}
808-
env->ExceptionClear(); // If GetStaticMethodID can't find the method it throws an exception and we need to just return NULL
809810

810811
// cast arguments
811812
if(method != NULL) {

test/java-ambiguousMethod-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ exports['Java - Call Ambiguous Method'] = nodeunit.testCase({
7070

7171
"methodAmbiguous (sync) - int passed to double": function(test) {
7272
var myTest = java.newInstanceSync("Test");
73-
var result = java.callMethodSync(myTest, 'staticMethodAmbiguous(Ljava/lang/Double;)I', 1);
73+
var result = java.callMethodSync(myTest, 'methodAmbiguous(Ljava/lang/Double;)I', 1);
7474
test.equal(result, 1);
7575
test.done();
7676
},

0 commit comments

Comments
 (0)