Re: Java String usage should be fully-qualified

William S Fulton <[email protected]> Fri, 29 Jan 2021 20:11:55 +0000
Newsgroups gmane.comp.programming.swig
Message-ID <CANGqftB8DQ_SdRuRY1WhygiC495GtvFCFvtZJcx5CDp2g7X8ew@mail.gmail.com>
On Mon, 2 Nov 2020 at 02:07, <[email protected]> wrote:

> There's a bug in SWIG 3.0.12 in that java.lang.String usage isn't fully
> qualified, but rather generated as "String".  So if one has one's own
> "String"
> class in scope, the compiler confuses that one with the intended class.
>
> Obvious workaround is to not name your classes "String".
>
> You can change the default typemaps to use a fully qualified Java string,
eg:
%typemap(jstype) char *       "String"
becomes
%typemap(jstype) char *       "java.lang.String"

Github patches to the files in the Lib/java are welcome.

William

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user