Permalink
Browse files

docs: fix typos in code comments

closes #472
  • Loading branch information...
vlsi committed Dec 29, 2015
1 parent 7083008 commit 5d437128ce5252d043a912554d692a825c2b1cda
@@ -234,5 +234,11 @@
<!--<property name="exceptionVariableName" value="expected"/>-->
<!--</module>-->
<module name="CommentsIndentation"/>
<module name="Regexp">
<!-- known typos see #472 -->
<property name="format" value="(?i)\b(occur[^rs\s\W]|ocur[rs]|unkwon|didnt|doesnt|identifer|guarentee|seperated|wether|useage|gven|identifer|functin|tranlate|desribe)"/>
<property name="illegalPattern" value="true"/>
</module>
</module>
</module>
@@ -56,7 +56,7 @@ void handleResultRows(Query fromQuery, Field[] fields, List<byte[][]> tuples,
/**
* Called when a warning is emitted.
*
* @param warning the warning that occured.
* @param warning the warning that occurred.
*/
void handleWarning(SQLWarning warning);
@@ -287,7 +287,7 @@ private void doAuthentication(PGStream pgStream, String user, String password, L
switch (beresp) {
case 'E':
// An error occured, so pass the error message to the
// An error occurred, so pass the error message to the
// user.
//
// The most common one to be thrown here is:
@@ -412,7 +412,7 @@ private void doAuthentication(PGStream pgStream, String host, String user, Prope
switch (beresp) {
case 'E':
// An error occured, so pass the error message to the
// An error occurred, so pass the error message to the
// user.
//
// The most common one to be thrown here is:
@@ -120,7 +120,7 @@ public Connection getConnection() throws SQLException {
fireConnectionFatalError(sqlException);
throw sqlException;
}
// If any error occures while opening a new connection, the listeners
// If any error occurs while opening a new connection, the listeners
// have to be notified. This gives a chance to connection pools to
// eliminate bad pooled connections.
try {
@@ -411,7 +411,7 @@ public void connectionClosed(ConnectionEvent event) {
// There's now a new connection available
lock.notify();
} else {
// a connection error occured
// a connection error occurred
}
}
}
@@ -427,7 +427,7 @@ private synchronized void buildArrayList() throws SQLException {
StringBuilder buffer = null;
boolean insideString = false;
boolean wasInsideString = false; // needed for checking if NULL
// value occured
// value occurred
List<PgArrayList> dims = new ArrayList<PgArrayList>(); // array dimension arrays
PgArrayList curArray = arrayList; // currently processed array
@@ -840,7 +840,7 @@ public int getTransactionIsolation() throws SQLException {
}
}
// XXX revisit: throw exception instead of silently eating the error in unkwon cases?
// XXX revisit: throw exception instead of silently eating the error in unknown cases?
if (level == null) {
return Connection.TRANSACTION_READ_COMMITTED; // Best guess.
}
@@ -187,7 +187,7 @@ public boolean usesLocalFiles() throws SQLException {
}
/**
* Does the database use a file for each table? Well, not really, since it doesnt use local files.
* Does the database use a file for each table? Well, not really, since it doesn't use local files.
*
* @return true if so
* @throws SQLException if a database access error occurs
@@ -350,7 +350,7 @@ public String getSearchStringEscape() throws SQLException {
* {@inheritDoc}
*
* <p>
* Postgresql allows any high-bit character to be used in an unquoted identifer, so we can't
* Postgresql allows any high-bit character to be used in an unquoted identifier, so we can't
* possibly list them all.
*
* From the file src/backend/parser/scan.l, an identifier is ident_start [A-Za-z\200-\377_]
@@ -757,7 +757,7 @@ public boolean supportsOpenCursorsAcrossRollback() throws SQLException {
/**
* {@inheritDoc}
* <p>
* Can statements remain open across commits? They may, but this driver cannot guarentee that. In
* Can statements remain open across commits? They may, but this driver cannot guarantee that. In
* further reflection. we are talking a Statement object here, so the answer is yes, since the
* Statement is only a vehicle to ExecSQL()
*
@@ -770,7 +770,7 @@ public boolean supportsOpenStatementsAcrossCommit() throws SQLException {
/**
* {@inheritDoc}
* <p>
* Can statements remain open across rollbacks? They may, but this driver cannot guarentee that.
* Can statements remain open across rollbacks? They may, but this driver cannot guarantee that.
* In further contemplation, we are talking a Statement object here, so the answer is yes, since
* the Statement is only a vehicle to ExecSQL() in Connection
*
@@ -2292,8 +2292,8 @@ private void addACLPrivileges(String acl, Map<String, Map<String, List<String[]>
* Postgresql does not have any column types that are automatically updated like some databases'
* timestamp type. We can't tell what rules or triggers might be doing, so we are left with the
* system columns that change on an update. An update may change all of the following system
* columns: ctid, xmax, xmin, cmax, and cmin. Depending on if we are in a transaction and wether
* we roll it back or not the only guaranteed change is to ctid. -KJ
* columns: ctid, xmax, xmin, cmax, and cmin. Depending on if we are in a transaction and
* whether we roll it back or not the only guaranteed change is to ctid. -KJ
*/
tuple[0] = null;
@@ -2650,7 +2650,7 @@ private void addACLPrivileges(String acl, Map<String, Map<String, List<String[]>
// Note, I am guessing at most of this, but it should be close
// if not, please correct
// the keys are in pairs and start after the first four arguments
// the arguments are seperated by \000
// the arguments are separated by \000
String targs = rs.getString(11);
@@ -2759,7 +2759,7 @@ private void addACLPrivileges(String acl, Map<String, Map<String, List<String[]>
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(sql);
// cache some results, this will keep memory useage down, and speed
// cache some results, this will keep memory usage down, and speed
// things up a little.
byte bZero[] = connection.encodeString("0");
byte b10[] = connection.encodeString("10");
@@ -3280,7 +3280,7 @@ public boolean locatorsUpdateCopy() throws SQLException {
/*
* Currently LOB's aren't updateable at all, so it doesn't matter what we return. We don't throw
* the notImplemented Exception because the 1.5 JDK's CachedRowSet calls this method regardless
* of wether large objects are used.
* of whether large objects are used.
*/
return true;
}
@@ -639,7 +639,7 @@ static String replaceProcessing(String p_sql, boolean replaceProcessingEnabled,
}
/**
* parse the given sql from index i, appending it to the gven buffer until we hit an unmatched
* parse the given sql from index i, appending it to the given buffer until we hit an unmatched
* right parentheses or end of string. When the stopOnComma flag is set we also stop processing
* when a comma is found in sql text that isn't inside nested parenthesis.
*
@@ -668,7 +668,7 @@ protected static int parseSql(String p_sql, int i, StringBuilder newsql, boolean
// start of a string?
state = IN_STRING;
} else if (c == '"') {
// start of a identifer?
// start of a identifier?
state = IN_IDENTIFIER;
} else if (c == '(') { // begin nested sql
nestedParenthesis++;
@@ -784,7 +784,7 @@ protected static int parseSql(String p_sql, int i, StringBuilder newsql, boolean
* generate sql for escaped functions
*
* @param functionName the escaped function name
* @param args the arguments for this functin
* @param args the arguments for this function
* @param stdStrings whether standard_conforming_strings is on
* @return the right postgreSql sql
* @throws SQLException if something goes wrong
@@ -804,7 +804,7 @@ protected static String escapeFunction(String functionName, String args, boolean
}
i++;
}
// we can now tranlate escape functions
// we can now translate escape functions
try {
Method escapeMethod = EscapedFunctions.getFunction(functionName);
return (String) escapeMethod.invoke(null, new Object[]{parsedArgs});
@@ -925,7 +925,7 @@ protected ResultHandler createBatchHandler(int[] updateCounts, Query[] queries,
int flags = 0;
// Force a Describe before any execution? We need to do this if we're going
// to send anything dependent on the Desribe results, e.g. binary parameters.
// to send anything dependent on the Describe results, e.g. binary parameters.
boolean preDescribe = false;
if (wantsGeneratedKeysAlways) {
@@ -70,7 +70,7 @@ public StreamWrapper(InputStream stream) throws PSQLException {
/*
* Usually, closing stream should be done by pgjdbc clients. Here it's an internally
* managed stream so we need to auto-close it and be sure to delete the temporary file
* when doing so. Auto-closing will be done when the first occur: reaching EOF or Garbage
* when doing so. Auto-closing will be done when the first occurs: reaching EOF or Garbage
* Collection
*/
private boolean _closed = false;
@@ -27,7 +27,7 @@
/**
* Some simple tests based on problems reported by users. Hopefully these will help prevent previous
* problems from re-occuring ;-)
* problems from re-occurring ;-)
*/
public class BlobTest extends TestCase {
@@ -20,7 +20,7 @@
/*
* Some simple tests based on problems reported by users. Hopefully these will help prevent previous
* problems from re-occuring ;-)
* problems from re-occurring ;-)
*
*/
public class DateTest extends TestCase {
@@ -22,7 +22,7 @@
/*
* Some simple tests based on problems reported by users. Hopefully these will help prevent previous
* problems from re-occuring ;-)
* problems from re-occurring ;-)
*
*/
public class MiscTest extends TestCase {
@@ -491,7 +491,7 @@ public void testSetQueryTimeout() throws SQLException {
timer.schedule(new TimerTask() {
public void run() {
fail("Query timeout should have occured and cleaned this up");
fail("Query timeout should have occurred and cleaned this up");
}
}, 5000);
stmt.setQueryTimeout(1);
@@ -24,7 +24,7 @@
/*
* Some simple tests based on problems reported by users. Hopefully these will help prevent previous
* problems from re-occuring ;-)
* problems from re-occurring ;-)
*
*/
public class TimeTest extends TestCase {

0 comments on commit 5d43712

Please sign in to comment.