I am trying to create a subclass in jruby which overrides the keys
method from the super java class properties cause i want to sort the
entries in the properties class by the keys:
class SortedProperties < java.util.Properties
def keys
keysEnum = super().keys()
keyList = java.util.Vector.new
keysEnum.elements.each do |element|
puts element.to_s
keyList.add(element.to_java(:String))
end
java.util.Collections.sort(keyList)
puts keyList.elements().to_s
return keyList.elements()
end
end
I am doing definitly something wrong with the super statement but i
don’t know what. Searched a lot but can’t find anything that points me
to the correct call of the method keys() in the super class properties.