URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13267>
Summary: gnu.java.nio.charset.iconv.IconvProvider: the constructor must be public Project: classpath Submitted by: itokaz Submitted on: Thu 06/02/05 at 00:04 Category: classpath Severity: 3 - Normal Status: None Privacy: Public Assigned to: None Open/Closed: Open Platform Version: None _______________________________________________________ Details: The constructor of gnu.java.nio.charset.iconv.IconvProvider is declared private, but I would like it to be public. This is not a problem if an instance of gnu.java.nio.charset.iconv.IconvProvider is to be obtained by the method provider(). But the preferred usage is: gnu.java.nio.charset.iconv.IconvProvider is listed in META-INF/services/java.nio.charset.spi.CharsetProvider, the class is loaded by Class.forName() and its instance is obtained by Class.newInstance(). When gnu.java.nio.charset.iconv.IconvProvider is used this way, its constructor must be public. I wrote a simple subclass of java.nio.charset.spi.CharsetProvider which has a private constructor and tried to use it with Sun's VM. And as I expected, java.lang.IllegalAccessException was thrown. So, although not clearly stated in the Sun's API document, the zero argument constructor of subclasses of java.nio.charset.spi.CharsetProvider must be public. Making it public will violate the design of gnu.java.nio.charset.iconv.IconvProvider which uses singleton. Even so, I would like it to be public. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13267> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Commit-classpath mailing list Commit-classpath@gnu.org http://lists.gnu.org/mailman/listinfo/commit-classpath