summaryrefslogtreecommitdiff
path: root/xmerge/source/palmtests/qa/comparator/pdbcomparison.java
diff options
context:
space:
mode:
Diffstat (limited to 'xmerge/source/palmtests/qa/comparator/pdbcomparison.java')
-rw-r--r--xmerge/source/palmtests/qa/comparator/pdbcomparison.java96
1 files changed, 48 insertions, 48 deletions
diff --git a/xmerge/source/palmtests/qa/comparator/pdbcomparison.java b/xmerge/source/palmtests/qa/comparator/pdbcomparison.java
index 25191c4e79a7..785abbad0e75 100644
--- a/xmerge/source/palmtests/qa/comparator/pdbcomparison.java
+++ b/xmerge/source/palmtests/qa/comparator/pdbcomparison.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ public class pdbcomparison
private String pdbarr1[];
private String pdbarr2[];
-
+
/**
* Default Constructor
@@ -72,7 +72,7 @@ public class pdbcomparison
str += "********************************************************\n";
System.out.println(str);
-
+
}
/**
@@ -81,7 +81,7 @@ public class pdbcomparison
* output file and updates the array pdbarr1 and pdbarr2 with
* list of pdb's to be compared.
*
- * @param propFile Property filename which list the log/outputfile/list/pdb
+ * @param propFile Property filename which list the log/outputfile/list/pdb
* names
* @return
*
@@ -98,7 +98,7 @@ public class pdbcomparison
System.out.println("Could not open Property File " + propFile);
return;
}
-
+
String logFile = defaultProps.getProperty(this.LOGTAG);
String outFile = defaultProps.getProperty(this.OUTTAG);
@@ -114,10 +114,10 @@ public class pdbcomparison
}
if (logFile == null || logFile.length() == 0)
- logFile = this.LOGFILE;
+ logFile = this.LOGFILE;
if (outFile == null || outFile.length() == 0)
- outFile = this.LOGFILE;
+ outFile = this.LOGFILE;
// validate log and output files
@@ -126,7 +126,7 @@ public class pdbcomparison
LOGFILE = logFile;
OUTFILE = outFile;
- System.out.println("Output is written to log file... " + LOGFILE);
+ System.out.println("Output is written to log file... " + LOGFILE);
if (listFile != null)
{
if (! checkFile(listFile)) return;
@@ -144,7 +144,7 @@ public class pdbcomparison
* Also validates permissions to create.
*
* @param filename name of file to be created
- * @return true, if file could be created
+ * @return true, if file could be created
* false, if could not.
*
*/
@@ -171,7 +171,7 @@ public class pdbcomparison
return false;
}
- if (newF.exists())
+ if (newF.exists())
{
try {
newF.delete();
@@ -210,9 +210,9 @@ public class pdbcomparison
}
}
-
+
return true;
-
+
}
/**
@@ -246,25 +246,25 @@ public class pdbcomparison
System.out.println("Cannot read file " + filename);
return false;
}
-
+
return true;
-
+
}
/**
- * This method populates the pdb arrays with the names of the pdbs to
+ * This method populates the pdb arrays with the names of the pdbs to
* compare. Ths listFile lists a series of entries, wherein each
* line indicates the PDB names to be compared.
* <pdbname1>=<pdbname2>
- *
+ *
* @param listFile name of the listfile
- * @return
+ * @return
*
*/
private void populatePDBArray(String listFile)
{
// open ListFile and populate the PDB list to be compared
- if (listFile != null)
+ if (listFile != null)
{
Properties listProps = new Properties();
try {
@@ -275,7 +275,7 @@ public class pdbcomparison
System.out.println("Could not open List File " + listFile);
return;
}
-
+
pdbarr1 = new String[listProps.size()];
pdbarr2 = new String[listProps.size()];
Enumeration e = listProps.keys();
@@ -283,7 +283,7 @@ public class pdbcomparison
while (e.hasMoreElements())
{
pdbarr1[j] = (String)e.nextElement();
- pdbarr2[j] = listProps.getProperty(pdbarr1[j]);
+ pdbarr2[j] = listProps.getProperty(pdbarr1[j]);
j++;
}
@@ -291,12 +291,12 @@ public class pdbcomparison
}
/**
- * This method populates the pdb arrays with the names of the pdbs to
- * compare.
- *
+ * This method populates the pdb arrays with the names of the pdbs to
+ * compare.
+ *
* @param pdbname1 Name of 2nd PDB file to be compared
* @param pdbname2 Name of 2nd PDB file to be compared
- * @return
+ * @return
*
*/
private void populatePDBArray(String pdbname1, String pdbname2)
@@ -304,7 +304,7 @@ public class pdbcomparison
if (pdbname1 == null) return;
if (pdbname2 == null) return;
- if ((pdbname1 != null) && (pdbname2 != null))
+ if ((pdbname1 != null) && (pdbname2 != null))
{
pdbarr1 = new String[1];
pdbarr2 = new String[1];
@@ -315,11 +315,11 @@ public class pdbcomparison
}
/**
- * This method populates the pdb arrays with the names of the pdbs to
- * compare.
- *
- * @param arrayno Array number which corresponds to the pdb array
- * containing list of pdbs
+ * This method populates the pdb arrays with the names of the pdbs to
+ * compare.
+ *
+ * @param arrayno Array number which corresponds to the pdb array
+ * containing list of pdbs
* If 1 then send pdbarr1, if 2 send pdbarr2 else null
*
* @return PDB string array containing list of PDB's
@@ -364,13 +364,13 @@ public class pdbcomparison
if (pdb1.equals(pdb2)) {
writeToLog("PDB " + pdbname1 + " and PDB " + pdbname2 + " are equal");
-
+
return true;
} else {
writeToLog("PDB " + pdbname1 + " and PDB " + pdbname2 + " are not equal");
return false;
}
- }
+ }
@@ -378,7 +378,7 @@ public class pdbcomparison
* Write message to LOGFILE
*
* @param msg Message to be written to log file
- * @return
+ * @return
*
*/
private void writeToLog(String msg)
@@ -403,7 +403,7 @@ public class pdbcomparison
System.out.println("ERROR: Could not write to File " + LOGFILE);
return;
}
- }
+ }
/**
* Write status of comparison to OUTFILE
@@ -412,7 +412,7 @@ public class pdbcomparison
* @param pdbname1 file name of pdb which was compared.
* @param pdbname2 file name of pdb which was compared.
*
- * @return
+ * @return
*
*/
private void writeToOutputFile(String status, String pdbname1, String pdbname2)
@@ -435,7 +435,7 @@ public class pdbcomparison
try {
long len = raf.length();
raf.seek(len);
-
+
raf.write(msg.getBytes());
raf.write("\n".getBytes());
} catch (IOException e) {
@@ -450,7 +450,7 @@ public class pdbcomparison
return;
}
- }
+ }
@@ -458,7 +458,7 @@ public class pdbcomparison
* Main starting block of execution
*
* @param command line args captured in an array of Strings
- * @return
+ * @return
*
*/
public static void main(String args[])
@@ -469,16 +469,16 @@ public class pdbcomparison
int nargs = args.length;
int status=0;
- if (nargs != 1)
- {
+ if (nargs != 1)
+ {
System.out.println("Incorrect no. of arguments passed...");
pdbcmp.usage();
System.exit(-1);
-
+
}
String propFile = args[0];
-
+
File f=null;
try {
f = new File(propFile);
@@ -486,7 +486,7 @@ public class pdbcomparison
System.out.println("Exception: Could not open file " + propFile);
System.exit(-1);
}
-
+
if (! f.canRead()) {
System.out.println("Exception: " + propFile + " is not a file ");
System.exit(-1);
@@ -497,16 +497,16 @@ public class pdbcomparison
System.exit(-1);
}
- // parse Property file
+ // parse Property file
pdbcmp.parsePropertyFile(propFile);
String pdbarr1[] = pdbcmp.getPDBArray(1);
String pdbarr2[] = pdbcmp.getPDBArray(2);
- if ( (pdbarr1 == null) ||
+ if ( (pdbarr1 == null) ||
(pdbarr2 == null) ||
- (pdbarr1.length == 0) ||
+ (pdbarr1.length == 0) ||
(pdbarr1.length == 0))
- {
+ {
System.out.println("pdbArray is empty. No PDBS to compare... \n");
System.exit(-1);
}
@@ -536,7 +536,7 @@ public class pdbcomparison
pdbcmp.writeToLog("PDB Comparison: end time " + endTime);
pdbcmp.writeToLog("************** End *****************n");
pdbcmp.writeToLog("\n");
-
+
System.exit(status);
}
}