Buggy code:
public class Palette < T > extends Panel implements IHeaderContributor { private static final String SELECTED_HEADER_ID = "selectedHeader" ; private static final String AVAILABLE_HEADER_ID = "availableHeader" ; private static final long serialVersionUID = 1L ; private final IModel < Collection < T > > choicesModel ; private final IChoiceRenderer < T > choiceRenderer ; private final int rows ; private final boolean allowOrder ; private Recorder < T > recorderComponent ; private Component choicesComponent ; private Component selectionComponent ; private static final ResourceReference JAVASCRIPT = new ResourceReference ( Palette . class , "palette.js" ) ; private static final ResourceReference CSS = new ResourceReference ( Palette . class , "palette.css" ) ; private static final ResourceReference UP_IMAGE = new ResourceReference ( Palette . class , "up.gif" ) ; private static final ResourceReference DOWN_IMAGE = new ResourceReference ( Palette . class , "down.gif" ) ; private static final ResourceReference REMOVE_IMAGE = new ResourceReference ( Palette . class , "remove.gif" ) ; private static final ResourceReference ADD_IMAGE = new ResourceReference ( Palette . class , "add.gif" ) ; public Palette ( String id , IModel < Collection < T > > choicesModel , IChoiceRenderer < T > choiceRenderer , int rows , boolean allowOrder ) { } public Palette ( String id , IModel < List < T > > model , IModel < Collection < T > > choicesModel , IChoiceRenderer < T > choiceRenderer , int rows , boolean allowOrder ) { } @ Override protected void onBeforeRender ( ) { } private void initFactories ( ) { } protected ResourceReference getCSS ( ) { } protected StyleSheetReference getStyleSheet ( ) { } public final boolean isPaletteEnabled ( ) { <START_BUG> return ( Palette . isEnabled ( ) ) && ( Palette . isEnableAllowed ( ) ) ; <END_BUG> } public Iterator < T > getSelectedChoices ( ) { } public Iterator < T > getUnselectedChoices ( ) { } protected Recorder < T > newRecorderComponent ( ) { } protected Component newAvailableHeader ( String componentId ) { } protected Component newSelectedHeader ( String componentId ) { } protected Component newDownComponent ( ) { } protected Component newUpComponent ( ) { } protected Component newRemoveComponent ( ) { } protected Component newAddComponent ( ) { } protected Component newSelectionComponent ( ) { } protected Map < String , String > getAdditionalAttributesForSelection ( Object choice ) { } protected Component newChoicesComponent ( ) { } protected Map < String , String > getAdditionalAttributesForChoices ( Object choice ) { } private Component getChoicesComponent ( ) { } private Component getSelectionComponent ( ) { } public final Recorder < T > getRecorderComponent ( ) { } public Collection < T > getChoices ( ) { } @ SuppressWarnings ( "unchecked" ) public Collection < T > getModelCollection ( ) { } public IChoiceRenderer < T > getChoiceRenderer ( ) { } public int getRows ( ) { } protected final void updateModel ( ) { } protected String buildJSCall ( String funcName ) { } public String getChoicesOnFocusJS ( ) { } public String getSelectionOnFocusJS ( ) { } public String getAddOnClickJS ( ) { } public String getRemoveOnClickJS ( ) { } public String getUpOnClickJS ( ) { } public String getDownOnClickJS ( ) { } @ Override protected void onDetach ( ) { } private class PaletteButton extends WebMarkupContainer { private static final long serialVersionUID = 1L ; public PaletteButton ( String id ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { } } public void renderHead ( IHeaderResponse response ) { } }

Fix:
return Palette . isEnabledInHierarchy ( ) ;