Fix for 'self' being used as a parameter name

This commit is contained in:
William S Fulton 2014-10-30 07:22:59 +00:00
commit 6029b2f7d8
5 changed files with 19 additions and 12 deletions

View file

@ -2268,7 +2268,7 @@ public:
Printf(imcall, "swigCPtr");
String *this_type = Copy(getClassType());
String *name = NewString("self");
String *name = NewString("jself");
String *qualifier = Getattr(n, "qualifier");
if (qualifier)
SwigType_push(this_type, qualifier);
@ -3734,7 +3734,7 @@ public:
/* Create the intermediate class wrapper */
tm = Swig_typemap_lookup("jtype", n, "", 0);
if (tm) {
Printf(callback_def, " public static %s %s(%s self", tm, imclass_dmethod, qualified_classname);
Printf(callback_def, " public static %s %s(%s jself", tm, imclass_dmethod, qualified_classname);
} else {
Swig_warning(WARN_JAVA_TYPEMAP_JTYPE_UNDEF, input_file, line_number, "No jtype typemap defined for %s\n", SwigType_str(returntype, 0));
}
@ -3851,7 +3851,7 @@ public:
Printf(w->code, "if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {\n");
}
/* Start the Java field descriptor for the intermediate class's upcall (insert self object) */
/* Start the Java field descriptor for the intermediate class's upcall (insert jself object) */
Parm *tp = NewParmNode(c_classname, n);
String *jdesc;
@ -4062,7 +4062,7 @@ public:
/* Emit the intermediate class's upcall to the actual class */
String *upcall = NewStringf("self.%s(%s)", symname, imcall_args);
String *upcall = NewStringf("jself.%s(%s)", symname, imcall_args);
// Handle exception classes specified in the "except" feature's "throws" attribute
addThrows(n, "feature:except", n);