eclipse plugin: Don't use static fields when we are not needing them
Issue found by "FindBugs"
This commit is contained in:
parent
a9b1eed73c
commit
f03b43e17a
5 changed files with 9 additions and 9 deletions
|
@ -33,11 +33,11 @@ public class Activator extends AbstractUIPlugin
|
|||
* Switch for knowing if we already started checking conditions
|
||||
* This way we prevent a stack overflow occuring
|
||||
*/
|
||||
public static boolean IsCheckingConditions = false;
|
||||
public boolean IsCheckingConditions = false;
|
||||
/**
|
||||
* Switch for knowing if we already intend to setup the workspace
|
||||
*/
|
||||
public static boolean IsSettingUpWorkspace = false;
|
||||
public boolean IsSettingUpWorkspace = false;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
|
@ -77,11 +77,11 @@ public class Activator extends AbstractUIPlugin
|
|||
*/
|
||||
public static Activator getDefault()
|
||||
{
|
||||
if (IsCheckingConditions == false &&
|
||||
if (plugin.IsCheckingConditions == false &&
|
||||
PlatformUI.isWorkbenchRunning())
|
||||
{
|
||||
if (WorkspaceUtils.checkConditions(false) == false &&
|
||||
IsSettingUpWorkspace == false)
|
||||
plugin.IsSettingUpWorkspace == false)
|
||||
{
|
||||
WorkspaceUtils.setupWorkspace(true);
|
||||
}
|
||||
|
|
|
@ -18,9 +18,9 @@ public class SetupWorkspaceHandler extends AbstractHandler
|
|||
{
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) {
|
||||
Activator.IsSettingUpWorkspace = true;
|
||||
Activator.getDefault().IsSettingUpWorkspace = true;
|
||||
WorkspaceUtils.setupWorkspace(true);
|
||||
Activator.IsSettingUpWorkspace = false;
|
||||
Activator.getDefault().IsSettingUpWorkspace = false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
*/
|
||||
public class DefinesSAXHandler extends DefaultHandler
|
||||
{
|
||||
private static Stack<String> stack_;
|
||||
private Stack<String> stack_;
|
||||
private Map<String, Define> defines_;
|
||||
|
||||
// indexes for different define properties
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
*/
|
||||
public class WMLSaxHandler extends DefaultHandler
|
||||
{
|
||||
private static Stack<String> stack_;
|
||||
private Stack<String> stack_;
|
||||
private Variable tmpVar_;
|
||||
private String filePath_;
|
||||
private ConfigFile cfg_;
|
||||
|
|
|
@ -491,7 +491,7 @@ public class WorkspaceUtils
|
|||
*/
|
||||
public static boolean checkConditions(boolean displayWarning)
|
||||
{
|
||||
Activator.IsCheckingConditions = true;
|
||||
Activator.getDefault().IsCheckingConditions = true;
|
||||
|
||||
String execDir = Preferences.getString(Constants.P_WESNOTH_EXEC_PATH);
|
||||
String userDir = Preferences.getString(Constants.P_WESNOTH_USER_DIR);
|
||||
|
|
Loading…
Add table
Reference in a new issue