|
From: | Nathan S. |
Subject: | [Bug-kawa] [bug #48347] Exception on import of class with public instance fields and without no-args ctor |
Date: | Wed, 29 Jun 2016 20:01:38 +0000 (UTC) |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0 |
URL: <http://savannah.gnu.org/bugs/?48347> Summary: Exception on import of class with public instance fields and without no-args ctor Project: Kawa Submitted by: nathans Submitted on: Wed 29 Jun 2016 08:01:35 PM GMT Category: None Severity: 3 - Normal Item Group: Run-time exception Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: Steps to reproduce: Create a file Example.java with contents: public class Example { public Object item; public Example(Object item) { this.item = item; } } Create a file test.scm with contents: (import Example) (display (Example:new #!null)) Run "javac Example.java". Then with the current directory included on the classpath run "kawa -f test.scm". An exception is thrown from gnu.expr.ModuleContext.findInstance because it attempts to invoke the no-args constructor of Example and there is not one. It does not seem to matter if I put Example in a package other than the default package. Strangely, if I change the visibility of Example's item field from public to private the error does not occur. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Wed 29 Jun 2016 08:01:35 PM GMT Name: Example.java Size: 102B By: nathans <http://savannah.gnu.org/bugs/download.php?file_id=37627> ------------------------------------------------------- Date: Wed 29 Jun 2016 08:01:35 PM GMT Name: test.scm Size: 49B By: nathans <http://savannah.gnu.org/bugs/download.php?file_id=37628> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?48347> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |