Skip to content

Commit

Permalink
JSPWIKI-1156 - Remove 'protected' member in 'final' class
Browse files Browse the repository at this point in the history
  • Loading branch information
arturobernalg committed Oct 1, 2021
1 parent 8e063af commit 2aa722a
Show file tree
Hide file tree
Showing 22 changed files with 83 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ private static final class WikiEventDelegate {
* Constructor for an WikiEventDelegateImpl, provided with the client Object it will service, or the Class
* of client, the latter when used to preload a future incoming delegate.
*/
protected WikiEventDelegate( final Object client ) {
WikiEventDelegate( final Object client ) {
if( client instanceof Class ) {
m_class = ( Class< ? > )client;
}
Expand All @@ -374,7 +374,7 @@ protected WikiEventDelegate( final Object client ) {
/**
* Returns the class of the client-less delegate, null if this delegate is attached to a client Object.
*/
protected Class< ? > getClientClass() {
Class< ? > getClientClass() {
return m_class;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public final class WikiSecurityEvent extends WikiEvent {
public static final int PROFILE_NAME_CHANGED = 54;

/** The security logging service. */
protected static final Logger log = LogManager.getLogger( "SecurityLog" );
static final Logger log = LogManager.getLogger( "SecurityLog" );

private final Principal m_principal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ private ContentType getContentType( final String filename ) {
* Updater thread that updates Kendra indexes.
*/
private static final class KendraUpdater extends WikiBackgroundThread {
protected static final int INDEX_DELAY = 5;
protected static final int INITIAL_DELAY = 10;
static final int INDEX_DELAY = 5;
static final int INITIAL_DELAY = 10;
private final KendraSearchProvider provider;

private final int initialDelay;
Expand Down
6 changes: 3 additions & 3 deletions jspwiki-main/src/main/java/org/apache/wiki/WikiSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public final class WikiSession implements Session {
* @param group the group to test
* @return the result
*/
protected boolean isInGroup( final Group group ) {
boolean isInGroup( final Group group ) {
for( final Principal principal : getPrincipals() ) {
if( isAuthenticated() && group.isMember( principal ) ) {
return true;
Expand Down Expand Up @@ -388,7 +388,7 @@ public void invalidate() {
* This method should generally be called after a user's {@link org.apache.wiki.auth.user.UserProfile} is saved. If the wiki session
* is null, or there is no matching user profile, the method returns silently.
*/
protected void injectGroupPrincipals() {
void injectGroupPrincipals() {
// Flush the existing GroupPrincipals
m_subject.getPrincipals().removeAll( m_subject.getPrincipals(GroupPrincipal.class) );

Expand All @@ -406,7 +406,7 @@ protected void injectGroupPrincipals() {
* and login name. These Principals will be WikiPrincipals, and they will replace all other WikiPrincipals in the Subject. <em>Note:
* this method is never called during anonymous or asserted sessions.</em>
*/
protected void injectUserProfilePrincipals() {
void injectUserProfilePrincipals() {
// Search for the user profile
final String searchId = m_loginPrincipal.getName();
if ( searchId == null ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public Principal[] webContainerRoles() throws WikiException {
* container <code>web.xml</code> file.
* @throws WikiException if the web authorizer cannot verify the roles
*/
protected void verifyPolicyAndContainerRoles() throws WikiException
void verifyPolicyAndContainerRoles() throws WikiException
{
final Authorizer authorizer = m_engine.getManager( AuthorizationManager.class ).getAuthorizer();
final Principal[] containerRoles = authorizer.getRoles();
Expand Down Expand Up @@ -469,7 +469,7 @@ protected void verifyPolicyAndContainerRoles() throws WikiException
* Verifies that the group datbase was initialized properly, and that
* user add and delete operations work as they should.
*/
protected void verifyGroupDatabase()
void verifyGroupDatabase()
{
final GroupManager mgr = m_engine.getManager( GroupManager.class );
GroupDatabase db = null;
Expand Down Expand Up @@ -549,7 +549,7 @@ protected void verifyGroupDatabase()
* {@value org.apache.wiki.auth.AuthenticationManager#PROP_LOGIN_MODULE}
* resolves to a valid class on the classpath.
*/
protected void verifyJaas() {
void verifyJaas() {
// Verify that the specified JAAS moduie corresponds to a class we can load successfully.
final String jaasClass = m_engine.getWikiProperties().getProperty( AuthenticationManager.PROP_LOGIN_MODULE );
if( jaasClass == null || jaasClass.isEmpty() ) {
Expand Down Expand Up @@ -585,7 +585,7 @@ protected void verifyJaas() {
* @param property the system property to look up
* @return the file object, or <code>null</code> if not found
*/
protected File getFileFromProperty( final String property )
File getFileFromProperty( final String property )
{
String propertyValue = null;
try
Expand Down Expand Up @@ -647,7 +647,7 @@ protected File getFileFromProperty( final String property )
* represents a valid policy.
*/
@SuppressWarnings("unchecked")
protected void verifyPolicy() {
void verifyPolicy() {
// Look up the policy file and set the status text.
final URL policyURL = m_engine.findConfigFile( AuthorizationManager.DEFAULT_POLICY );
String path = policyURL.getPath();
Expand Down Expand Up @@ -710,7 +710,7 @@ protected void verifyPolicy() {
* @return the result, based on consultation with the active Java security
* policy
*/
protected boolean verifyStaticPermission( final Principal principal, final Permission permission )
boolean verifyStaticPermission( final Principal principal, final Permission permission )
{
final Subject subject = new Subject();
subject.getPrincipals().add( principal );
Expand Down Expand Up @@ -738,7 +738,7 @@ protected boolean verifyStaticPermission( final Principal principal, final Permi
* Verifies that the user datbase was initialized properly, and that
* user add and delete operations work as they should.
*/
protected void verifyUserDatabase()
void verifyUserDatabase()
{
final UserDatabase db = m_engine.getManager( UserManager.class ).getUserDatabase();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public final class WikiPrincipal implements Principal, Comparable< Principal >,
private final String m_type;

/** For serialization purposes */
protected WikiPrincipal()
WikiPrincipal()
{
this(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class Role implements Principal, Serializable
/**
* Create an empty Role.
*/
protected Role()
Role()
{
this(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class AllPermission extends Permission implements Serializable {
private final String m_wiki;

/** For serialization purposes. */
protected AllPermission() {
AllPermission() {
this( null );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ public final class GroupPermission extends Permission implements Serializable
/** Action for viewing a group or collection of groups. */
public static final String VIEW_ACTION = "view";

protected static final int DELETE_MASK = 0x4;
static final int DELETE_MASK = 0x4;

protected static final int EDIT_MASK = 0x2;
static final int EDIT_MASK = 0x2;

protected static final int VIEW_MASK = 0x1;
static final int VIEW_MASK = 0x1;

/** Convenience constant that denotes <code>GroupPermission( "*:*, "delete" )</code>. */
public static final GroupPermission DELETE = new GroupPermission( DELETE_ACTION );
Expand All @@ -124,7 +124,7 @@ public final class GroupPermission extends Permission implements Serializable
private final String m_wiki;

/** For serialization purposes */
protected GroupPermission()
GroupPermission()
{
this("");
}
Expand Down Expand Up @@ -327,7 +327,7 @@ public String toString()
* @param mask binary mask for actions
* @return binary mask for implied actions
*/
protected static int impliedMask( int mask )
static int impliedMask( int mask )
{
if ( ( mask & DELETE_MASK ) > 0 )
{
Expand All @@ -346,7 +346,7 @@ protected static int impliedMask( int mask )
* @param actions the actions for this permission, separated by commas
* @return the binary actions mask
*/
protected static int createMask( final String actions )
static int createMask( final String actions )
{
if ( actions == null || actions.isEmpty() )
{
Expand Down Expand Up @@ -464,7 +464,7 @@ else if ( action.equalsIgnoreCase( DELETE_ACTION ) )
* GroupPrincipal matching the implied GroupPermission&#8217;s group;
* <code>false</code> otherwise
*/
protected boolean impliesMember(final Permission permission )
boolean impliesMember(final Permission permission )
{
if ( !( permission instanceof GroupPermission ) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ public final class PagePermission extends Permission implements Serializable
/** Action name for the view permission. */
public static final String VIEW_ACTION = "view";

protected static final int COMMENT_MASK = 0x4;
static final int COMMENT_MASK = 0x4;

protected static final int DELETE_MASK = 0x10;
static final int DELETE_MASK = 0x10;

protected static final int EDIT_MASK = 0x2;
static final int EDIT_MASK = 0x2;

protected static final int MODIFY_MASK = 0x40;
static final int MODIFY_MASK = 0x40;

protected static final int RENAME_MASK = 0x20;
static final int RENAME_MASK = 0x20;

protected static final int UPLOAD_MASK = 0x8;
static final int UPLOAD_MASK = 0x8;

protected static final int VIEW_MASK = 0x1;
static final int VIEW_MASK = 0x1;

/** A static instance of the comment permission. */
public static final PagePermission COMMENT = new PagePermission( COMMENT_ACTION );
Expand Down Expand Up @@ -139,7 +139,7 @@ public final class PagePermission extends Permission implements Serializable
private final String m_wiki;

/** For serialization purposes. */
protected PagePermission()
PagePermission()
{
this("");
}
Expand Down Expand Up @@ -351,7 +351,7 @@ public String toString()
* @param mask binary mask for actions
* @return binary mask for implied actions
*/
protected static int impliedMask( int mask )
static int impliedMask( int mask )
{
if ( ( mask & DELETE_MASK ) > 0 )
{
Expand Down Expand Up @@ -387,7 +387,7 @@ protected static int impliedMask( int mask )
* @return the results of the test, where <code>true</code> indicates that
* <code>subSet</code> is a subset of <code>superSet</code>
*/
protected static boolean isSubset( final String superSet, final String subSet )
static boolean isSubset( final String superSet, final String subSet )
{
// If either is null, return false
if ( superSet == null || subSet == null )
Expand Down Expand Up @@ -430,7 +430,7 @@ protected static boolean isSubset( final String superSet, final String subSet )
* @param actions the actions for this permission, separated by commas
* @return the binary actions mask
*/
protected static int createMask( final String actions )
static int createMask( final String actions )
{
if ( actions == null || actions.isEmpty() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public final class WikiPermission extends Permission implements Serializable
/** Value for a generic wildcard. */
public static final String WILDCARD = "*";

protected static final int CREATE_GROUPS_MASK = 0x1;
static final int CREATE_GROUPS_MASK = 0x1;

protected static final int CREATE_PAGES_MASK = 0x2;
static final int CREATE_PAGES_MASK = 0x2;

protected static final int EDIT_PREFERENCES_MASK = 0x4;
static final int EDIT_PREFERENCES_MASK = 0x4;

protected static final int EDIT_PROFILE_MASK = 0x8;
static final int EDIT_PROFILE_MASK = 0x8;

protected static final int LOGIN_MASK = 0x10;
static final int LOGIN_MASK = 0x10;

/** A static instance of the createGroups permission. */
public static final WikiPermission CREATE_GROUPS = new WikiPermission( WILDCARD, CREATE_GROUPS_ACTION );
Expand Down Expand Up @@ -215,7 +215,7 @@ public String toString()
* @param mask the initial mask
* @return the implied mask
*/
protected static int impliedMask( int mask )
static int impliedMask( int mask )
{
if ( ( mask & CREATE_GROUPS_MASK ) > 0 )
{
Expand All @@ -230,7 +230,7 @@ protected static int impliedMask( int mask )
* @param actions the permission actions, separated by commas
* @return binary mask representing the permissions
*/
protected static int createMask(final String actions )
static int createMask(final String actions )
{
if ( actions == null || actions.isEmpty() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ private PageFilterInfo( final String name ) {
super( name );
}

protected static PageFilterInfo newInstance( final String className, final Element pluginEl ) {
static PageFilterInfo newInstance( final String className, final Element pluginEl ) {
if( className == null || className.isEmpty() ) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public static final class WikiPluginInfo extends WikiModuleInfo {
* @param externalJars the list of external jars to search
* @return A WikiPluginInfo object.
*/
protected static WikiPluginInfo newInstance( final String className, final Element el, final List<String> searchPath, final List<String> externalJars ) {
static WikiPluginInfo newInstance( final String className, final Element el, final List<String> searchPath, final List<String> externalJars ) {
if( className == null || className.isEmpty() ) {
return null;
}
Expand All @@ -494,7 +494,7 @@ protected static WikiPluginInfo newInstance( final String className, final Eleme
* @param searchPath A List of Strings, containing different package names.
* @param externalJars the list of external jars to search
*/
protected void initializePlugin( final WikiPluginInfo info, final Engine engine , final List<String> searchPath, final List<String> externalJars) {
void initializePlugin( final WikiPluginInfo info, final Engine engine , final List<String> searchPath, final List<String> externalJars) {
if( !m_initialized ) {
// This makes sure we only try once per class, even if init fails.
m_initialized = true;
Expand Down Expand Up @@ -533,7 +533,7 @@ protected void initializeFromXML( final Element el ) {
* @param clazz The class to check
* @return A WikiPluginInfo instance
*/
protected static WikiPluginInfo newInstance( final Class< ? > clazz ) {
static WikiPluginInfo newInstance( final Class< ? > clazz ) {
return new WikiPluginInfo( clazz.getName() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ private int skipWhitespace( int offset, final String value ) {
* @return int The page count for the given key.
* @param key the key for the Counter
*/
protected int getCount( final Object key )
int getCount( final Object key )
{
return m_counters.get( key ).getValue();
}
Expand Down Expand Up @@ -529,7 +529,7 @@ private void loadCounters() {
/**
* Save the page view counters to file.
*/
protected void storeCounters() {
void storeCounters() {
if( m_counters != null && m_storage != null && m_dirty ) {
log.info( "Storing " + m_counters.size() + " counter values." );
synchronized( this ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ public String getProviderInfo()
* Updater thread that updates Lucene indexes.
*/
private static final class LuceneUpdater extends WikiBackgroundThread {
protected static final int INDEX_DELAY = 5;
protected static final int INITIAL_DELAY = 60;
static final int INDEX_DELAY = 5;
static final int INITIAL_DELAY = 60;
private final LuceneSearchProvider m_provider;

private final int m_initialDelay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public String getSpecialPageReference( final String page ) {
* @param request the HTTP request
* @return the resolved Command, or <code>null</code> if not found
*/
protected Command extractCommandFromPath( final HttpServletRequest request ) {
Command extractCommandFromPath( final HttpServletRequest request ) {
String jsp = request.getServletPath();

// Take everything to right of initial / and left of # or ?
Expand Down Expand Up @@ -325,7 +325,7 @@ public Page resolvePage( final HttpServletRequest request, String page ) {
* @throws ProviderException if the underlyng page provider that locates pages
* throws an exception
*/
protected boolean simplePageExists( final String page ) throws ProviderException {
boolean simplePageExists( final String page ) throws ProviderException {
if ( m_specialPages.containsKey( page ) ) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public String getEditorPath( final Context context ) {
private static final class WikiEditorInfo extends WikiModuleInfo {
private String m_path;

protected static WikiEditorInfo newInstance( final String name, final Element el ) {
static WikiEditorInfo newInstance( final String name, final Element el ) {
if( name == null || name.isEmpty() ) {
return null;
}
Expand Down
Loading

0 comments on commit 2aa722a

Please sign in to comment.