Re: Smartweb 1.2.6 vs 1.2.5 is almost backward compatible??

by Roberto Lo Giacco-4 :: Rate this Message:

Reply to Author | View in Thread

Giuseppe Contartese wrote:

> Hi,
> recently I migrated ,in a "progress" project ,from smartweb 1.2.5 to
> 1.2.6
> ...I noted some small things changed.. and I found warnigs during
> compile-phase e.g. getSearchInfo and getSelectionList methods of
> AbstractArchiveAction were changed in static methods..
> At first I didn't give them so much importance..but during filter
> execution
> get by SearchInfo properties i found a bug on an Enumeration search field
> so I had replace in inappropriate way an override of getSearchInfo from
> AbstractArchiveAction to avoid this glitch..
> and what result?
> A static method cannot be override ..it can 'cause a possible
> StackOverFlow
> during processing..so I had to change every part of  my inherit Action
> super.getSearchInfo() ..into getSerachInfoPlus method to retrieve and
> filter correct search fields..and so on.
> My question is :
> Is it  "almost" backward-compatible.?
>
> Waiting for reply
You are right, but I wasn't expecting someone were overriding the
getSearchInfo() method... Anyway I think the behavior is confusing and
I'll try to explain why

the base class defines a static method named getSearchInfo while your
class tries to override it (as it was non static in previous base class
version) and call the method on the super class, something like

public SearchInfo getSearchInfo(...) {
   SearchInfo info = super.getSearchInfo();
   // your stuff here
}

the strange behavior is the StackOverflowException caused because the
super call is "converted" to a self call, causing the overflow....

Anyway, the main reason for me to make the utility methods static was to
make them available to Actions which can not inherit from
AbstractArchiveAction for some reason. I'm sorry if I caused any
trouble, but if no one has any other evidence of problems I think we
could leave those methods static.... on the contrary, there are no valid
reasons to break backward compatibility, so please... let us know if
this change is a problem for someone else

In the meanwhile, the SearchInfo problems has been fixed with your help,
so I hope no one will have to override any more the getSearchInfo method




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
smartweb-user mailing list
smartweb-user@...
https://lists.sourceforge.net/lists/listinfo/smartweb-user

smime.p7s (4K) Download Attachment