veyron/runtimes/google/ipc/jni: fix broken test
Change-Id: Ic9105ba2243f86c6c047be550c5f293bf2404e6f
diff --git a/runtimes/google/ipc/jni/arg_getter.go b/runtimes/google/ipc/jni/arg_getter.go
index 7bd27c5..5b3c4ba 100644
--- a/runtimes/google/ipc/jni/arg_getter.go
+++ b/runtimes/google/ipc/jni/arg_getter.go
@@ -32,7 +32,8 @@
}
contextType := reflect.TypeOf((*ipc.Context)(nil)).Elem()
- optType := reflect.TypeOf(([]ipc.ClientOpt)(nil))
+ serverContextType := reflect.TypeOf((*ipc.ServerContext)(nil)).Elem()
+ optType := reflect.TypeOf(([]ipc.CallOpt)(nil))
// Create a new arg getter.
methods := make(map[string][]*methodArgs)
for i := 0; i < t.NumMethod(); i++ {
@@ -40,8 +41,11 @@
var mArgs methodArgs
for j := 0; j < m.Type.NumIn(); j++ {
argType := m.Type.In(j)
- if j == 0 && argType == contextType { // (service) Context argument - ignore it.
- continue
+ if j == 0 {
+ if argType == contextType || argType == serverContextType {
+ // context arguments - ignore them.
+ continue
+ }
}
if j == m.Type.NumIn()-1 {
if argType.Kind() == reflect.Interface { // (service) stream argument.