Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.0
-
Fix Version/s: JRuby 0.9.8
-
Component/s: Java Integration
-
Labels:None
-
Environment:Latest Ubuntu, Java 1.5.0.06, latest JRuby
-
Number of attachments :
Description
If I inherit from javax.xml.namespace.NamespaceContext but the class has a constructor with an argument, trying to use an instance blows up.
This is a known issue when implementing an interface in Ruby and providing an initalizer for that implementation. In order to allow the JRuby-provided proxy code to initialize properly, Ruby-based implementations of Java interfaces should call super with no arguments. I do not like this requirement and I will modify this bug to point specifically toward fixing it.
At any rate, as a workaround replace:
class NSCT1 < NamespaceContext def initialize foo # doesn't need to do anything end ...with:
class NSCT1 < NamespaceContext def initialize foo super() # doesn't need to do anything end ...class NSCT1 < NamespaceContext def initialize foo # doesn't need to do anything end ...class NSCT1 < NamespaceContext def initialize foo super() # doesn't need to do anything end ...