Feb 26, 2019, 11:10:15 AM (4 years ago)
Nicklas Nordborg

References #2151: Pre-compile all JSP pages before releases

Getting rid of a lot of unchecked warnings. Most of them are solved by changed the API in several BASE core clases to use implict casting of return types instead of explicit (this moved the 'unchecked' warning to the API method from the caller). Example:

// Before
ItemContext cc = ...
Hardware hardware = (Hardware)cc.getObject("item");

// After
Hardware hardware = cc.getObject("item");

In most cases both the old and new version of the code will work, but if the returned object is using a "type" parameter it will not compile:

// This will not compile!
Set<AnnotatedItem> items = (Set<AnnotatedItem>)cc.getObject("AnnotatedItems");

// But this will!
Set<AnnotatedItem> items = cc.getObject("AnnotatedItems");

Note that existing compiled code will still work, but that some changes may be needed when compiling agains BASE 3.15. The issues should be easy to solve (eg. remove an explict cast).

Extensions that uses JSP files that works in BASE 3.14 may stop working in BASE 3.15 since the compilation of the JSP files happens on the BASE server as they are accessed.

Another issues is that there are still a lot of unchecked warnings related to the JSON library. This build on regular Map and List API:s but has not specified generic type parameters so there is no way to get rid of those warnings without fixing the JSON library source code. The latest released version is from 2012 so it is not likely that this should happen unless we do it ourselves (the warnings are really annoying so maybe we should!).

1 edited


  • trunk/www/my_base/user/preferences.jsp

    r7502 r7605  
    127127  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, user);
    128   ExtensionsInvoker<StartPageAction> invoker = (ExtensionsInvoker<StartPageAction>)ExtensionsControl.useExtensions(jspContext, "net.sf.basedb.clients.web.start-page");
    129   ExtensionsInvoker<TabAction> tabsInvoker = (ExtensionsInvoker<TabAction>)ExtensionsControl.useExtensions(jspContext, EditUtil.EP_PREFIX_EDIT+"user-preferences");
     128  ExtensionsInvoker<StartPageAction> invoker = ExtensionsControl.useExtensions(jspContext, "net.sf.basedb.clients.web.start-page");
     129  ExtensionsInvoker<TabAction> tabsInvoker = ExtensionsControl.useExtensions(jspContext, EditUtil.EP_PREFIX_EDIT+"user-preferences");
    130130  %>
    131131  <base:page type="popup" title="<%="Preferences for "+HTML.encodeTags(user.getName())%>" id="preferences">
Note: See TracChangeset for help on using the changeset viewer.