Exemplo n.º 1
0
func (self *Environment) callIntArray(z interface{}, static bool, name string, params ...interface{}) (v []int, err error) {
	jval, meth, args, localStack, err := self.getMethod(z, static, name, types.Array{types.Basic(types.IntKind)}, params...)
	if err != nil {
		return
	}
	defer blowStack(self, localStack)
	var oval C.jobject
	if static {
		oval = C.envCallStaticObjectMethodA(self.env, C.valObject(jval), meth.method, args.Ptr())
	} else {
		oval = C.envCallObjectMethodA(self.env, C.valObject(jval), meth.method, args.Ptr())
	}
	if oval == nil {
		err = self.ExceptionOccurred()
	}
	if err == nil {
		v = self.ToIntArray(newObject(oval))
	}
	return
}
Exemplo n.º 2
0
func (self *Environment) callObj(z interface{}, static bool, name string, rval types.Typed, params ...interface{}) (vObj *Object, err error) {
	jval, meth, args, localStack, err := self.getMethod(z, static, name, rval, params...)
	if err != nil {
		return
	}
	defer blowStack(self, localStack)
	var oval C.jobject
	if static {
		oval = C.envCallStaticObjectMethodA(self.env, C.valObject(jval), meth.method, args.Ptr())
	} else {
		oval = C.envCallObjectMethodA(self.env, C.valObject(jval), meth.method, args.Ptr())
	}
	if self.ExceptionCheck() {
		err = self.ExceptionOccurred()
	}
	if err == nil {
		vObj = newObject(oval)
	}
	return
}