Added missing final modifiers.
This commit is contained in:
@@ -52,18 +52,18 @@ public class DBDumper
|
||||
{
|
||||
try (Formatter form = new Formatter())
|
||||
{
|
||||
Connection con = _frame.getConnection();
|
||||
final Connection con = _frame.getConnection();
|
||||
try (Statement s = con.createStatement();
|
||||
ResultSet rset = s.executeQuery("SHOW TABLES"))
|
||||
{
|
||||
File dump = new File("dumps", form.format("%1$s_dump_%2$tY%2$tm%2$td-%2$tH%2$tM%2$tS.sql", _db, new GregorianCalendar().getTime()).toString());
|
||||
final File dump = new File("dumps", form.format("%1$s_dump_%2$tY%2$tm%2$td-%2$tH%2$tM%2$tS.sql", _db, new GregorianCalendar().getTime()).toString());
|
||||
new File("dumps").mkdir();
|
||||
dump.createNewFile();
|
||||
|
||||
_frame.appendToProgressArea("Writing dump " + dump.getName());
|
||||
if (rset.last())
|
||||
{
|
||||
int rows = rset.getRow();
|
||||
final int rows = rset.getRow();
|
||||
rset.beforeFirst();
|
||||
if (rows > 0)
|
||||
{
|
||||
@@ -84,7 +84,7 @@ public class DBDumper
|
||||
try (Statement desc = con.createStatement();
|
||||
ResultSet dset = desc.executeQuery("DESC " + rset.getString(1)))
|
||||
{
|
||||
Map<String, List<String>> keys = new HashMap<>();
|
||||
final Map<String, List<String>> keys = new HashMap<>();
|
||||
boolean isFirst = true;
|
||||
while (dset.next())
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ScriptExecutor
|
||||
{
|
||||
_frame.appendToProgressArea("Installing " + file.getName());
|
||||
String line = "";
|
||||
Connection con = _frame.getConnection();
|
||||
final Connection con = _frame.getConnection();
|
||||
try (Statement stmt = con.createStatement();
|
||||
Scanner scn = new Scanner(file))
|
||||
{
|
||||
@@ -114,13 +114,13 @@ public class ScriptExecutor
|
||||
{
|
||||
try
|
||||
{
|
||||
Object[] options =
|
||||
final Object[] options =
|
||||
{
|
||||
"Continue",
|
||||
"Abort"
|
||||
};
|
||||
|
||||
int n = JOptionPane.showOptionDialog(null, "MySQL Error: " + e.getMessage(), "Script Error", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
|
||||
final int n = JOptionPane.showOptionDialog(null, "MySQL Error: " + e.getMessage(), "Script Error", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
|
||||
if (n == 1)
|
||||
{
|
||||
System.exit(0);
|
||||
|
||||
@@ -76,11 +76,11 @@ public class SpringUtilities
|
||||
return;
|
||||
}
|
||||
|
||||
Spring xPadSpring = Spring.constant(xPad);
|
||||
Spring yPadSpring = Spring.constant(yPad);
|
||||
Spring initialXSpring = Spring.constant(initialX);
|
||||
Spring initialYSpring = Spring.constant(initialY);
|
||||
int max = rows * cols;
|
||||
final Spring xPadSpring = Spring.constant(xPad);
|
||||
final Spring yPadSpring = Spring.constant(yPad);
|
||||
final Spring initialXSpring = Spring.constant(initialX);
|
||||
final Spring initialYSpring = Spring.constant(initialY);
|
||||
final int max = rows * cols;
|
||||
|
||||
// Calculate Springs that are the max of the width/height so that all
|
||||
// cells have the same size.
|
||||
@@ -88,7 +88,7 @@ public class SpringUtilities
|
||||
Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).getWidth();
|
||||
for (int i = 1; i < max; i++)
|
||||
{
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent.getComponent(i));
|
||||
final SpringLayout.Constraints cons = layout.getConstraints(parent.getComponent(i));
|
||||
|
||||
maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
|
||||
maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
|
||||
@@ -98,7 +98,7 @@ public class SpringUtilities
|
||||
// components to have the same size.
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent.getComponent(i));
|
||||
final SpringLayout.Constraints cons = layout.getConstraints(parent.getComponent(i));
|
||||
|
||||
cons.setWidth(maxWidthSpring);
|
||||
cons.setHeight(maxHeightSpring);
|
||||
@@ -110,7 +110,7 @@ public class SpringUtilities
|
||||
SpringLayout.Constraints lastRowCons = null;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent.getComponent(i));
|
||||
final SpringLayout.Constraints cons = layout.getConstraints(parent.getComponent(i));
|
||||
if ((i % cols) == 0)
|
||||
{ // start of new row
|
||||
lastRowCons = lastCons;
|
||||
@@ -142,7 +142,7 @@ public class SpringUtilities
|
||||
}
|
||||
|
||||
// Set the parent's size.
|
||||
SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
final SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
if (lastCons != null)
|
||||
{
|
||||
pCons.setConstraint(SpringLayout.SOUTH, Spring.sum(Spring.constant(yPad), lastCons.getConstraint(SpringLayout.SOUTH)));
|
||||
@@ -153,8 +153,8 @@ public class SpringUtilities
|
||||
/* Used by makeCompactGrid. */
|
||||
private static SpringLayout.Constraints getConstraintsForCell(int row, int col, Container parent, int cols)
|
||||
{
|
||||
SpringLayout layout = (SpringLayout) parent.getLayout();
|
||||
Component c = parent.getComponent((row * cols) + col);
|
||||
final SpringLayout layout = (SpringLayout) parent.getLayout();
|
||||
final Component c = parent.getComponent((row * cols) + col);
|
||||
return layout.getConstraints(c);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ public class SpringUtilities
|
||||
}
|
||||
for (int r = 0; r < rows; r++)
|
||||
{
|
||||
SpringLayout.Constraints constraints = getConstraintsForCell(r, c, parent, cols);
|
||||
final SpringLayout.Constraints constraints = getConstraintsForCell(r, c, parent, cols);
|
||||
constraints.setX(x);
|
||||
constraints.setWidth(width);
|
||||
}
|
||||
@@ -211,7 +211,7 @@ public class SpringUtilities
|
||||
}
|
||||
for (int c = 0; c < cols; c++)
|
||||
{
|
||||
SpringLayout.Constraints constraints = getConstraintsForCell(r, c, parent, cols);
|
||||
final SpringLayout.Constraints constraints = getConstraintsForCell(r, c, parent, cols);
|
||||
constraints.setY(y);
|
||||
constraints.setHeight(height);
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class SpringUtilities
|
||||
}
|
||||
|
||||
// Set the parent's size.
|
||||
SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
final SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
pCons.setConstraint(SpringLayout.SOUTH, y);
|
||||
pCons.setConstraint(SpringLayout.EAST, x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user