Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser unable to rename nested classes when namespaces are used #352

Closed
davidsj2 opened this issue Oct 22, 2019 · 2 comments
Closed

Parser unable to rename nested classes when namespaces are used #352

davidsj2 opened this issue Oct 22, 2019 · 2 comments
Labels

Comments

@davidsj2
Copy link

davidsj2 commented Oct 22, 2019

Consider the following class:

#ifndef NESTEDTEST_H_
#define NESTEDTEST_H_

namespace com {
namespace company {
class NestedTest
{
public :

  struct Listener {
    virtual ~Listener() {}
  };
};
}}
#endif

If a rule is added to the parser as follows:

infoMap.put(new Info("com::company::NestedTest::Listener").pointerTypes("ListenerInternal"));

The generated JNI code will end up scoping the references twice (example error):

javacpp_test/test/jniNested.cpp:297:101: error: no member named 'com' in 'com::company::NestedTest'; did you mean simply 'com'?
static void JavaCPP_test_Nested_00024NestedTest_00024ListenerInternal_deallocate(void *p) { delete (::com::company::NestedTest::com::company::NestedTest::Listener*)p; }

If the original class is in the global namespace, the rename works correctly.

I'm attaching a trivial example that recreates the issue. Run build.sh in the root directory.

javacpp_test.tar.gz

@saudet saudet added the bug label Oct 23, 2019
saudet added a commit that referenced this issue Oct 23, 2019
@saudet
Copy link
Member

saudet commented Oct 23, 2019

Fixed in commit f901aa9. Thanks for reporting!

@saudet
Copy link
Member

saudet commented Nov 6, 2019

JavaCPP 1.5.2 has been released with the fix. Enjoy!

@saudet saudet closed this as completed Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants