mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
Add @SuppressWarnings("deprecation") for usage of metaDataFilter (as framework still supports it, despite it being deprecated, so we don't want warnings about it in here)
This commit is contained in:
@ -329,23 +329,25 @@ public class MetaDataAction
|
||||
if(metaDataActionCustomizerReference != null)
|
||||
{
|
||||
actionCustomizer = QCodeLoader.getAdHoc(MetaDataActionCustomizerInterface.class, metaDataActionCustomizerReference);
|
||||
LOG.debug("Using new meta-data actionCustomizer of type: " + actionCustomizer.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
if(actionCustomizer == null)
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// check if QInstance is still using the now-deprecated getMetaDataFilter approach //
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
@SuppressWarnings("deprecation")
|
||||
QCodeReference metaDataFilterReference = QContext.getQInstance().getMetaDataFilter();
|
||||
if(metaDataFilterReference != null)
|
||||
{
|
||||
LOG.warn("QInstance.metaDataFilter is deprecated in favor of metaDataActionCustomizer.");
|
||||
actionCustomizer = QCodeLoader.getAdHoc(MetaDataActionCustomizerInterface.class, metaDataFilterReference);
|
||||
LOG.debug("Using new meta-data actionCustomizer (via metaDataFilter reference) of type: " + actionCustomizer.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
if(actionCustomizer == null)
|
||||
{
|
||||
actionCustomizer = new DefaultNoopMetaDataActionCustomizer();
|
||||
LOG.debug("Using new default (allow-all) meta-data actionCustomizer");
|
||||
}
|
||||
|
||||
return (actionCustomizer);
|
||||
|
@ -239,8 +239,10 @@ public class QInstanceValidator
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
**
|
||||
* this method still supports the deprecated MetaDataFilter (plus its
|
||||
* replacement, MetaDataActionCustomizer
|
||||
***************************************************************************/
|
||||
@SuppressWarnings("deprecation")
|
||||
private void validateInstanceAttributes(QInstance qInstance)
|
||||
{
|
||||
if(qInstance.getMetaDataFilter() != null)
|
||||
|
@ -470,6 +470,7 @@ class MetaDataActionTest extends BaseTest
|
||||
/***************************************************************************
|
||||
**
|
||||
***************************************************************************/
|
||||
@SuppressWarnings("deprecation") // the point of this test is to use the deprecated thing.
|
||||
public static class DenyAllFilter implements MetaDataFilterInterface
|
||||
{
|
||||
/***************************************************************************
|
||||
|
@ -148,8 +148,10 @@ public class QInstanceValidatorTest extends BaseTest
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
* the point of this method is to test the deprecated member, so, don't need to
|
||||
* get a compiler warning about usage of deprecated member.
|
||||
*******************************************************************************/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
void testMetaDataFilter()
|
||||
{
|
||||
|
Reference in New Issue
Block a user