Author: jleroux Date: Tue Oct 22 10:23:26 2013 New Revision: 1534591 URL: http://svn.apache.org/r1534591 Log: Eclipse keeps telling me I should use HttpServletRequest and says "The method getContextPath() is undefined for the type ServletContext" despite https://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getContextPath%28%29
I tried to put a @SuppressWarnings("cast") which is also supported by Eclipse http://stackoverflow.com/questions/1205995/what-is-the-list-of-valid-suppresswarnings-warning-names-in-java But no ways, I gave up and just put a comment there Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java?rev=1534591&r1=1534590&r2=1534591&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java Tue Oct 22 10:23:26 2013 @@ -70,7 +70,13 @@ public class ControlServlet extends Http @Override public void init(ServletConfig config) throws ServletException { super.init(config); - if (Debug.infoOn()) Debug.logInfo("LOADING WEBAPP [" + config.getServletContext().getContextPath().substring(1) + "] " + config.getServletContext().getServletContextName() + ", located at " + config.getServletContext().getRealPath("/"), module); + if (Debug.infoOn()) { + ServletContext servletContext = config.getServletContext(); + //@SuppressWarnings("cast") You can neglect Eclipse saying "The method getContextPath() is undefined for the type ServletContext" + Debug.logInfo("LOADING WEBAPP [" + servletContext.getContextPath().substring(1) + "] " + + servletContext.getServletContextName() + + ", located at " + servletContext.getRealPath("/"), module); + } // configure custom BSF engines configureBsf();