resolve compilation issues with statistics servlet post patch application
This commit is contained in:
parent
dd4a80288b
commit
c87cc4d4f0
|
@ -22,6 +22,8 @@ import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.lang.management.MemoryMXBean;
|
import java.lang.management.MemoryMXBean;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
@ -113,8 +115,16 @@ public class StatisticsServlet extends HttpServlet
|
||||||
|
|
||||||
private boolean isLoopbackAddress(String address)
|
private boolean isLoopbackAddress(String address)
|
||||||
{
|
{
|
||||||
InetAddress address = InetAddress.getByName(address);
|
try
|
||||||
return address.isLoopbackAddress();
|
{
|
||||||
|
InetAddress addr = InetAddress.getByName(address);
|
||||||
|
return addr.isLoopbackAddress();
|
||||||
|
}
|
||||||
|
catch (UnknownHostException e )
|
||||||
|
{
|
||||||
|
LOG.warn("Warning: attempt to access statistics servlet from " + address, e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendXmlResponse(HttpServletResponse response) throws IOException
|
private void sendXmlResponse(HttpServletResponse response) throws IOException
|
||||||
|
|
Loading…
Reference in New Issue