ServletContext.getVirtualServerName always returns "localhost"

I experimented with the new getVirtualServerName method introduced for interface ServletContext in servlet spec 3.1. The JavaDoc states: Returns the primary name of the virtual host on which this context is deployed. The name may or may not be a valid host name.

However Wildfly always seems to return "localhost" instead of the virtual host name specified in XML configuration files. My host config in standalone.xml looks like this: <host name="default-host" alias="www.sample.com">. I expected that getVirtualServerName returns "default-host" in this case. 

getVirtualServerName is implemented like this: "return deployment.getDeploymentInfo().getHostName();". However DeploymentInfo.setHostName is never called during startup. 

If I did not misunderstand what getVirtualServerName is supposed to deliver, something similar to my proposed patch should fix the problem. Sorry, I only looked at Wildfly source code for the first time today in a debugger and was unable to verify if my proposed patch compiles :( Hope a more experienced developer can have a quick look.
WFLY-794: adds missing package in sun.jdk module, adds simple test to ensure rmi context is in jndi, and enhances the existent jmx connector test to run remotely
[WFLY-2964] Add some missing i18n
[WFLY-490] / [WFLY-2149] Bypass complex perms checking for SuperUser
WFLY-3552 - Updated implementation of StrictMaxPool
Move mgmt. tests to core testsuite
Remove unessesary dep on embedded
Remove the use of ${project.groupId}
Fix some issues with module.xml files
Fix missing dependency
get rid of arquillian dependancies in core testsuite
Fix core model tests when running with clean maven repo
Merge pull request #6450 from stuartwdouglas/core-model-test-fix

Fix core model tests when running with clean maven repo
Merge pull request #6448 from stuartwdouglas/remove-dep

Fix up some dependency issues in the pom
Fix for connector and timer TCK regressions
Add work around to tools/download-maven.sh to modify maven/bin/mvn so that build on Solaris works also.
Can be reverted, as soon as new maven with fix for https://jira.codehaus.org/browse/MNG-5658 is available.
Merge pull request #6452 from bstansberry/pr6447

Replacement: Add work around to tools/download-maven.sh to modify maven/bin/mvn so th...
Merge pull request #6445 from ctomc/core-testsuite

Move mgmt. tests to core testsuite
Merge pull request #6453 from sguilhen/master

Fix for connector and timer TCK regressions
[WFLY-1948] JMXPropertyEditorsTestCase fails on Solaris SPARC