Apply patch SF #335 - Truly ignore constructors in directors with %ignore and correct testcase that tests this

This commit is contained in:
William S Fulton 2013-01-29 06:55:22 +00:00
commit 38f37ef5ae
3 changed files with 40 additions and 15 deletions

View file

@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.10 (in progress) Version 2.0.10 (in progress)
============================ ============================
2013-01-28: William
[Java] Apply patch SF #335 - Truly ignore constructors in directors with %ignore.
2013-01-18: Brant Kyser 2013-01-18: Brant Kyser
[Java] Patch #15 - Allow the use of the nspace feature without the -package commandline option. [Java] Patch #15 - Allow the use of the nspace feature without the -package commandline option.
This works as long and the new jniclasspackage pragma is used to place the JNI intermediate class This works as long and the new jniclasspackage pragma is used to place the JNI intermediate class

View file

@ -68,21 +68,6 @@ class DAbstractIgnores
virtual double OverloadedProtectedMethod() = 0; virtual double OverloadedProtectedMethod() = 0;
}; };
class DIgnoreConstructor
{
public:
virtual ~DIgnoreConstructor() {}
DIgnoreConstructor(std::string s, int i) {}
DIgnoreConstructor(bool b) {}
};
class DIgnoreOnlyConstructor
{
public:
virtual ~DIgnoreOnlyConstructor() {}
DIgnoreOnlyConstructor(bool b) {}
};
template <typename T> class DTemplateAbstractIgnores template <typename T> class DTemplateAbstractIgnores
{ {
T t; T t;
@ -101,3 +86,37 @@ template <typename T> class DTemplateAbstractIgnores
%template(DTemplateAbstractIgnoresInt) DTemplateAbstractIgnores<int>; %template(DTemplateAbstractIgnoresInt) DTemplateAbstractIgnores<int>;
class DIgnoreConstructor
{
public:
virtual ~DIgnoreConstructor() {}
DIgnoreConstructor(std::string s, int i) {}
DIgnoreConstructor(bool b) {}
};
class DIgnoreOnlyConstructor
{
public:
virtual ~DIgnoreOnlyConstructor() {}
DIgnoreOnlyConstructor(bool b) {}
};
%{
class DIgnoreConstructor
{
public:
virtual ~DIgnoreConstructor() {}
DIgnoreConstructor(std::string s, int i) {}
private: // Hide constructor
DIgnoreConstructor(bool b) {}
};
class DIgnoreOnlyConstructor
{
public:
virtual ~DIgnoreOnlyConstructor() {}
private: // Hide constructor
DIgnoreOnlyConstructor(bool b) {}
};
%}

View file

@ -1995,6 +1995,9 @@ int Language::classDirectorConstructors(Node *n) {
for (ni = Getattr(n, "firstChild"); ni; ni = nextSibling(ni)) { for (ni = Getattr(n, "firstChild"); ni; ni = nextSibling(ni)) {
nodeType = Getattr(ni, "nodeType"); nodeType = Getattr(ni, "nodeType");
if (Cmp(nodeType, "constructor") == 0) { if (Cmp(nodeType, "constructor") == 0) {
if (GetFlag(ni, "feature:ignore"))
continue;
Parm *parms = Getattr(ni, "parms"); Parm *parms = Getattr(ni, "parms");
if (is_public(ni)) { if (is_public(ni)) {
/* emit public constructor */ /* emit public constructor */