Kaydet (Commit) 58eab576 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

java: final fields that can be static

found by PMD

Change-Id: I2b48f35d252d6e914c2a18a2c175b075a9d3ac0f
Reviewed-on: https://gerrit.libreoffice.org/13099Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 1658c017
......@@ -38,7 +38,7 @@ public class DesktopTerminate
{
private XMultiServiceFactory xMSF;
private final int iOfficeCloseTime = 1000;
private static final int iOfficeCloseTime = 1000;
/**
* Test if all available document types change the
......
......@@ -31,7 +31,7 @@ public final class XOutputStreamToByteArrayAdapter
extends ComponentBase
implements XOutputStream
{
private final int initialSize = 100240; // 10 kb
private static final int initialSize = 100240; // 10 kb
private int size = 0;
private int position = 0;
private boolean externalBuffer = false;
......
......@@ -35,7 +35,7 @@ import net.adaptivebox.problem.*;
import net.adaptivebox.space.*;
public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
private final int DVNum = 2; //Number of differential vectors, normally be 1 or 2
private static final int DVNum = 2; //Number of differential vectors, normally be 1 or 2
public double FACTOR = 0.5; //scale constant: (0, 1.2], normally be 0.5
public double CR = 0.9; //crossover constant: [0, 1], normally be 0.1 or 0.9
......
......@@ -25,7 +25,7 @@ import net.adaptivebox.global.*;
public class EvalElement {
//The weight for each response (target)
private final double weight = 1;
private static final double weight = 1;
/**
* The expected range of the response value, forms the following objective:
*
......
......@@ -39,15 +39,15 @@ public class ACRComparator implements IGoodnessCompareEngine, IUpdateCycleEngine
private final Library socialPool;
private double epsilon_t = 0;
private final double RU = 0.75;
private final double RL = 0.25;
private final double BETAF = 0.618;
private final double BETAL = 0.618;
private final double BETAU = 1.382;
private static final double RU = 0.75;
private static final double RL = 0.25;
private static final double BETAF = 0.618;
private static final double BETAL = 0.618;
private static final double BETAU = 1.382;
private final double T;
private final double TthR = 0.5;
private static final double TthR = 0.5;
public ACRComparator(Library lib, int T) {
socialPool = lib;
......
......@@ -48,9 +48,9 @@ public class SCAgent {
private IGoodnessCompareEngine specComparator;
//the coefficients of SCAgent
private final int TaoB = 2;
private static final int TaoB = 2;
//The early version set TaoW as the size of external library (NL), but 4 is often enough
private final int TaoW = 4;
private static final int TaoW = 4;
//The referred external library
private Library externalLib;
......
......@@ -57,7 +57,7 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
*/
private final XMultiServiceFactory m_xServiceFactory;
private XExtendedDocumentHandler m_xHandler;
private final boolean m_bPrettyPrint = true;
private static final boolean m_bPrettyPrint = true;
static private final String __serviceName = "devguide.officedev.samples.filter.FlatXmlJava";
static private final String __implName = "FlatXml";
......
......@@ -110,7 +110,7 @@ public class TextDocuments {
// adjust these constant to your local printer!
private static String sOutputDir;
private final String aPrinterName = "\\\\so-print\\xml3sof";
private static final String aPrinterName = "\\\\so-print\\xml3sof";
private XComponentContext mxRemoteContext = null;
private XMultiComponentFactory mxRemoteServiceManager = null;
......
......@@ -72,11 +72,11 @@ public class ConverterServlet extends HttpServlet {
/** Specifies the host for the office server.
*/
private final String stringHost = "localhost";
private static final String stringHost = "localhost";
/** Specifies the port for the office server.
*/
private final String stringPort = "2083";
private static final String stringPort = "2083";
/** Called by the server (via the service method) to allow a servlet to handle
* a POST request. The file from the client will be uploaded to the web server
......
......@@ -67,7 +67,7 @@ public class ParameterHelper
private String m_sPrinterName = null;
private final int m_nResolutionInDPI = 180;
private static final int m_nResolutionInDPI = 180;
private String m_sInputPath = null;
private String m_sOutputPath = null;
......
......@@ -51,7 +51,7 @@ public class TestParameters extends HashMap<String,Object> {
* Debug information will always be written on standard out.<br>
* default is true
*/
private final boolean DebugIsActive = false;
private static final boolean DebugIsActive = false;
/**
* Wrapper around "get()" with some debug output
......
......@@ -32,7 +32,7 @@ public class ShapeDsc extends InstDescr {
private final int y;
private final int height;
private final int width;
private final String name = null;
private static final String name = null;
private static final String ifcName = "com.sun.star.drawing.XShape";
private final String service;
......
......@@ -49,7 +49,7 @@ public class _XAccessibleValue extends MultiMethodTest {
private double minVal = 0;
private double maxVal = 0;
private final double curVal = 0;
private static final double curVal = 0;
private Object val = null;
XAccessibleValue anotherFromGroup = null;
......
......@@ -32,7 +32,7 @@ public class _XLayoutManager extends MultiMethodTest {
public XLayoutManager oObj = null;
private XFrame xFrame = null;
private final String sElementName = "private:resource/menubar/myMenu";
private static final String sElementName = "private:resource/menubar/myMenu";
@Override
public void before() {
......
......@@ -24,7 +24,7 @@ import lib.MultiMethodTest;
public class _XUIControllerRegistration extends MultiMethodTest {
public XUIControllerRegistration oObj = null;
private String aRegisteredController = null;
private final String aController = ".uno:MySecondController";
private static final String aController = ".uno:MySecondController";
@Override
public void before() {
......
......@@ -50,7 +50,7 @@ public class _XSingleSelectQueryAnalyzer extends MultiMethodTest {
// oObj filled by MultiMethodTest
public XSingleSelectQueryAnalyzer oObj = null ;
private final String queryString = "SELECT * FROM \"biblio\"";
private static final String queryString = "SELECT * FROM \"biblio\"";
private XSingleSelectQueryComposer xComposer = null;
......
......@@ -95,7 +95,7 @@ public class _XRow extends MultiMethodTest {
// oObj filled by MultiMethodTest
public XRow oObj = null ;
private List<Object> data = null ;
private final boolean notNullRes = true;
private static final boolean notNullRes = true;
/**
* Retrieves object relation first.
......
......@@ -35,8 +35,8 @@ import lib.MultiMethodTest;
public class _XUIConfigurationManager extends MultiMethodTest {
public XUIConfigurationManager oObj;
private final String msResourceUrl = "private:resource/menubar/menubar";
private final String msMyResourceUrl = "private:resource/menubar/mymenubar";
private static final String msResourceUrl = "private:resource/menubar/menubar";
private static final String msMyResourceUrl = "private:resource/menubar/mymenubar";
private XIndexContainer mxSettings = null;
private XIndexAccess mxMenuBarSettings = null;
private XMultiServiceFactory mxMSF = null;
......
......@@ -43,7 +43,7 @@ public class _XFilePicker extends MultiMethodTest {
public XFilePicker oObj = null;
private String dir = null ;
private final String fname = "space-metal.jpg" ;
private static final String fname = "space-metal.jpg" ;
/**
* Sets the current directory to the test document directory. <p>
......
......@@ -45,7 +45,7 @@ public class _XReplaceable extends MultiMethodTest {
public XReplaceable oObj = null;
public XReplaceDescriptor Rdesc = null;
private String mSearchString = "xTextDoc";
private final String mReplaceString = "** xTextDoc";
private static final String mReplaceString = "** xTextDoc";
private boolean mDispose = false;
/**
......
......@@ -66,7 +66,7 @@ public class various extends TestCase {
* which is free.
*/
protected static final int basePort = 50000;
private final int curPort = 50000;
private static final int curPort = 50000;
private XAcceptor xAcctr;
private XConnector xCntr;
......
......@@ -67,7 +67,7 @@ public class various extends TestCase {
* which is free.
*/
protected static final int basePort = 50000;
private final int curPort = 50000;
private static final int curPort = 50000;
private XAcceptor xAcctr;
private XConnector xCntr;
......
......@@ -56,7 +56,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* Creates Spreadsheet document.
......
......@@ -55,7 +55,7 @@ public class ScDataPilotFieldGroupObj extends TestCase
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* Creates Spreadsheet document.
......
......@@ -55,7 +55,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* Creates Spreadsheet document.
......
......@@ -69,7 +69,7 @@ public class ScDataPilotFieldObj extends TestCase {
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* Creates Spreadsheet document.
......
......@@ -70,7 +70,7 @@ public class ScDataPilotItemObj extends TestCase {
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* Creates Spreadsheet document.
......
......@@ -70,7 +70,7 @@ public class ScDataPilotItemsObj extends TestCase {
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* Creates Spreadsheet document.
......
......@@ -72,7 +72,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* Creates Spreadsheet document.
......
......@@ -69,7 +69,7 @@ public class CheckDataPilot {
* A field is filled some values. This integer determines the size of the
* field in x and y direction.
*/
private final int mMaxFieldIndex = 6;
private static final int mMaxFieldIndex = 6;
/**
* The test parameters
......
......@@ -55,7 +55,7 @@ public class _XDataPilotDescriptor {
private final XDataPilotDescriptor oObj;
private final CellRangeAddress CRA = new CellRangeAddress((short)1, 0, 0, 5, 5);
private final String sTag = "XDataPilotDescriptor_Tag";
private static final String sTag = "XDataPilotDescriptor_Tag";
private String fieldsNames[];
private int tEnvFieldsAmount = 0;
......
......@@ -38,7 +38,7 @@ import java.util.StringTokenizer;
public class ScriptMetaData extends ScriptEntry {
private boolean hasSource = false;
private final String locationPlaceHolder = "";
private static final String locationPlaceHolder = "";
private String source;
private final Parcel parent;
......
......@@ -65,10 +65,10 @@ public class LoadSaveTest
private XMultiServiceFactory m_xMSF = null;
private XGlobalEventBroadcaster m_xGEB = null;
private final String m_fileURL = "file://";
private static final String m_fileURL = "file://";
// these should be parameters or something?
private final String m_SourceDir = "FIXME";
private final String m_TargetDir = "/tmp/out";
private static final String m_SourceDir = "FIXME";
private static final String m_TargetDir = "/tmp/out";
@Before public void before() throws Exception
{
......
......@@ -99,7 +99,7 @@ public class CheckMemoryUsage /* extends ComplexTestCase */
TempDir m_aTempDir;
private String[][] sDocTypeExportFilter;
private String[][] sDocuments;
private final int iAllowMemoryIncrease = 10;
private static final int iAllowMemoryIncrease = 10;
private int iExportDocCount = 25;
/**
* The test parameters
......
......@@ -47,7 +47,7 @@ public class NumberFormatter
public XNumberFormats xNumberFormats;
public XNumberFormatTypes xNumberFormatTypes;
public XPropertySet xNumberFormatSettings;
private final boolean bNullDateCorrectionIsDefined = false;
private static final boolean bNullDateCorrectionIsDefined = false;
private final Locale aLocale;
......
......@@ -33,14 +33,14 @@ import com.sun.star.wizards.common.PropertyNames;
public class RelationController extends CommandName
{
private final int PKTABLE_CAT = 1;
private final int PKTABLE_SCHEM = 2;
private final int PKTABLE_NAME = 3;
private final int PKCOLUMN_NAME = 4;
private final int FKTABLE_CAT = 5;
private final int FKTABLE_SCHEM = 6;
private final int FKTABLE_NAME = 7;
private final int FKCOLUMN_NAME = 8;
private static final int PKTABLE_CAT = 1;
private static final int PKTABLE_SCHEM = 2;
private static final int PKTABLE_NAME = 3;
private static final int PKCOLUMN_NAME = 4;
private static final int FKTABLE_CAT = 5;
private static final int FKTABLE_SCHEM = 6;
private static final int FKTABLE_NAME = 7;
private static final int FKCOLUMN_NAME = 8;
public RelationController(CommandMetaData _CommandMetaData, String _CatalogName, String _SchemaName, String _TableName, boolean _baddQuotation)
{
......
......@@ -37,11 +37,11 @@ public class ReportLayouter
{
UnoDialog CurUnoDialog;
final int SOTXTTITLE = 28;
final int SOCONTENTLST = 29;
static final int SOTXTTITLE = 28;
static final int SOCONTENTLST = 29;
final static public int SOOPTLANDSCAPE = 30;
final static public int SOOPTPORTRAIT = 31;
final int SOLAYOUTLST = 32;
static final int SOLAYOUTLST = 32;
XListBox xContentListBox;
XListBox xLayoutListBox;
int iOldContentPos;
......
......@@ -53,7 +53,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
private final TableDescriptor curtabledescriptor;
private final CGCategory oCGCategory;
protected CGTable oCGTable;
private final String SELECTCATEGORY = "selectCategory";
private static final String SELECTCATEGORY = "selectCategory";
protected boolean bcolumnnameislimited;
private final int imaxcolumnchars;
private final String smytable;
......
......@@ -56,8 +56,8 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
private Size selectionGap = new Size(2, 2);
private boolean showButtons = true;
private Short step;
private final boolean refreshOverNull = true;
private final int imageTextLines = 1;
private static final boolean refreshOverNull = true;
private static final int imageTextLines = 1;
private boolean rowSelect = false;
public int tabIndex;
public Boolean scaleImages = Boolean.TRUE;
......
......@@ -39,7 +39,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator<
private String sTablePrefix;
private short m_iSelPos = -1;
private short iOldSelPos = -1;
private final boolean bpreselectCommand = true;
private static final boolean bpreselectCommand = true;
private boolean bgetQueries;
private final WizardDialog oWizardDialog;
private Collator aCollator = null;
......
......@@ -60,7 +60,7 @@ public class FilterComponent
private final String slblOperators;
private final String slblValue;
WizardDialog CurUnoDialog;
private final int BaseID = 2300;
private static final int BaseID = 2300;
private final String sIncSuffix;
private final ControlRow[] oControlRows;
private final String sDuplicateCondition;
......
......@@ -61,8 +61,8 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
private boolean showButtons = true;
private Short step;
private final static Short NO_BORDER = Short.valueOf((short) 0);
private final boolean refreshOverNull = true;
private final int imageTextLines = 1;
private static final boolean refreshOverNull = true;
private static final int imageTextLines = 1;
private boolean rowSelect = false;
public int tabIndex;
public Boolean scaleImages = Boolean.TRUE;
......
......@@ -48,7 +48,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
private static final String CANCEL_ACTION_PERFORMED = "cancelWizard_1";
private static final String HELP_ACTION_PERFORMED = "callHelp";
public VetoableChangeSupport vetos = new VetoableChangeSupport(this);
private final int iButtonWidth = 50;
private static final int iButtonWidth = 50;
private int nNewStep = 1;
private int nOldStep = 1;
private int nMaxStep = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment