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

Default constructor generated twice #31

Closed
jpsacha opened this issue Aug 15, 2015 · 2 comments
Closed

Default constructor generated twice #31

jpsacha opened this issue Aug 15, 2015 · 2 comments
Labels

Comments

@jpsacha
Copy link
Member

jpsacha commented Aug 15, 2015

Here is a C++ snipped:

class GCBASE_API gcstring_vector
{
// Nested types
// ---------------------------------------------------------------------------
public:
  class GCBASE_API const_iterator {...};

  class GCBASE_API iterator {...};

// Ctor / Dtor
// ---------------------------------------------------------------------------
public:
                            gcstring_vector   ( void );
  explicit                  gcstring_vector   ( size_t uiSize, const gcstring &str = gcstring() );
                            gcstring_vector   ( const gcstring_vector &obj);
  virtual                   ~gcstring_vector  ( void );
...
}

it results in default constructor generated twice. One empty one with call to allocate:

  @Namespace("GenICam") @NoOffset public static class gcstring_vector extends Pointer {
      static { Loader.load(); }
      /** Empty constructor. */
      public gcstring_vector() { }
      /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
      public gcstring_vector(Pointer p) { super(p); }

    @NoOffset public static class const_iterator extends Pointer { ... }

    public static class iterator extends const_iterator { ... }

                              public gcstring_vector( ) { allocate(); }
...
    }

It was using JavaCPP v.1 (build from 2015-08-12, SHA 5d374eb. Can post full project if needed.

saudet added a commit that referenced this issue Aug 16, 2015
…eclarations, and default constructors with an explicit `void` parameter (issue #31)

 * Fix a couple of potential `NullPointerException` in `Parser` (issue #30)
@saudet saudet added the bug label Aug 16, 2015
@saudet
Copy link
Member

saudet commented Aug 16, 2015

Please try the fix in the latest commit. Thanks for reporting!

@jpsacha
Copy link
Member Author

jpsacha commented Aug 17, 2015

The last commit fixed the issue.

@jpsacha jpsacha closed this as completed Aug 17, 2015
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