[ 
https://issues.apache.org/jira/browse/WICKET-7155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17955983#comment-17955983
 ] 

Martijn Dashorst edited comment on WICKET-7155 at 6/3/25 8:49 PM:
------------------------------------------------------------------

According to me this is solved in 9.21.0 and 10.5.0 by WICKET-7148 with these 
commits: e480c7f230a072ca6f34f5a31d4ba3e9b943bb06 and  
d718c419a99269196ad568b08861270ae7aa30f4 respectively


was (Author: dashorst):
According to me this is solved in 9.21.0 and 10.5.0 by WICKET-7148 with this 
commit: d718c419a99269196ad568b08861270ae7aa30f4

> Cannot clear Application metadata - NullPointerException
> --------------------------------------------------------
>
>                 Key: WICKET-7155
>                 URL: https://issues.apache.org/jira/browse/WICKET-7155
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 9.21.0
>            Reporter: Daniel Stoch
>            Assignee: Martijn Dashorst
>            Priority: Major
>
> After change in WICKET-7002 now it is not possible to clear value stored in 
> Application under MetaDataKey.
> For now the call:
> {code}
> application.setMetaData(KEY, null)
> {code}
> raises an exception:
> {noformat}
> java.lang.NullPointerException
>       at 
> java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
>       at 
> java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
>       at org.apache.wicket.Application.setMetaData(Application.java:515)
> ...
> {noformat}
> Maybe this method should be implemented like:
> {code}
>       public final <T> Application setMetaData(final MetaDataKey<T> key, 
> final T object)
>       {
>               if (object != null) 
>                       metaData.put(key, object);
>               else
>                       metaData.remove(key);
>               return this;
>       }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to