Feb 26, 2019, 11:10:15 AM (3 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/include/menu.jsp

    r7531 r7605  
    12501250    // Extensions menu
    12511251    JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
    1252     ExtensionsInvoker<MenuItemAction> invoker =
    1253       (ExtensionsInvoker<MenuItemAction>)ExtensionsControl.useExtensions(jspContext,
     1252    ExtensionsInvoker<MenuItemAction> invoker = ExtensionsControl.useExtensions(jspContext,
    12541253        "net.sf.basedb.clients.web.menu.extensions");
    12551254    ExtensionsControl ec = ExtensionsControl.get(dc);
Note: See TracChangeset for help on using the changeset viewer.