Formatting cleanup
This commit is contained in:
parent
65b47d0755
commit
ec1758ce20
222 changed files with 2739 additions and 2726 deletions
|
|
@ -167,7 +167,7 @@ public class ExternalSort {
|
||||||
for (int i=0; i<rows.length; i++) {
|
for (int i=0; i<rows.length; i++) {
|
||||||
if (rows[i] != null) {
|
if (rows[i] != null) {
|
||||||
if (minIndex < 0) {
|
if (minIndex < 0) {
|
||||||
throw(new IOException("Error sorting!!!"));
|
throw new IOException("Error sorting!!!");
|
||||||
}
|
}
|
||||||
someFileStillHasRows = true;
|
someFileStillHasRows = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,7 @@ public class MergeSort{
|
||||||
if (index2 < stop-start && (index1 >= length || tmp[index1] > tmp[index2])) {
|
if (index2 < stop-start && (index1 >= length || tmp[index1] > tmp[index2])) {
|
||||||
list[i] = tmp[index2];
|
list[i] = tmp[index2];
|
||||||
++index2;
|
++index2;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
list[i] = tmp[index1];
|
list[i] = tmp[index1];
|
||||||
++index1;
|
++index1;
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +145,7 @@ public class MergeSort{
|
||||||
if (index2 < stop-start && (index1 >= length || ((Comparable)tmp[index1]).compareTo(tmp[index2]) > 0)) {
|
if (index2 < stop-start && (index1 >= length || ((Comparable)tmp[index1]).compareTo(tmp[index2]) > 0)) {
|
||||||
list.set(i, (T) tmp[index2]);
|
list.set(i, (T) tmp[index2]);
|
||||||
++index2;
|
++index2;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
list.set(i, (T) tmp[index1]);
|
list.set(i, (T) tmp[index1]);
|
||||||
++index1;
|
++index1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ public abstract class LineAxis extends AbstractChart{
|
||||||
chartBound = new Rectangle();
|
chartBound = new Rectangle();
|
||||||
int stepLength = 7;
|
int stepLength = 7;
|
||||||
|
|
||||||
// **********************************
|
// ------------------------------------------------
|
||||||
// Calculate Font sizes
|
// Calculate Font sizes
|
||||||
// **********************************
|
// ------------------------------------------------
|
||||||
|
|
||||||
FontMetrics metric = g2.getFontMetrics();
|
FontMetrics metric = g2.getFontMetrics();
|
||||||
int fontHeight = metric.getHeight();
|
int fontHeight = metric.getHeight();
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,7 @@ public class SQLQuery {
|
||||||
private SQLFrom joinTable(String type, String[] tables) {
|
private SQLFrom joinTable(String type, String[] tables) {
|
||||||
if (tables.length < 2)
|
if (tables.length < 2)
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
for (int i=0; i<tables.length; i++) {
|
for (int i=0; i<tables.length; i++) {
|
||||||
str.append(tables[i]);
|
str.append(tables[i]);
|
||||||
|
|
@ -204,6 +205,7 @@ public class SQLQuery {
|
||||||
str.append(' ').append(type).append(' ');
|
str.append(' ').append(type).append(' ');
|
||||||
}
|
}
|
||||||
this.tables.add(str.toString());
|
this.tables.add(str.toString());
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -224,12 +226,15 @@ public class SQLQuery {
|
||||||
query.append(" FROM ");
|
query.append(" FROM ");
|
||||||
if (tables.isEmpty())
|
if (tables.isEmpty())
|
||||||
throw new RuntimeException("The FROM query item must have at least 1 table!");
|
throw new RuntimeException("The FROM query item must have at least 1 table!");
|
||||||
|
|
||||||
for (int i=0; i<tables.size(); i++) {
|
for (int i=0; i<tables.size(); i++) {
|
||||||
query.append(tables.get(i));
|
query.append(tables.get(i));
|
||||||
if (i != tables.size() - 1)
|
if (i != tables.size() - 1)
|
||||||
query.append(", ");
|
query.append(", ");
|
||||||
}
|
}
|
||||||
if( next != null ) next.build( query );
|
|
||||||
|
if (next != null)
|
||||||
|
next.build(query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -300,7 +305,8 @@ public class SQLQuery {
|
||||||
protected void build(StringBuilder query) {
|
protected void build(StringBuilder query) {
|
||||||
query.append(" WHERE ");
|
query.append(" WHERE ");
|
||||||
if (conds.isEmpty())
|
if (conds.isEmpty())
|
||||||
throw new RuntimeException("The WHERE query item must hav atleast 1 condition!");
|
throw new RuntimeException("The WHERE query item must have minimum 1 condition!");
|
||||||
|
|
||||||
for (int i=0; i<conds.size(); i++) {
|
for (int i=0; i<conds.size(); i++) {
|
||||||
query.append(conds.get(i));
|
query.append(conds.get(i));
|
||||||
if (i != conds.size() - 1)
|
if (i != conds.size() - 1)
|
||||||
|
|
@ -336,7 +342,8 @@ public class SQLQuery {
|
||||||
protected void build(String op, StringBuilder query) {
|
protected void build(String op, StringBuilder query) {
|
||||||
query.append(' ').append(op).append(' ');
|
query.append(' ').append(op).append(' ');
|
||||||
if (cols == null || cols.length <= 0)
|
if (cols == null || cols.length <= 0)
|
||||||
throw new RuntimeException("The "+op+" query item must hav atleast 1 column!");
|
throw new RuntimeException("The " + op + " query item must have minimum 1 column!");
|
||||||
|
|
||||||
for (int i=0; i<cols.length; i++) {
|
for (int i=0; i<cols.length; i++) {
|
||||||
query.append(cols[i]);
|
query.append(cols[i]);
|
||||||
if (i != cols.length - 1)
|
if (i != cols.length - 1)
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ public abstract class ImageFilterProcessor {
|
||||||
* Sets the progress in percent
|
* Sets the progress in percent
|
||||||
*/
|
*/
|
||||||
protected void setProgress(double percent) {
|
protected void setProgress(double percent) {
|
||||||
if(progress != null) progress.progressUpdate(this, null, percent);
|
if (progress != null)
|
||||||
|
progress.progressUpdate(this, null, percent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,9 @@ public class RAWImageUtil {
|
||||||
* @return A copy of the data array
|
* @return A copy of the data array
|
||||||
*/
|
*/
|
||||||
public static int[][][] crop(int[][][] data, int xData, int yData, int[][][] crop, int xCrop, int yCrop, int width, int height) {
|
public static int[][][] crop(int[][][] data, int xData, int yData, int[][][] crop, int xCrop, int yCrop, int width, int height) {
|
||||||
if(crop==null) crop = new int[width][height][4];
|
if (crop == null)
|
||||||
|
crop = new int[width][height][4];
|
||||||
|
|
||||||
for (int y=0; y<width; y++) {
|
for (int y=0; y<width; y++) {
|
||||||
for (int x=0; x<height; x++) {
|
for (int x=0; x<height; x++) {
|
||||||
crop[y+yData][x+xData][0] = data[y+yCrop][x+xCrop][0];
|
crop[y+yData][x+xData][0] = data[y+yCrop][x+xCrop][0];
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ public class FileUtil {
|
||||||
public static String getFileExtension(String file) {
|
public static String getFileExtension(String file) {
|
||||||
if (file == null || file.lastIndexOf(".") == -1)
|
if (file == null || file.lastIndexOf(".") == -1)
|
||||||
return "";
|
return "";
|
||||||
return file.substring(file.lastIndexOf(".")+1, file.length());
|
return file.substring(file.lastIndexOf(".")+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ public class InetScanner {
|
||||||
private static String platformPingCmd(String ip) {
|
private static String platformPingCmd(String ip) {
|
||||||
switch (OSAbstractionLayer.getInstance().getOSType()) {
|
switch (OSAbstractionLayer.getInstance().getOSType()) {
|
||||||
case Windows:
|
case Windows:
|
||||||
return "ping -n 1 -w "+ TIMEOUT_SEC*1000 +" " + ip;
|
return "ping -n 1 -w " + (TIMEOUT_SEC*1000) + " " + ip;
|
||||||
case Linux:
|
case Linux:
|
||||||
case MacOS:
|
case MacOS:
|
||||||
return "ping -c 1 -W " + TIMEOUT_SEC + " " + ip;
|
return "ping -c 1 -W " + TIMEOUT_SEC + " " + ip;
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,10 @@ public abstract class ThreadedTCPNetworkServer extends Thread{
|
||||||
while (true) {
|
while (true) {
|
||||||
Socket connectionSocket = serverSocket.accept();
|
Socket connectionSocket = serverSocket.accept();
|
||||||
ThreadedTCPNetworkServerThread thread = getThreadInstance(connectionSocket);
|
ThreadedTCPNetworkServerThread thread = getThreadInstance(connectionSocket);
|
||||||
|
|
||||||
if (thread != null) {
|
if (thread != null) {
|
||||||
executor.execute(thread);
|
executor.execute(thread);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
logger.severe("Unable to instantiate ThreadedTCPNetworkServerThread, closing connection!");
|
logger.severe("Unable to instantiate ThreadedTCPNetworkServerThread, closing connection!");
|
||||||
connectionSocket.close();
|
connectionSocket.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,9 @@ public class BloomFilter<T extends Serializable> implements Set<T>, Serializable
|
||||||
*/
|
*/
|
||||||
public boolean contains(Object o) {
|
public boolean contains(Object o) {
|
||||||
try {
|
try {
|
||||||
if(!(o instanceof Serializable))return false;
|
if (!(o instanceof Serializable))
|
||||||
|
return false;
|
||||||
|
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
for (int i=0; i<k; i++) {
|
for (int i=0; i<k; i++) {
|
||||||
hash = Hasher.MurmurHash((Serializable)o, hash);
|
hash = Hasher.MurmurHash((Serializable)o, hash);
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,7 @@ public class Configurator<T> {
|
||||||
public Configurator<T> setValues(DataNode node) {
|
public Configurator<T> setValues(DataNode node) {
|
||||||
if (!node.isMap())
|
if (!node.isMap())
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
for (ConfigurationParam param : this.params) {
|
for (ConfigurationParam param : this.params) {
|
||||||
if (node.get(param.getName()) != null)
|
if (node.get(param.getName()) != null)
|
||||||
param.setValue(node.getString(param.getName()));
|
param.setValue(node.getString(param.getName()));
|
||||||
|
|
|
||||||
|
|
@ -188,9 +188,11 @@ public class Wizard implements ActionListener{
|
||||||
listener.onCancel(page, values);
|
listener.onCancel(page, values);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pages.add(nextPage);
|
pages.add(nextPage);
|
||||||
displayWizardPage(nextPage);
|
displayWizardPage(nextPage);
|
||||||
back.setEnabled(true);
|
back.setEnabled(true);
|
||||||
|
|
||||||
if (nextPage.isFinalPage()) {
|
if (nextPage.isFinalPage()) {
|
||||||
next.setEnabled(false);
|
next.setEnabled(false);
|
||||||
finish.setEnabled(true);
|
finish.setEnabled(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue