Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant member initializer. #193

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Licensed to the Apache Software Foundation (ASF) under one
public class TwoXFilter extends BasicPageFilter {

String newContent = "";
int invocations = 0;
int invocations;

/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Licensed to the Apache Software Foundation (ASF) under one

public class TestWikiEventListener implements WikiEventListener {

int invoked = 0;
int invoked;

/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ void verifyJaas() {
*/
File getFileFromProperty( final String property )
{
String propertyValue = null;
String propertyValue;
try
{
propertyValue = System.getProperty( property );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public String translateSignature(final Properties wikiProps, final String conten
dateFormat = DEFAULT_DATEFORMAT;
}

SimpleDateFormat df = null;
SimpleDateFormat df;
try
{
df = new SimpleDateFormat(dateFormat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ private Element handleDash()
private Element handleHeading()
throws IOException
{
Element el = null;
Element el;

final int ch = nextToken();

Expand Down Expand Up @@ -2028,7 +2028,7 @@ private Element handleSlash( final boolean newLine )
private Element handleBar( final boolean newLine )
throws IOException
{
Element el = null;
Element el;

if( !m_istable && !newLine )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public abstract class AbstractReferralPlugin implements Plugin {
protected String m_before = ""; // null not blank
protected String m_separator = ""; // null not blank
protected String m_after = "\\\\";
protected int items = 0;
protected int items;

protected Pattern[] m_exclude;
protected Pattern[] m_include;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class ReferredPagesPlugin implements Plugin {
private final PatternMatcher m_matcher = new Perl5Matcher();
private Pattern m_includePattern;
private Pattern m_excludePattern;
private int items = 0;
private int items;
private boolean m_formatCompact = true;
private boolean m_formatSort;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public int doWikiStartTag() throws IOException {
final JspWriter out = pageContext.getOut();
final int queueSize = trail.size();
final String linkclass = "wikipage";
String curPage = null;
String curPage;

for( int i = 0; i < queueSize - 1; i++ ) {
curPage = trail.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void setValue(final String s )
@Override
public int doEndTag()
{
Tag t = null;
Tag t;
do
{
t = getParent();
Expand Down
4 changes: 2 additions & 2 deletions jspwiki-main/src/test/java/org/apache/wiki/HsqlDbUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public class HsqlDbUtils

private static final Logger LOG = LogManager.getLogger( HsqlDbUtils.class );

Server hsqlServer = null;
int localPort = 0;
Server hsqlServer;
int localPort;

/**
* Convenience Hypersonic startup method for unit tests.
Expand Down
8 changes: 4 additions & 4 deletions jspwiki-main/src/test/java/org/apache/wiki/TestEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ Licensed to the Apache Software Foundation (ASF) under one
public class TestEngine extends WikiEngine {
private static final Logger log = LogManager.getLogger( TestEngine.class );

private Session m_adminWikiSession = null;
private Session m_janneWikiSession = null;
private Session m_guestWikiSession = null;
private Session m_adminWikiSession;
private Session m_janneWikiSession;
private Session m_guestWikiSession;

// combined properties file (jspwiki.properties + custom override, if any)
private static Properties combinedProperties = null;
private static Properties combinedProperties;

/**
* Creates WikiSession with the privileges of the administrative user. For testing purposes, obviously.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public class TestJDBCDataSource implements DataSource

protected static final String PROPERTY_USER_PASSWORD = "jdbc.user.password";

protected String m_jdbcPassword = null;
protected String m_jdbcPassword;

protected String m_jdbcURL = null;
protected String m_jdbcURL;

protected String m_jdbcUser = null;
protected String m_jdbcUser;

protected int m_timeout = 0;
protected int m_timeout;

protected PrintWriter m_writer = null;
protected PrintWriter m_writer;

/**
* Constructs a new instance of this class, using a supplied properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class TestJNDIContext implements Context

private final Map<String, Object> m_bindings = new HashMap<>();

private static boolean initialized = false;
private static boolean initialized;

/**
* InitialContextFactory class that configures the JVM to
Expand All @@ -67,7 +67,7 @@ public class TestJNDIContext implements Context
public static class Factory implements InitialContextFactory
{

private static Context ctx = null;
private static Context ctx;

@Override
public Context getInitialContext(final Hashtable<?,?> environment ) throws NamingException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class SecurityEventTrap implements WikiEventListener
{
private WikiSecurityEvent m_lastEvent = null;
private WikiSecurityEvent m_lastEvent;
private final List<WikiSecurityEvent> m_events = new ArrayList<WikiSecurityEvent>();

public void actionPerformed(final WikiEvent event )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public class JDBCGroupDatabaseTest
{
private final HsqlDbUtils m_hu = new HsqlDbUtils();

private Connection m_conn = null;
private Connection m_conn;

private JDBCGroupDatabase m_db = null;
private JDBCGroupDatabase m_db;

private String m_wiki;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Licensed to the Apache Software Foundation (ASF) under one
public class JDBCUserDatabaseTest {
private final HsqlDbUtils m_hu = new HsqlDbUtils();

private JDBCUserDatabase m_db = null;
private JDBCUserDatabase m_db;

private static final String TEST_ATTRIBUTES = "rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAAAACdAAKYXR0cmlidXRlMXQAEXNvbWUgcmFuZG9tIHZhbHVldAAKYXR0cmlidXRlMnQADWFub3RoZXIgdmFsdWV4";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class JavaScriptPlugin implements Plugin, InitializablePlugin {

protected static boolean c_inited = false;
protected static boolean c_inited;

@Override
public String execute( final Context context, final Map< String, String > params ) throws PluginException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class SamplePlugin implements Plugin, ParserStagePlugin {

protected static boolean c_rendered = false;
protected static boolean c_rendered;

@Override
public String execute( final Context context, final Map< String, String > params ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class CounterProvider implements PageProvider {

public int m_getPageCalls = 0;
public int m_pageExistsCalls = 0;
public int m_getPageTextCalls = 0;
public int m_getAllPagesCalls = 0;
public int m_initCalls = 0;
public int m_getPageCalls;
public int m_pageExistsCalls;
public int m_getPageTextCalls;
public int m_getAllPagesCalls;
public int m_initCalls;

Page[] m_pages = new Page[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one
public class VerySimpleProvider implements PageProvider {

/** The last request is stored here. */
public String m_latestReq = null;
public String m_latestReq;
/** The version number of the last request is stored here. */
public int m_latestVers = -123989;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public class TestContainer {
private static final Logger log = LogManager.getLogger( TestContainer.class );

private static Context initCtx ;
private static Resource userDB = null;
private static Resource groupDB = null;
private static Resource userDB;
private static Resource groupDB;

private static final ContextHandlerCollection handlerCollection = new ContextHandlerCollection();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private FormUtil()
keyPrefix.isEmpty() )
return rval;

String fullPrefix = null;
String fullPrefix;
if( keyPrefix.charAt( keyPrefix.length() - 1 ) == '.' )
fullPrefix = keyPrefix;
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public T get(final int index )
public int size()
{
m_lock.readLock().lock();
int size = 0;
int size;

try
{
Expand Down Expand Up @@ -213,7 +213,7 @@ public void cleanup(final long maxage )
public long getAddTime(final int index )
{
m_lock.readLock().lock();
long res = 0;
long res;

try
{
Expand Down