Skip to content

Commit e7d228b

Browse files
committed
Merge branch 'SharedPtr-Upcast' into shared-ptr-template-upcast
2 parents 5f42bed + 83d1893 commit e7d228b

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

Source/Modules/java.cxx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,18 +1893,32 @@ class JAVA:public Language {
18931893
* ----------------------------------------------------------------------------- */
18941894

18951895
void upcastsCode(SwigType *smart, String *upcast_method_name, String *c_classname, String *c_baseclass) {
1896+
Swig_warning(0, NULL, NULL, "******************************************\n");
1897+
Swig_warning(0, NULL, NULL, "Smart: %s, Class name: '%s', baseclass: '%s' \n", smart, c_classname, c_baseclass);
18961898
String *jniname = makeValidJniName(upcast_method_name);
18971899
String *wname = Swig_name_wrapper(jniname);
18981900
Printf(imclass_cppcasts_code, " public final static native long %s(long jarg1);\n", upcast_method_name);
18991901
if (smart) {
1900-
SwigType *bsmart = Copy(smart);
1902+
String *smartnamestr = SwigType_namestr(smart);
1903+
String *bsmartnamestr = SwigType_namestr(smart);
1904+
19011905
SwigType *rclassname = SwigType_typedef_resolve_all(c_classname);
1906+
Swig_warning(0, NULL, NULL, "SwigType_typedef_resolve_all - c_classname(%s): '%s'\n", c_classname, rclassname);
1907+
19021908
SwigType *rbaseclass = SwigType_typedef_resolve_all(c_baseclass);
1903-
Replaceall(bsmart, rclassname, rbaseclass);
1909+
Swig_warning(0, NULL, NULL, "SwigType_typedef_resolve_all - c_baseclass(%s): '%s'\n", c_baseclass, rbaseclass);
1910+
1911+
Swig_warning(0, NULL, NULL, "Replaceall - PRE(%s, %s, %s)\n", bsmartnamestr, rclassname, rbaseclass);
1912+
Replaceall(bsmartnamestr, rclassname, rbaseclass);
1913+
Swig_warning(0, NULL, NULL, "Replaceall - POST(%s, %s, %s)\n", bsmartnamestr, rclassname, rbaseclass);
1914+
19041915
Delete(rclassname);
19051916
Delete(rbaseclass);
1906-
String *smartnamestr = SwigType_namestr(smart);
1907-
String *bsmartnamestr = SwigType_namestr(bsmart);
1917+
//String *smartnamestr = SwigType_namestr(smart);
1918+
//String *bsmartnamestr = SwigType_namestr(bsmart);
1919+
Swig_warning(0, NULL, NULL, "bsmartnamestr: '%s', smartnamestr: '%s' \n", bsmartnamestr, smartnamestr);
1920+
1921+
19081922
Printv(upcasts_code,
19091923
"SWIGEXPORT jlong JNICALL ", wname, "(JNIEnv *jenv, jclass jcls, jlong jarg1) {\n",
19101924
" jlong baseptr = 0;\n"
@@ -1917,7 +1931,6 @@ class JAVA:public Language {
19171931
"}\n", "\n", NIL);
19181932
Delete(bsmartnamestr);
19191933
Delete(smartnamestr);
1920-
Delete(bsmart);
19211934
} else {
19221935
Printv(upcasts_code,
19231936
"SWIGEXPORT jlong JNICALL ", wname, "(JNIEnv *jenv, jclass jcls, jlong jarg1) {\n",
@@ -1928,6 +1941,8 @@ class JAVA:public Language {
19281941
" return baseptr;\n"
19291942
"}\n", "\n", NIL);
19301943
}
1944+
Swig_warning(0, NULL, NULL, "******************************************\n");
1945+
19311946
Delete(wname);
19321947
Delete(jniname);
19331948
}

0 commit comments

Comments
 (0)