Ignore:
Timestamp:
Feb 26, 2019, 11:10:15 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

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!).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/annotations/index.jsp

    r7209 r7605  
    8686    oldDc = sc.newDbControl();
    8787    ItemContext cc = sc.getCurrentContext(itemType);
    88     Annotatable oldItem = (Annotatable)cc.getObject("item");
     88    Annotatable oldItem = cc.getObject("item");
    8989    Annotatable newItem = (Annotatable)itemType.getById(newDc, itemId);
    9090    oldDc.reattachItem((BasicItem)oldItem, false);
     
    103103    newDc = sc.newDbControl();
    104104
    105     Set<AnnotatedItem> items = (Set<AnnotatedItem>)cc.getObject("AnnotatedItems");
     105    Set<AnnotatedItem> items = cc.getObject("AnnotatedItems");
    106106    cc.removeObject("AnnotatedItems");
    107107   
Note: See TracChangeset for help on using the changeset viewer.