Author: mlebihan
Date: Wed Jan 7 06:34:41 2015
New Revision: 1649998
URL: http://svn.apache.org/r1649998
Log:
Coding conventions.
Modified:
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/logging/AbstractAutoChecker.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileDescriptor.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLConnectionClosedException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/SQLClosingIOFailureException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractBuiltInMemoryResultSet.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForColumnsListing.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesTypesListing.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLIllegalColumnIndexException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLNoResultException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLNoSuchFieldException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLNotDateException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLNotNumericException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/sql/CrudeSQLParser.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/sql/SQLIllegalParameterException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/sql/SQLInvalidStatementException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/sql/SQLUnsupportedParsingFeatureException.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java
sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/AbstractTestBaseForInternalJDBC.java
Modified:
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/logging/AbstractAutoChecker.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/logging/AbstractAutoChecker.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/logging/AbstractAutoChecker.java
[UTF-8] (original)
+++
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/logging/AbstractAutoChecker.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -30,7 +30,7 @@ import java.util.logging.Logger;
* and easy access to Bundle and logging function.
* @author Marc LE BIHAN
*/
-abstract public class AbstractAutoChecker {
+public abstract class AbstractAutoChecker {
/** Logger. */
private Logger logger = Logging.getLogger(getClass().getSimpleName());
@@ -135,7 +135,7 @@ abstract public class AbstractAutoChecke
* @param cause Exception root cause.
* @throws E wished exception.
*/
- static public <E extends Throwable> void throwException(Class<E>
classException, String message, Throwable cause) throws E {
+ public static <E extends Throwable> void throwException(Class<E>
classException, String message, Throwable cause) throws E {
throw(exception(classException, message, cause));
}
@@ -147,7 +147,7 @@ abstract public class AbstractAutoChecke
* @param cause Exception root cause.
* @return E wished exception.
*/
- static private <E extends Throwable> E exception(Class<E> classException,
String message, Throwable cause) {
+ private static <E extends Throwable> E exception(Class<E> classException,
String message, Throwable cause) {
Objects.requireNonNull(classException, "The class of the exception to
throw cannot be null."); //$NON-NLS-1$
try
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileDescriptor.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileDescriptor.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileDescriptor.java
(original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileDescriptor.java
Wed Jan 7 06:34:41 2015
@@ -30,65 +30,65 @@ import org.apache.sis.storage.shapefile.
*/
public class ShapefileDescriptor {
/** File code. */
- private int m_fileCode; // big
+ private int fileCode; // big
/** File length. */
- private int m_fileLength; // big // The value for file length is the total
length of the file in 16-bit words
+ private int fileLength; // big // The value for file length is the total
length of the file in 16-bit words
/** File version. */
- private int m_version; // little
+ private int version; // little
/** Shapefile type. */
- private ShapeTypeEnum m_shapeType; // little
+ private ShapeTypeEnum shapeType; // little
/** X Min. */
- private double m_xmin; // little
+ private double xmin; // little
/** Y Min. */
- private double m_ymin; // little
+ private double ymin; // little
/** X Max. */
- private double m_xmax; // little
+ private double xmax; // little
/** Y Max. */
- private double m_ymax; // little
+ private double ymax; // little
/** Z Min. */
- private double m_zmin; // little
+ private double zmin; // little
/** Z Max. */
- private double m_zmax; // little
+ private double zmax; // little
/** M Min. */
- private double m_mmin; // little
+ private double mmin; // little
/** M Max. */
- private double m_mmax; // little
+ private double mmax; // little
/**
* Create a shapefile descriptor.
* @param byteBuffer Source Bytebuffer.
*/
public ShapefileDescriptor(MappedByteBuffer byteBuffer) {
- m_fileCode = byteBuffer.getInt();
+ fileCode = byteBuffer.getInt();
byteBuffer.getInt();
byteBuffer.getInt();
byteBuffer.getInt();
byteBuffer.getInt();
byteBuffer.getInt();
- m_fileLength = byteBuffer.getInt() * 2;
+ fileLength = byteBuffer.getInt() * 2;
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
- m_version = byteBuffer.getInt();
- m_shapeType = ShapeTypeEnum.get(byteBuffer.getInt());
- m_xmin = byteBuffer.getDouble();
- m_ymin = byteBuffer.getDouble();
- m_xmax = byteBuffer.getDouble();
- m_ymax = byteBuffer.getDouble();
- m_zmin = byteBuffer.getDouble();
- m_zmax = byteBuffer.getDouble();
- m_mmin = byteBuffer.getDouble();
- m_mmax = byteBuffer.getDouble();
+ version = byteBuffer.getInt();
+ shapeType = ShapeTypeEnum.get(byteBuffer.getInt());
+ xmin = byteBuffer.getDouble();
+ ymin = byteBuffer.getDouble();
+ xmax = byteBuffer.getDouble();
+ ymax = byteBuffer.getDouble();
+ zmin = byteBuffer.getDouble();
+ zmax = byteBuffer.getDouble();
+ mmin = byteBuffer.getDouble();
+ mmax = byteBuffer.getDouble();
byteBuffer.order(ByteOrder.BIG_ENDIAN);
//dbf.byteBuffer.get(); // should be 0d for field terminator
@@ -102,18 +102,18 @@ public class ShapefileDescriptor {
StringBuilder s = new StringBuilder();
String lineSeparator = System.getProperty("line.separator", "\n");
- s.append("FileCode: ").append(m_fileCode).append(lineSeparator);
- s.append("FileLength: ").append(m_fileLength).append(lineSeparator);
- s.append("Version: ").append(m_version).append(lineSeparator);
- s.append("ShapeType: ").append(m_shapeType).append(lineSeparator);
- s.append("xmin: ").append(m_xmin).append(lineSeparator);
- s.append("ymin: ").append(m_ymin).append(lineSeparator);
- s.append("xmax: ").append(m_xmax).append(lineSeparator);
- s.append("ymax: ").append(m_ymax).append(lineSeparator);
- s.append("zmin: ").append(m_zmin).append(lineSeparator);
- s.append("zmax: ").append(m_zmax).append(lineSeparator);
- s.append("mmin: ").append(m_mmin).append(lineSeparator);
- s.append("mmax: ").append(m_mmax).append(lineSeparator);
+ s.append("FileCode: ").append(fileCode).append(lineSeparator);
+ s.append("FileLength: ").append(fileLength).append(lineSeparator);
+ s.append("Version: ").append(version).append(lineSeparator);
+ s.append("ShapeType: ").append(shapeType).append(lineSeparator);
+ s.append("xmin: ").append(xmin).append(lineSeparator);
+ s.append("ymin: ").append(ymin).append(lineSeparator);
+ s.append("xmax: ").append(xmax).append(lineSeparator);
+ s.append("ymax: ").append(ymax).append(lineSeparator);
+ s.append("zmin: ").append(zmin).append(lineSeparator);
+ s.append("zmax: ").append(zmax).append(lineSeparator);
+ s.append("mmin: ").append(mmin).append(lineSeparator);
+ s.append("mmax: ").append(mmax).append(lineSeparator);
s.append("------------------------").append(lineSeparator);
return s.toString();
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java
(original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java
Wed Jan 7 06:34:41 2015
@@ -35,58 +35,58 @@ import org.apache.sis.util.logging.Abstr
*/
public abstract class CommonByteReader<InvalidFormatException extends
Exception, FNFException extends Exception> extends AbstractAutoChecker
implements AutoCloseable {
/** The File. */
- private File m_file;
+ private File file;
/** Input Stream on the DBF. */
- private FileInputStream m_fis;
+ private FileInputStream fis;
/** File channel on the file. */
- private FileChannel m_fc;
+ private FileChannel fc;
/** Buffer reader. */
- private MappedByteBuffer m_byteBuffer;
+ private MappedByteBuffer byteBuffer;
/** Indicates if the byte buffer is closed. */
- private boolean m_isClosed = false;
+ private boolean isClosed = false;
/** Invalid Exception to throw in case of invalid file format. */
- private Class<InvalidFormatException> m_classInvalidFormatException;
+ private Class<InvalidFormatException> classInvalidFormatException;
/** Invalid Exception to throw in case of file not found exception. */
- private Class<FNFException> m_classFNFException;
+ private Class<FNFException> classFNFException;
/**
* Create and open a byte reader based on a file.
- * @param file File.
- * @param classInvalidFormatException Invalid Exception to throw in case
of invalid file format.
- * @param classFileNotFoundException Invalid Exception to throw in case of
file not found exception.
+ * @param f File.
+ * @param invalidFormatException Invalid Exception to throw in case of
invalid file format.
+ * @param fileNotFoundException Invalid Exception to throw in case of file
not found exception.
* @throws FNFException if the file cannot be opened.
* @throws InvalidFormatException if the file format is invalid.
*/
- public CommonByteReader(File file, Class<InvalidFormatException>
classInvalidFormatException, Class<FNFException> classFileNotFoundException)
throws FNFException, InvalidFormatException {
- Objects.requireNonNull(file, "The file cannot be null.");
- m_classInvalidFormatException = classInvalidFormatException;
- m_classFNFException = classFileNotFoundException;
+ public CommonByteReader(File f, Class<InvalidFormatException>
invalidFormatException, Class<FNFException> fileNotFoundException) throws
FNFException, InvalidFormatException {
+ Objects.requireNonNull(f, "The file cannot be null.");
+ classInvalidFormatException = invalidFormatException;
+ classFNFException = fileNotFoundException;
- m_file = file;
+ file = f;
try {
- m_fis = new FileInputStream(file);
+ fis = new FileInputStream(file);
}
catch(FileNotFoundException e) {
- throwException(m_classInvalidFormatException, e.getMessage(), e);
+ throwException(classInvalidFormatException, e.getMessage(), e);
throw new RuntimeException("this place should not be reached.");
}
- m_fc = m_fis.getChannel();
+ fc = fis.getChannel();
try {
- int fsize = (int)m_fc.size();
- m_byteBuffer = m_fc.map(FileChannel.MapMode.READ_ONLY, 0, fsize);
+ int fsize = (int)fc.size();
+ byteBuffer = fc.map(FileChannel.MapMode.READ_ONLY, 0, fsize);
}
catch(IOException e) {
- String message = format(Level.WARNING,
"excp.reader_cannot_be_created", m_file.getAbsolutePath(), e.getMessage());
- throwException(m_classFNFException, message, e);
+ String message = format(Level.WARNING,
"excp.reader_cannot_be_created", file.getAbsolutePath(), e.getMessage());
+ throwException(classFNFException, message, e);
throw new RuntimeException("this place should not be reached.");
}
}
@@ -97,13 +97,13 @@ public abstract class CommonByteReader<I
*/
@Override
public void close() throws IOException {
- if (m_fc != null)
- m_fc.close();
+ if (fc != null)
+ fc.close();
- if (m_fis != null)
- m_fis.close();
+ if (fis != null)
+ fis.close();
- m_isClosed = true;
+ isClosed = true;
}
/**
@@ -111,7 +111,7 @@ public abstract class CommonByteReader<I
* @return true if it is closed.
*/
public boolean isClosed() {
- return m_isClosed;
+ return isClosed;
}
/**
@@ -119,7 +119,7 @@ public abstract class CommonByteReader<I
* @return Byte Buffer.
*/
public MappedByteBuffer getByteBuffer() {
- return m_byteBuffer;
+ return byteBuffer;
}
/**
@@ -127,6 +127,6 @@ public abstract class CommonByteReader<I
* @return File.
*/
public File getFile() {
- return m_file;
+ return file;
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
(original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
Wed Jan 7 06:34:41 2015
@@ -37,7 +37,7 @@ import org.opengis.feature.Feature;
*/
public class MappedByteReader extends AbstractDbase3ByteReader implements
AutoCloseable {
/** List of field descriptors. */
- private List<DBase3FieldDescriptor> m_fieldsDescriptors = new
ArrayList<>();
+ private List<DBase3FieldDescriptor> fieldsDescriptors = new ArrayList<>();
/**
* Construct a mapped byte reader on a file.
@@ -59,7 +59,7 @@ public class MappedByteReader extends Ab
getByteBuffer().get(); // denotes whether deleted or current
// read first part of record
- for (DBase3FieldDescriptor fd : m_fieldsDescriptors) {
+ for (DBase3FieldDescriptor fd : fieldsDescriptors) {
byte[] data = new byte[fd.getLength()];
getByteBuffer().get(data);
@@ -96,7 +96,7 @@ public class MappedByteReader extends Ab
HashMap<String, Object> fieldsValues = new HashMap<>();
- for (DBase3FieldDescriptor fd : m_fieldsDescriptors) {
+ for (DBase3FieldDescriptor fd : fieldsDescriptors) {
byte[] data = new byte[fd.getLength()];
getByteBuffer().get(data);
@@ -143,7 +143,7 @@ public class MappedByteReader extends Ab
while(getByteBuffer().position() < this.dbaseHeaderBytes - 1) {
DBase3FieldDescriptor fd = new
DBase3FieldDescriptor(getByteBuffer());
- this.m_fieldsDescriptors.add(fd);
+ this.fieldsDescriptors.add(fd);
// loop until you hit the 0Dh field terminator
}
@@ -171,7 +171,7 @@ public class MappedByteReader extends Ab
*/
@Override
public List<DBase3FieldDescriptor> getFieldsDescriptors() {
- return m_fieldsDescriptors;
+ return fieldsDescriptors;
}
/**
@@ -191,7 +191,7 @@ public class MappedByteReader extends Ab
*/
@Override
public int getColumnCount() {
- return m_fieldsDescriptors.size();
+ return fieldsDescriptors.size();
}
/**
@@ -211,8 +211,8 @@ public class MappedByteReader extends Ab
}
// Search the field among the fields descriptors.
- for(int index=0; index < m_fieldsDescriptors.size(); index ++) {
- if (m_fieldsDescriptors.get(index).getName().equals(columnLabel)) {
+ for(int index=0; index < fieldsDescriptors.size(); index ++) {
+ if (fieldsDescriptors.get(index).getName().equals(columnLabel)) {
return index + 1;
}
}
@@ -235,6 +235,6 @@ public class MappedByteReader extends Ab
throw new SQLIllegalColumnIndexException(message, sql, getFile(),
columnIndex);
}
- return m_fieldsDescriptors.get(columnIndex-1);
+ return fieldsDescriptors.get(columnIndex-1);
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLConnectionClosedException.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLConnectionClosedException.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLConnectionClosedException.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLConnectionClosedException.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -28,21 +28,21 @@ public class SQLConnectionClosedExceptio
private static final long serialVersionUID = -7806101485624353416L;
/** The SQL Statement that whas attempted (if known). */
- private String m_sql;
+ private String sql;
/** The database file. */
- private File m_database;
+ private File database;
/**
* Build the exception.
* @param message Exception message.
- * @param sql SQL Statement who encountered the trouble, if known.
- * @param database The database that was queried.
+ * @param sqlStatement SQL Statement who encountered the trouble, if known.
+ * @param dbf The database that was queried.
*/
- public SQLConnectionClosedException(String message, String sql, File
database) {
+ public SQLConnectionClosedException(String message, String sqlStatement,
File dbf) {
super(message);
- m_sql = sql;
- m_database = database;
+ sql = sqlStatement;
+ database = dbf;
}
/**
@@ -50,7 +50,7 @@ public class SQLConnectionClosedExceptio
* @return SQL statement or null.
*/
public String getSQL() {
- return m_sql;
+ return sql;
}
/**
@@ -58,6 +58,6 @@ public class SQLConnectionClosedExceptio
* @return Database file.
*/
public File getDatabase() {
- return m_database;
+ return database;
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -42,18 +42,18 @@ public class DBFConnection extends Abstr
final File databaseFile;
/** Opened statement. */
- private HashSet<DBFStatement> m_openedStatements = new HashSet<>();
+ private HashSet<DBFStatement> openedStatements = new HashSet<>();
/** ByteReader. */
- private Dbase3ByteReader m_byteReader;
+ private Dbase3ByteReader byteReader;
/**
* Constructs a connection to the given database.
* @param datafile Data file ({@code .dbf} extension).
- * @param byteReader Byte reader to use for reading binary content.
+ * @param br Byte reader to use for reading binary content.
* @throws DbaseFileNotFoundException if the Database file cannot be found
or is not a file.
*/
- public DBFConnection(final File datafile, Dbase3ByteReader byteReader)
throws DbaseFileNotFoundException {
+ public DBFConnection(final File datafile, Dbase3ByteReader br) throws
DbaseFileNotFoundException {
// Check that file exists.
if (!datafile.exists()) {
throw new DbaseFileNotFoundException(format(Level.WARNING,
"excp.file_not_found", datafile.getAbsolutePath()));
@@ -65,7 +65,7 @@ public class DBFConnection extends Abstr
}
databaseFile = datafile;
- m_byteReader = byteReader;
+ byteReader = br;
format(Level.FINE, "log.database_connection_opened",
databaseFile.getAbsolutePath(), "FIXME : column desc.");
}
@@ -80,11 +80,11 @@ public class DBFConnection extends Abstr
try {
// Check if all the underlying connections that has been opened
with this connection has been closed.
// If not, we log a warning to help the developper.
- if (m_openedStatements.size() > 0) {
- format(Level.WARNING, "log.statements_left_opened",
m_openedStatements.size(),
m_openedStatements.stream().map(DBFStatement::toString).collect(Collectors.joining(",
")));
+ if (openedStatements.size() > 0) {
+ format(Level.WARNING, "log.statements_left_opened",
openedStatements.size(),
openedStatements.stream().map(DBFStatement::toString).collect(Collectors.joining(",
")));
}
- m_byteReader.close();
+ byteReader.close();
} catch (IOException e) {
format(Level.FINE, e.getMessage(), e);
}
@@ -99,7 +99,7 @@ public class DBFConnection extends Abstr
assertNotClosed();
DBFStatement stmt = new DBFStatement(this);
- m_openedStatements.add(stmt);
+ openedStatements.add(stmt);
return stmt;
}
@@ -116,7 +116,7 @@ public class DBFConnection extends Abstr
* @return Charset.
*/
public Charset getCharset() {
- return m_byteReader.getCharset();
+ return byteReader.getCharset();
}
/**
@@ -150,7 +150,7 @@ public class DBFConnection extends Abstr
*/
@Override
public boolean isClosed() {
- return m_byteReader.isClosed();
+ return byteReader.isClosed();
}
/**
@@ -188,7 +188,7 @@ public class DBFConnection extends Abstr
public void notifyCloseStatement(DBFStatement stmt) {
Objects.requireNonNull(stmt, "The statement notified being closed
cannot be null.");
- if (m_openedStatements.remove(stmt) == false) {
+ if (openedStatements.remove(stmt) == false) {
throw new RuntimeException(format(Level.SEVERE,
"assert.statement_not_opened_by_me", stmt, toString()));
}
}
@@ -202,7 +202,7 @@ public class DBFConnection extends Abstr
* @throws SQLNoSuchFieldException if there is no field with this name in
the query.
*/
public int findColumn(String columnLabel, String sql) throws
SQLNoSuchFieldException {
- return m_byteReader.findColumn(columnLabel, sql);
+ return byteReader.findColumn(columnLabel, sql);
}
/**
@@ -210,7 +210,7 @@ public class DBFConnection extends Abstr
* @return Column count.
*/
public int getColumnCount() {
- return m_byteReader.getColumnCount();
+ return byteReader.getColumnCount();
}
/**
@@ -288,7 +288,7 @@ public class DBFConnection extends Abstr
* @return Fields descriptors.
*/
public List<DBase3FieldDescriptor> getFieldsDescriptors() {
- return m_byteReader.getFieldsDescriptors();
+ return byteReader.getFieldsDescriptors();
}
/**
@@ -299,7 +299,7 @@ public class DBFConnection extends Abstr
* @throws SQLIllegalColumnIndexException if the index is out of bounds.
*/
public String getFieldName(int columnIndex, String sql) throws
SQLIllegalColumnIndexException {
- return m_byteReader.getFieldName(columnIndex, sql);
+ return byteReader.getFieldName(columnIndex, sql);
}
/**
@@ -307,7 +307,7 @@ public class DBFConnection extends Abstr
* @return true if a next row is available.
*/
public boolean nextRowAvailable() {
- return m_byteReader.nextRowAvailable();
+ return byteReader.nextRowAvailable();
}
/**
@@ -315,7 +315,7 @@ public class DBFConnection extends Abstr
* @return Map of field name / object value.
*/
public Map<String, Object> readNextRowAsObjects() {
- return m_byteReader.readNextRowAsObjects();
+ return byteReader.readNextRowAsObjects();
}
/**
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/SQLClosingIOFailureException.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/SQLClosingIOFailureException.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/SQLClosingIOFailureException.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/SQLClosingIOFailureException.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -28,21 +28,21 @@ public class SQLClosingIOFailureExceptio
private static final long serialVersionUID = -3327372119927661463L;
/** The SQL Statement that whas attempted (if known). */
- private String m_sql;
+ private String sql;
/** The database file. */
- private File m_database;
+ private File database;
/**
* Build the exception.
* @param message Exception message.
- * @param sql SQL Statement who encountered the trouble, if known.
- * @param database The database that was queried.
+ * @param sqlStatement SQL Statement who encountered the trouble, if known.
+ * @param dbf The database that was queried.
*/
- public SQLClosingIOFailureException(String message, String sql, File
database) {
+ public SQLClosingIOFailureException(String message, String sqlStatement,
File dbf) {
super(message);
- m_sql = sql;
- m_database = database;
+ sql = sqlStatement;
+ database = dbf;
}
/**
@@ -50,7 +50,7 @@ public class SQLClosingIOFailureExceptio
* @return SQL statement or null.
*/
public String getSQL() {
- return m_sql;
+ return sql;
}
/**
@@ -58,6 +58,6 @@ public class SQLClosingIOFailureExceptio
* @return Database file.
*/
public File getDatabase() {
- return m_database;
+ return database;
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -32,15 +32,15 @@ import org.apache.sis.internal.shapefile
*/
public class DBFDatabaseMetaData extends
AbstractUnimplementedFeaturesOfDatabaseMetaData {
/** Connection. */
- private DBFConnection m_connection;
+ private DBFConnection connection;
/**
* Construct a database Metadata.
- * @param connection Connection.
+ * @param cnt Connection.
*/
- public DBFDatabaseMetaData(DBFConnection connection) {
- Objects.requireNonNull(connection, "The database connection used to
create Database metadata cannot be null.");
- m_connection = connection;
+ public DBFDatabaseMetaData(DBFConnection cnt) {
+ Objects.requireNonNull(cnt, "The database connection used to create
Database metadata cannot be null.");
+ connection = cnt;
}
/**
@@ -73,8 +73,8 @@ public class DBFDatabaseMetaData extends
*/
@Override
public ResultSet getColumns(@SuppressWarnings("unused") String catalog,
@SuppressWarnings("unused") String schemaPattern, @SuppressWarnings("unused")
String tableNamePattern, @SuppressWarnings("unused") String columnNamePattern)
throws SQLConnectionClosedException {
- try(DBFStatement stmt = (DBFStatement)m_connection.createStatement()) {
- return new DBFBuiltInMemoryResultSetForColumnsListing(stmt,
m_connection.getFieldsDescriptors());
+ try(DBFStatement stmt = (DBFStatement)connection.createStatement()) {
+ return new DBFBuiltInMemoryResultSetForColumnsListing(stmt,
connection.getFieldsDescriptors());
}
}
@@ -84,7 +84,7 @@ public class DBFDatabaseMetaData extends
*/
@Override
public File getFile() {
- return m_connection.getFile();
+ return connection.getFile();
}
/**
@@ -1013,7 +1013,7 @@ public class DBFDatabaseMetaData extends
@Override public ResultSet getTables(String catalog, String schemaPattern,
String tableNamePattern, String[] types) {
logStep("getTables", catalog, schemaPattern, tableNamePattern, types
!= null ? Arrays.asList(types) : null);
- DBFStatement stmt = new DBFStatement(m_connection);
+ DBFStatement stmt = new DBFStatement(connection);
DBFBuiltInMemoryResultSetForTablesListing tables = new
DBFBuiltInMemoryResultSetForTablesListing(stmt);
stmt.registerResultSet(tables);
return tables;
@@ -1026,7 +1026,7 @@ public class DBFDatabaseMetaData extends
@Override public ResultSet getSchemas() {
logStep("getSchemas");
- DBFStatement stmt = new DBFStatement(m_connection);
+ DBFStatement stmt = new DBFStatement(connection);
DBFBuiltInMemoryResultSetForSchemaListing schemas = new
DBFBuiltInMemoryResultSetForSchemaListing(stmt);
stmt.registerResultSet(schemas);
return schemas;
@@ -1039,7 +1039,7 @@ public class DBFDatabaseMetaData extends
@Override public ResultSet getCatalogs() {
logStep("getCatalogs");
- DBFStatement stmt = new DBFStatement(m_connection);
+ DBFStatement stmt = new DBFStatement(connection);
DBFBuiltInMemoryResultSetForCatalogNamesListing catalogNames = new
DBFBuiltInMemoryResultSetForCatalogNamesListing(stmt);
stmt.registerResultSet(catalogNames);
return catalogNames;
@@ -1052,7 +1052,7 @@ public class DBFDatabaseMetaData extends
@Override public ResultSet getTableTypes() {
logStep("getTableTypes");
- DBFStatement stmt = new DBFStatement(m_connection);
+ DBFStatement stmt = new DBFStatement(connection);
DBFBuiltInMemoryResultSetForTablesTypesListing tablesTypes = new
DBFBuiltInMemoryResultSetForTablesTypesListing(stmt);
stmt.registerResultSet(tablesTypes);
return tablesTypes;
@@ -1168,7 +1168,7 @@ public class DBFDatabaseMetaData extends
*/
@Override public Connection getConnection() {
logStep("getConnection");
- return m_connection;
+ return connection;
}
/**
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -35,21 +35,21 @@ import org.apache.sis.internal.shapefile
*/
public class DBFResultSetMataData extends AbstractJDBC implements
ResultSetMetaData {
/** ResultSet. */
- private DBFRecordBasedResultSet m_rs;
+ private DBFRecordBasedResultSet rs;
/** Database metadata. */
- private DBFDatabaseMetaData m_metadata;
+ private DBFDatabaseMetaData metadata;
/**
* Construct a ResultSetMetaData.
- * @param rs ResultSet.
+ * @param resultset ResultSet.
*/
- public DBFResultSetMataData(DBFRecordBasedResultSet rs) {
- Objects.requireNonNull(rs, "A non null ResultSet is required.");
- m_rs = rs;
+ public DBFResultSetMataData(DBFRecordBasedResultSet resultset) {
+ Objects.requireNonNull(resultset, "A non null ResultSet is required.");
+ rs = resultset;
try {
- m_metadata =
(DBFDatabaseMetaData)rs.getStatement().getConnection().getMetaData();
+ metadata =
(DBFDatabaseMetaData)resultset.getStatement().getConnection().getMetaData();
}
catch(SQLException e) {
throw new RuntimeException(e.getMessage(), e);
@@ -79,7 +79,7 @@ public class DBFResultSetMataData extend
@SuppressWarnings("resource") // The current connection is only used and
has not to be closed.
@Override public int getColumnCount() throws SQLConnectionClosedException {
logStep("getColumnCount");
- DBFConnection cnt =
(DBFConnection)(((DBFStatement)m_rs.getStatement()).getConnection());
+ DBFConnection cnt =
(DBFConnection)(((DBFStatement)rs.getStatement()).getConnection());
return cnt.getColumnCount();
}
@@ -282,7 +282,7 @@ public class DBFResultSetMataData extend
logStep("getTableName", column);
// The table default to the file name (without its extension .dbf).
- String fileName = m_rs.getFile().getName();
+ String fileName = rs.getFile().getName();
int indexDBF = fileName.lastIndexOf(".");
String tableName = fileName.substring(0, indexDBF);
@@ -436,7 +436,7 @@ public class DBFResultSetMataData extend
*/
@Override
protected File getFile() {
- return m_rs.getFile();
+ return rs.getFile();
}
/**
@@ -447,12 +447,12 @@ public class DBFResultSetMataData extend
* @throws SQLConnectionClosedException if the underlying connection is
closed.
*/
private DBFBuiltInMemoryResultSetForColumnsListing desc(int column) throws
SQLIllegalColumnIndexException, SQLConnectionClosedException {
- DBFBuiltInMemoryResultSetForColumnsListing rsDatabase =
(DBFBuiltInMemoryResultSetForColumnsListing)m_metadata.getColumns(null, null,
null, null);
+ DBFBuiltInMemoryResultSetForColumnsListing rsDatabase =
(DBFBuiltInMemoryResultSetForColumnsListing)metadata.getColumns(null, null,
null, null);
if (column > getColumnCount()) {
rsDatabase.close();
String message = format(Level.WARNING,
"excp.illegal_column_index_metadata", column, getColumnCount());
- throw new SQLIllegalColumnIndexException(message, m_rs.getSQL(),
getFile(), column);
+ throw new SQLIllegalColumnIndexException(message, rs.getSQL(),
getFile(), column);
}
// TODO Implements ResultSet:absolute(int) instead.
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractBuiltInMemoryResultSet.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractBuiltInMemoryResultSet.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractBuiltInMemoryResultSet.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractBuiltInMemoryResultSet.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -31,7 +31,7 @@ import org.apache.sis.internal.shapefile
* @since 0.5
* @module
*/
-abstract public class AbstractBuiltInMemoryResultSet extends AbstractResultSet
{
+public abstract class AbstractBuiltInMemoryResultSet extends AbstractResultSet
{
/**
* Construct a ResultSet for descriptions.
* @param stmt Statement.
@@ -55,7 +55,7 @@ abstract public class AbstractBuiltInMem
*/
@Override
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
- return getBigDecimal(getFieldName(columnIndex, m_sql));
+ return getBigDecimal(getFieldName(columnIndex, sql));
}
/**
@@ -71,7 +71,7 @@ abstract public class AbstractBuiltInMem
*/
@Override
public Date getDate(int columnIndex) throws SQLException {
- return getDate(getFieldName(columnIndex, m_sql));
+ return getDate(getFieldName(columnIndex, sql));
}
/**
@@ -95,7 +95,7 @@ abstract public class AbstractBuiltInMem
*/
@Override
public double getDouble(int columnIndex) throws SQLException {
- return getDouble(getFieldName(columnIndex, m_sql));
+ return getDouble(getFieldName(columnIndex, sql));
}
/**
@@ -103,7 +103,7 @@ abstract public class AbstractBuiltInMem
*/
@Override
public float getFloat(int columnIndex) throws SQLException {
- return getFloat(getFieldName(columnIndex, m_sql));
+ return getFloat(getFieldName(columnIndex, sql));
}
/**
@@ -127,7 +127,7 @@ abstract public class AbstractBuiltInMem
*/
@Override
public int getInt(int columnIndex) throws SQLException {
- return getInt(getFieldName(columnIndex, m_sql));
+ return getInt(getFieldName(columnIndex, sql));
}
/**
@@ -141,7 +141,7 @@ abstract public class AbstractBuiltInMem
* @see java.sql.ResultSet#getLong(int)
*/
@Override public long getLong(int columnIndex) throws SQLException {
- return getLong(getFieldName(columnIndex, m_sql));
+ return getLong(getFieldName(columnIndex, sql));
}
/**
@@ -156,7 +156,7 @@ abstract public class AbstractBuiltInMem
*/
@Override
public short getShort(int columnIndex) throws SQLException {
- return getShort(getFieldName(columnIndex, m_sql));
+ return getShort(getFieldName(columnIndex, sql));
}
/**
@@ -171,7 +171,7 @@ abstract public class AbstractBuiltInMem
*/
@Override
public String getString(int columnIndex) throws SQLException {
- return(getString(getFieldName(columnIndex, m_sql)));
+ return(getString(getFieldName(columnIndex, sql)));
}
/**
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -35,18 +35,18 @@ import org.apache.sis.internal.shapefile
* Common implemented features of all ResultSets : those based on a record,
but also those returning results forged in memory.
* @author Marc LE BIHAN
*/
-abstract public class AbstractResultSet extends
AbstractUnimplementedFeaturesOfResultSet {
+public abstract class AbstractResultSet extends
AbstractUnimplementedFeaturesOfResultSet {
/** Indicates if the ResultSet is closed. */
- protected boolean m_isClosed;
+ protected boolean isClosed;
/** SQL Statement. */
- protected String m_sql;
+ protected String sql;
/** true, if the last column had the SQL NULL value (for the
ResultSet.wasNull() method). */
- protected boolean m_wasNull;
+ protected boolean wasNull;
/** Parent statement. */
- protected DBFStatement m_statement;
+ protected DBFStatement statement;
/**
* Constructs a result set.
@@ -56,8 +56,8 @@ abstract public class AbstractResultSet
public AbstractResultSet(final DBFStatement stmt, String sqlQuery) {
Objects.requireNonNull(stmt, "the statement referred by the ResultSet
cannot be null.");
- m_statement = stmt;
- m_sql = sqlQuery;
+ statement = stmt;
+ sql = sqlQuery;
}
/**
@@ -73,10 +73,10 @@ abstract public class AbstractResultSet
* @throws SQLConnectionClosedException if one of them is closed.
*/
protected void assertNotClosed() throws SQLConnectionClosedException {
- m_statement.assertNotClosed();
+ statement.assertNotClosed();
- if (m_isClosed) {
- throw new SQLConnectionClosedException(format(Level.WARNING,
"excp.closed_resultset", m_sql, getFile().getName()), m_sql, getFile());
+ if (isClosed) {
+ throw new SQLConnectionClosedException(format(Level.WARNING,
"excp.closed_resultset", sql, getFile().getName()), sql, getFile());
}
}
@@ -96,8 +96,8 @@ abstract public class AbstractResultSet
if (isClosed())
return;
- m_statement.notifyCloseResultSet(this);
- m_isClosed = true;
+ statement.notifyCloseResultSet(this);
+ isClosed = true;
}
/**
@@ -111,7 +111,7 @@ abstract public class AbstractResultSet
@Override
@SuppressWarnings("resource") // The connection is only used to get the
column index.
public int findColumn(String columnLabel) throws SQLNoSuchFieldException,
SQLConnectionClosedException {
- DBFConnection cnt = (DBFConnection)m_statement.getConnection();
+ DBFConnection cnt = (DBFConnection)statement.getConnection();
return cnt.findColumn(columnLabel, getSQL());
}
@@ -224,15 +224,15 @@ abstract public class AbstractResultSet
/**
* Return a field name.
* @param columnIndex Column index.
- * @param sql For information, the SQL statement that is attempted.
+ * @param sqlStatement For information, the SQL statement that is
attempted.
* @return Field Name.
* @throws SQLIllegalColumnIndexException if the index is out of bounds.
* @throws SQLConnectionClosedException if the connection is closed.
*/
@SuppressWarnings("resource") // Only use the current connection to get
the field name.
- public String getFieldName(int columnIndex, String sql) throws
SQLIllegalColumnIndexException, SQLConnectionClosedException {
- DBFConnection cnt = (DBFConnection)m_statement.getConnection();
- return cnt.getFieldName(columnIndex, sql);
+ public String getFieldName(int columnIndex, String sqlStatement) throws
SQLIllegalColumnIndexException, SQLConnectionClosedException {
+ DBFConnection cnt = (DBFConnection)statement.getConnection();
+ return cnt.getFieldName(columnIndex, sqlStatement);
}
/**
@@ -241,7 +241,7 @@ abstract public class AbstractResultSet
*/
@Override
public File getFile() {
- return m_statement.getFile();
+ return statement.getFile();
}
/**
@@ -391,7 +391,7 @@ abstract public class AbstractResultSet
* @return SQL query.
*/
public String getSQL() {
- return m_sql;
+ return sql;
}
/**
@@ -410,7 +410,7 @@ abstract public class AbstractResultSet
@Override
public Statement getStatement() throws SQLConnectionClosedException {
assertNotClosed();
- return m_statement;
+ return statement;
}
/**
@@ -445,7 +445,7 @@ abstract public class AbstractResultSet
*/
@Override
public boolean isClosed() {
- return m_isClosed || m_statement.isClosed();
+ return isClosed || statement.isClosed();
}
/**
@@ -928,31 +928,31 @@ abstract public class AbstractResultSet
*/
@Override
public boolean wasNull() {
- return m_wasNull;
+ return wasNull;
}
/**
* Get a field description.
* @param columnLabel Column label.
- * @param sql SQL Statement.
+ * @param sqlStatement SQL Statement.
* @return ResultSet with current row set on the wished field.
* @throws SQLConnectionClosedException if the connection is closed.
* @throws SQLNoSuchFieldException if no column with that name exists.
*/
- public ResultSet getFieldDesc(String columnLabel, String sql) throws
SQLConnectionClosedException, SQLNoSuchFieldException {
- return
((DBFConnection)((DBFStatement)getStatement()).getConnection()).getFieldDesc(columnLabel,
sql);
+ public ResultSet getFieldDesc(String columnLabel, String sqlStatement)
throws SQLConnectionClosedException, SQLNoSuchFieldException {
+ return
((DBFConnection)((DBFStatement)getStatement()).getConnection()).getFieldDesc(columnLabel,
sqlStatement);
}
/**
* Get a field description.
* @param column Column index.
- * @param sql SQL Statement.
+ * @param sqlStatement SQL Statement.
* @return ResultSet with current row set on the wished field.
* @throws SQLConnectionClosedException if the connection is closed.
* @throws SQLIllegalColumnIndexException if the column index is out of
bounds.
*/
- public ResultSet getFieldDesc(int column, String sql) throws
SQLConnectionClosedException, SQLIllegalColumnIndexException {
- return
((DBFConnection)((DBFStatement)getStatement()).getConnection()).getFieldDesc(column,
sql);
+ public ResultSet getFieldDesc(int column, String sqlStatement) throws
SQLConnectionClosedException, SQLIllegalColumnIndexException {
+ return
((DBFConnection)((DBFStatement)getStatement()).getConnection()).getFieldDesc(column,
sqlStatement);
}
/**
@@ -960,6 +960,6 @@ abstract public class AbstractResultSet
*/
@Override
public String toString() {
- return format("toString", m_statement != null ? m_statement.toString()
: null, m_sql, isClosed() == false);
+ return format("toString", statement != null ? statement.toString() :
null, sql, isClosed() == false);
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -61,7 +61,7 @@ import org.apache.sis.internal.shapefile
* @since 0.5
* @module
*/
-abstract public class AbstractUnimplementedFeaturesOfResultSet extends
AbstractJDBC implements ResultSet {
+public abstract class AbstractUnimplementedFeaturesOfResultSet extends
AbstractJDBC implements ResultSet {
/*
* Note to developpers : this class only offers methods that return
unsupported exceptions : methods that are not implemented anywhere.
* if any implementation is done, even a redirection to another class or
method, please move the implementation on the next subclass.
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForColumnsListing.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForColumnsListing.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForColumnsListing.java
(original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForColumnsListing.java
Wed Jan 7 06:34:41 2015
@@ -32,16 +32,16 @@ import org.apache.sis.internal.shapefile
*/
public class DBFBuiltInMemoryResultSetForColumnsListing extends
AbstractBuiltInMemoryResultSet {
/** Current field descriptor. */
- private DBase3FieldDescriptor m_current;
+ private DBase3FieldDescriptor current;
/** Iterator. */
- private Iterator<DBase3FieldDescriptor> m_it;
+ private Iterator<DBase3FieldDescriptor> itDescriptor;
/** Column index. */
- private int m_columnIndex;
+ private int columnIndex;
/** Indicates if the ResultSet is set after the last record. */
- private boolean m_afterLast = false;
+ private boolean afterLast = false;
/**
* Construct a ResultSet.
@@ -50,7 +50,7 @@ public class DBFBuiltInMemoryResultSetFo
*/
public DBFBuiltInMemoryResultSetForColumnsListing(DBFStatement stmt,
List<DBase3FieldDescriptor> fieldsDescriptors) {
super(stmt, "driver list columns in this DBase 3 file");
- m_it = fieldsDescriptors.iterator();
+ itDescriptor = fieldsDescriptors.iterator();
}
/**
@@ -64,21 +64,21 @@ public class DBFBuiltInMemoryResultSetFo
// String => table name
case "TABLE_NAME": {
String tableName = getTableName();
- m_wasNull = (tableName == null);
+ wasNull = (tableName == null);
return tableName;
}
// String => column name
case "COLUMN_NAME": {
- String columnName = m_current.getName();
- m_wasNull = (columnName == null);
+ String columnName = current.getName();
+ wasNull = (columnName == null);
return columnName;
}
// String => Data source dependent type name, for a UDT the type
name is fully qualified
case "TYPE_NAME": {
- String typeName = m_current.getType() != null ?
toColumnTypeName() : null;
- m_wasNull = (typeName == null);
+ String typeName = current.getType() != null ?
toColumnTypeName() : null;
+ wasNull = (typeName == null);
return typeName;
}
@@ -89,42 +89,42 @@ public class DBFBuiltInMemoryResultSetFo
// String => table catalog (may be null)
case "TABLE_CAT": {
- m_wasNull = true;
+ wasNull = true;
return null;
}
// String => table schema (may be null)
case "TABLE_SCHEM": {
- m_wasNull = true;
+ wasNull = true;
return null;
}
// String => comment describing column (may be null)
case "REMARKS":
- m_wasNull = true;
+ wasNull = true;
return null;
// String => default value for the column, which should be
interpreted as a string when the value is enclosed in single quotes (may be
null)
case "COLUMN_DEF": {
- m_wasNull = true;
+ wasNull = true;
return null;
}
// String => catalog of table that is the scope of a reference
attribute (null if DATA_TYPE isn't REF)
case "SCOPE_CATALOG": {
- m_wasNull = true;
+ wasNull = true;
return null;
}
// String => schema of table that is the scope of a reference
attribute (null if the DATA_TYPE isn't REF)
case "SCOPE_SCHEMA": {
- m_wasNull = true;
+ wasNull = true;
return null;
}
// String => table name that this the scope of a reference
attribute (null if the DATA_TYPE isn't REF)
case "SCOPE_TABLE": {
- m_wasNull = true;
+ wasNull = true;
return null;
}
@@ -135,7 +135,7 @@ public class DBFBuiltInMemoryResultSetFo
* empty string --- if it cannot be determined whether the column
is auto incremented
*/
case "IS_AUTOINCREMENT": {
- m_wasNull = false;
+ wasNull = false;
return "NO";
}
@@ -146,7 +146,7 @@ public class DBFBuiltInMemoryResultSetFo
* empty string --- if it cannot be determined whether this is a
generated column
*/
case "IS_GENERATEDCOLUMN": {
- m_wasNull = false;
+ wasNull = false;
return "NO";
}
@@ -168,20 +168,20 @@ public class DBFBuiltInMemoryResultSetFo
switch(columnLabel) {
// int => SQL type from java.sql.Types
case "DATA_TYPE": {
- m_wasNull = false;
+ wasNull = false;
return toSQLDataType();
}
// int => column size.
case "COLUMN_SIZE": {
- m_wasNull = false;
+ wasNull = false;
return toPrecision();
}
// int => the number of fractional digits. Null is returned for
data types where DECIMAL_DIGITS is not applicable.
case "DECIMAL_DIGITS": {
int scale = toScale();
- m_wasNull = toScale() == -1;
+ wasNull = toScale() == -1;
return scale == -1 ? 0 : scale;
}
@@ -197,13 +197,13 @@ public class DBFBuiltInMemoryResultSetFo
* columnNullableUnknown - nullability unknown
*/
case "NULLABLE": {
- m_wasNull = false;
+ wasNull = false;
return DatabaseMetaData.columnNullableUnknown;
}
// int => unused
case "SQL_DATA_TYPE": {
- m_wasNull = false;
+ wasNull = false;
return toSQLDataType();
}
@@ -218,7 +218,7 @@ public class DBFBuiltInMemoryResultSetFo
// int => index of column in table (starting at 1)
case "ORDINAL_POSITION": {
- return m_columnIndex;
+ return columnIndex;
}
/**
@@ -228,19 +228,19 @@ public class DBFBuiltInMemoryResultSetFo
// short => source type of a distinct type or user-generated Ref
type, SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or
user-generated REF)
case "SOURCE_DATA_TYPE": {
- m_wasNull = true;
+ wasNull = true;
return 0;
}
// is not used.
case "BUFFER_LENGTH": {
- m_wasNull = false;
+ wasNull = false;
return 0;
}
// int => unused
case "SQL_DATETIME_SUB": {
- m_wasNull = false;
+ wasNull = false;
return 0;
}
@@ -257,15 +257,15 @@ public class DBFBuiltInMemoryResultSetFo
* @see java.sql.ResultSet#next()
*/
@Override public boolean next() throws SQLNoResultException {
- if (m_it.hasNext()) {
- m_current = m_it.next();
- m_columnIndex ++;
+ if (itDescriptor.hasNext()) {
+ current = itDescriptor.next();
+ columnIndex ++;
return true;
}
else {
- if (m_afterLast) {
+ if (afterLast) {
// The ResultSet has no more records and has been call one
time too much.
- m_afterLast = true;
+ afterLast = true;
String message = format(Level.WARNING, "excp.no_more_desc",
getTableName());
throw new SQLNoResultException(message, "asking columns desc",
getFile());
@@ -281,7 +281,7 @@ public class DBFBuiltInMemoryResultSetFo
* @return SQL Datatype.
*/
private int toSQLDataType() {
- switch(m_current.getType()) {
+ switch(current.getType()) {
case AutoIncrement:
return Types.INTEGER;
@@ -337,7 +337,7 @@ public class DBFBuiltInMemoryResultSetFo
* @return Column type name.
*/
private String toColumnTypeName() {
- switch(m_current.getType()) {
+ switch(current.getType()) {
case AutoIncrement:
return "AUTO_INCREMENT";
@@ -393,11 +393,11 @@ public class DBFBuiltInMemoryResultSetFo
* @return Precision of the current field.
*/
public int toPrecision() {
- switch(m_current.getType()) {
+ switch(current.getType()) {
case AutoIncrement:
case Character:
case Integer:
- return m_current.getLength();
+ return current.getLength();
case Date:
return 8;
@@ -405,7 +405,7 @@ public class DBFBuiltInMemoryResultSetFo
case Double:
case FloatingPoint:
case Number:
- return m_current.getLength();
+ return current.getLength();
case Logical:
return 0;
@@ -413,7 +413,7 @@ public class DBFBuiltInMemoryResultSetFo
case Currency:
case DateTime:
case TimeStamp:
- return m_current.getLength();
+ return current.getLength();
case Memo:
case Picture:
@@ -422,7 +422,7 @@ public class DBFBuiltInMemoryResultSetFo
return 0;
default:
- return m_current.getLength();
+ return current.getLength();
}
}
@@ -431,7 +431,7 @@ public class DBFBuiltInMemoryResultSetFo
* @return Scale of the current field, -1 means : this field is not
numeric.
*/
private int toScale() {
- switch(m_current.getType()) {
+ switch(current.getType()) {
case AutoIncrement:
case Logical:
return 0;
@@ -441,7 +441,7 @@ public class DBFBuiltInMemoryResultSetFo
case FloatingPoint:
case Number:
case Currency:
- return m_current.getDecimalCount();
+ return current.getDecimalCount();
case Character:
case Date:
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -26,7 +26,7 @@ import org.apache.sis.internal.shapefile
*/
public class DBFBuiltInMemoryResultSetForTablesListing extends
AbstractBuiltInMemoryResultSet {
/** There's only one result in this ResultSet. */
- private int m_index = 0;
+ private int index = 0;
/**
* Construct a ResultSet.
@@ -46,12 +46,12 @@ public class DBFBuiltInMemoryResultSetFo
case "TABLE_NAME": // String => table name.
{
String tableName = getTableName();
- m_wasNull = (tableName == null);
+ wasNull = (tableName == null);
return tableName;
}
case "TABLE_TYPE": // String => table type. Typical
types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL
TEMPORARY", "ALIAS", "SYNONYM".
- m_wasNull = false;
+ wasNull = false;
return "TABLE";
case "TYPE_NAME": // String => type name (may be
null)
@@ -62,11 +62,11 @@ public class DBFBuiltInMemoryResultSetFo
case "TYPE_SCHEM": // String => the types schema
(may be null)
case "SELF_REFERENCING_COL_NAME": // String => name of the
designated "identifier" column of a typed table (may be null)
case "REF_GENERATION": // String => specifies how
values in SELF_REFERENCING_COL_NAME are created. Values are "SYSTEM", "USER",
"DERIVED". (may be null)
- m_wasNull = true;
+ wasNull = true;
return null;
default:
- m_wasNull = true;
+ wasNull = true;
return null;
}
}
@@ -78,11 +78,11 @@ public class DBFBuiltInMemoryResultSetFo
{
logStep("next");
- if (m_index > 1) {
+ if (index > 1) {
throw new SQLNoResultException(format(Level.WARNING,
"excp.only_one_table_per_dbf"), "Driver manager asks for table listing",
getFile());
}
- m_index ++;
- return (m_index == 1) ? true : false;
+ index ++;
+ return (index == 1) ? true : false;
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesTypesListing.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesTypesListing.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesTypesListing.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesTypesListing.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -26,7 +26,7 @@ import org.apache.sis.internal.shapefile
*/
public class DBFBuiltInMemoryResultSetForTablesTypesListing extends
AbstractBuiltInMemoryResultSet {
/** There's only one result in this ResultSet. */
- private int m_index = 0;
+ private int index = 0;
/**
* Construct a ResultSet listing the tables types of a database.
@@ -44,15 +44,15 @@ public class DBFBuiltInMemoryResultSetFo
switch(columnLabel) {
case "OBJECTID": // FIXME Documentation of
ObjectId for geTabletTypes() has not been found. What are the rules about this
field ?
- m_wasNull = false;
+ wasNull = false;
return "1";
case "TABLE_TYPE": // String => table type. Typical
types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL
TEMPORARY", "ALIAS", "SYNONYM".
- m_wasNull = false;
+ wasNull = false;
return "TABLE"; // and DBase 3 only knows
tables.
default:
- m_wasNull = true;
+ wasNull = true;
return null;
}
}
@@ -64,11 +64,11 @@ public class DBFBuiltInMemoryResultSetFo
{
logStep("next");
- if (m_index > 1) {
+ if (index > 1) {
throw new SQLNoResultException(format(Level.WARNING,
"excp.only_one_table_type_handled"), "Driver manager asks for table types
listing", getFile());
}
- m_index ++;
- return (m_index == 1) ? true : false;
+ index ++;
+ return (index == 1) ? true : false;
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -25,10 +25,10 @@ import org.apache.sis.internal.shapefile
*/
public class DBFRecordBasedResultSet extends AbstractResultSet {
/** The current record. */
- private Map<String, Object> m_record;
+ private Map<String, Object> record;
/** Condition of where clause (currently, only one is handled). */
- private ConditionalClauseResolver m_singleConditionOfWhereClause;
+ private ConditionalClauseResolver singleConditionOfWhereClause;
/** UTF-8 charset. */
private static Charset UTF8 = Charset.forName("UTF-8");
@@ -41,7 +41,7 @@ public class DBFRecordBasedResultSet ext
*/
public DBFRecordBasedResultSet(final DBFStatement stmt, String sqlQuery)
throws SQLInvalidStatementException {
super(stmt, sqlQuery);
- m_singleConditionOfWhereClause = new CrudeSQLParser(this).parse();
+ singleConditionOfWhereClause = new CrudeSQLParser(this).parse();
}
/**
@@ -57,17 +57,17 @@ public class DBFRecordBasedResultSet ext
assertNotClosed();
// Act as if we were a double, but store the result in a pre-created
BigDecimal at the end.
- try(DBFBuiltInMemoryResultSetForColumnsListing field =
(DBFBuiltInMemoryResultSetForColumnsListing)getFieldDesc(columnLabel, m_sql)) {
+ try(DBFBuiltInMemoryResultSetForColumnsListing field =
(DBFBuiltInMemoryResultSetForColumnsListing)getFieldDesc(columnLabel, sql)) {
MathContext mc = new MathContext(field.getInt("DECIMAL_DIGITS"),
RoundingMode.HALF_EVEN);
Double doubleValue = getDouble(columnLabel);
if (doubleValue != null) {
BigDecimal number = new BigDecimal(doubleValue, mc);
- m_wasNull = false;
+ wasNull = false;
return number;
}
else {
- m_wasNull = true;
+ wasNull = true;
return null;
}
}
@@ -83,7 +83,7 @@ public class DBFRecordBasedResultSet ext
@Override
public BigDecimal getBigDecimal(int columnIndex) throws
SQLConnectionClosedException, SQLNoSuchFieldException, SQLNotNumericException,
SQLIllegalColumnIndexException {
logStep("getBigDecimal", columnIndex);
- return getBigDecimal(getFieldName(columnIndex, m_sql));
+ return getBigDecimal(getFieldName(columnIndex, sql));
}
/**
@@ -104,11 +104,11 @@ public class DBFRecordBasedResultSet ext
if (doubleValue != null) {
BigDecimal number = new BigDecimal(getDouble(columnLabel), mc);
- m_wasNull = false;
+ wasNull = false;
return number;
}
else {
- m_wasNull = true;
+ wasNull = true;
return null;
}
}
@@ -127,18 +127,18 @@ public class DBFRecordBasedResultSet ext
String value = getString(columnLabel);
if (value == null || value.equals("00000000")) { // "00000000" is
stored in Database to represent a null value too.
- m_wasNull = true;
+ wasNull = true;
return null; // The ResultSet:getDate() contract is to return null
when a null date is encountered.
}
else {
- m_wasNull = false;
+ wasNull = false;
}
// The DBase 3 date format is "YYYYMMDD".
// if the length of the string isn't eight characters, the field
format is incorrect.
if (value.length() != 8) {
- String message = format(Level.WARNING, "excp.field_is_not_a_date",
columnLabel, m_sql, value);
- throw new SQLNotDateException(message, m_sql, getFile(),
columnLabel, value);
+ String message = format(Level.WARNING, "excp.field_is_not_a_date",
columnLabel, sql, value);
+ throw new SQLNotDateException(message, sql, getFile(),
columnLabel, value);
}
// Extract the date parts.
@@ -150,8 +150,8 @@ public class DBFRecordBasedResultSet ext
dayOfMonth = Integer.parseInt(value.substring(7));
}
catch(NumberFormatException e) {
- String message = format(Level.WARNING, "excp.field_is_not_a_date",
columnLabel, m_sql, value);
- throw new SQLNotDateException(message, m_sql, getFile(),
columnLabel, value);
+ String message = format(Level.WARNING, "excp.field_is_not_a_date",
columnLabel, sql, value);
+ throw new SQLNotDateException(message, sql, getFile(),
columnLabel, value);
}
// Create a date.
@@ -170,7 +170,7 @@ public class DBFRecordBasedResultSet ext
@Override
public Date getDate(int columnIndex) throws SQLConnectionClosedException,
SQLNoSuchFieldException, SQLNotDateException, SQLIllegalColumnIndexException {
logStep("getDate", columnIndex);
- return getDate(getFieldName(columnIndex, m_sql));
+ return getDate(getFieldName(columnIndex, sql));
}
/**
@@ -184,7 +184,7 @@ public class DBFRecordBasedResultSet ext
logStep("getDouble", columnLabel);
Double value = getNumeric(columnLabel, Double::parseDouble);
- m_wasNull = (value == null);
+ wasNull = (value == null);
return value != null ? value : 0.0; // The ResultSet contract for
numbers is to return 0 when a null value is encountered.
}
@@ -198,7 +198,7 @@ public class DBFRecordBasedResultSet ext
@Override
public double getDouble(int columnIndex) throws
SQLConnectionClosedException, SQLNoSuchFieldException, SQLNotNumericException,
SQLIllegalColumnIndexException {
logStep("getDouble", columnIndex);
- return getDouble(getFieldName(columnIndex, m_sql));
+ return getDouble(getFieldName(columnIndex, sql));
}
/**
@@ -212,7 +212,7 @@ public class DBFRecordBasedResultSet ext
logStep("getFloat", columnLabel);
Float value = getNumeric(columnLabel, Float::parseFloat);
- m_wasNull = (value == null);
+ wasNull = (value == null);
return value != null ? value : 0; // The ResultSet contract for
numbers is to return 0 when a null value is encountered.
}
@@ -226,7 +226,7 @@ public class DBFRecordBasedResultSet ext
@Override
public float getFloat(int columnIndex) throws
SQLConnectionClosedException, SQLNoSuchFieldException, SQLNotNumericException,
SQLIllegalColumnIndexException {
logStep("getFloat", columnIndex);
- return getFloat(getFieldName(columnIndex, m_sql));
+ return getFloat(getFieldName(columnIndex, sql));
}
/**
@@ -240,7 +240,7 @@ public class DBFRecordBasedResultSet ext
logStep("getInt", columnLabel);
Integer value = getNumeric(columnLabel, Integer::parseInt);
- m_wasNull = (value == null);
+ wasNull = (value == null);
return value != null ? value : 0; // The ResultSet contract for
numbers is to return 0 when a null value is encountered.
}
@@ -254,7 +254,7 @@ public class DBFRecordBasedResultSet ext
@Override
public int getInt(int columnIndex) throws SQLConnectionClosedException,
SQLNoSuchFieldException, SQLNotNumericException, SQLIllegalColumnIndexException
{
logStep("getInt", columnIndex);
- return getInt(getFieldName(columnIndex, m_sql));
+ return getInt(getFieldName(columnIndex, sql));
}
/**
@@ -268,7 +268,7 @@ public class DBFRecordBasedResultSet ext
logStep("getLong", columnLabel);
Long value = getNumeric(columnLabel, Long::parseLong);
- m_wasNull = (value == null);
+ wasNull = (value == null);
return value != null ? value : 0; // The ResultSet contract for
numbers is to return 0 when a null value is encountered.
}
@@ -281,7 +281,7 @@ public class DBFRecordBasedResultSet ext
*/
@Override public long getLong(int columnIndex) throws
SQLConnectionClosedException, SQLNoSuchFieldException, SQLNotNumericException,
SQLIllegalColumnIndexException {
logStep("getLong", columnIndex);
- return getLong(getFieldName(columnIndex, m_sql));
+ return getLong(getFieldName(columnIndex, sql));
}
/**
@@ -300,7 +300,7 @@ public class DBFRecordBasedResultSet ext
*/
@Override
public Object getObject(int column) throws SQLConnectionClosedException,
SQLIllegalColumnIndexException, SQLFeatureNotSupportedException,
SQLNoSuchFieldException, SQLNotNumericException, SQLNotDateException {
- try(DBFBuiltInMemoryResultSetForColumnsListing field =
(DBFBuiltInMemoryResultSetForColumnsListing)getFieldDesc(column, m_sql)) {
+ try(DBFBuiltInMemoryResultSetForColumnsListing field =
(DBFBuiltInMemoryResultSetForColumnsListing)getFieldDesc(column, sql)) {
String fieldType;
try {
@@ -390,7 +390,7 @@ public class DBFRecordBasedResultSet ext
logStep("getShort", columnLabel);
Short value = getNumeric(columnLabel, Short::parseShort);
- m_wasNull = (value == null);
+ wasNull = (value == null);
return value != null ? value : 0; // The ResultSet contract for
numbers is to return 0 when a null value is encountered.
}
@@ -404,7 +404,7 @@ public class DBFRecordBasedResultSet ext
@Override
public short getShort(int columnIndex) throws
SQLConnectionClosedException, SQLNoSuchFieldException, SQLNotNumericException,
SQLIllegalColumnIndexException {
logStep("getShort", columnIndex);
- return getShort(getFieldName(columnIndex, m_sql));
+ return getShort(getFieldName(columnIndex, sql));
}
/**
@@ -419,15 +419,15 @@ public class DBFRecordBasedResultSet ext
logStep("getString", columnLabel);
assertNotClosed();
- getFieldDesc(columnLabel, m_sql); // Ensure that the field queried
exists, else a null value here can be interpreted as "not existing" or "has a
null value".
- String withoutCharset = (String)m_record.get(columnLabel);
+ getFieldDesc(columnLabel, sql); // Ensure that the field queried
exists, else a null value here can be interpreted as "not existing" or "has a
null value".
+ String withoutCharset = (String)record.get(columnLabel);
if (withoutCharset == null) {
- m_wasNull = true;
+ wasNull = true;
return withoutCharset;
}
else {
- m_wasNull = false;
+ wasNull = false;
}
// If a non null value has been readed, convert it to the wished
Charset.
@@ -461,7 +461,7 @@ public class DBFRecordBasedResultSet ext
@Override
public String getString(int columnIndex) throws
SQLConnectionClosedException, SQLNoSuchFieldException,
SQLIllegalColumnIndexException {
logStep("getString", columnIndex);
- return(getString(getFieldName(columnIndex, m_sql)));
+ return(getString(getFieldName(columnIndex, sql)));
}
/**
@@ -484,10 +484,9 @@ public class DBFRecordBasedResultSet ext
// Check that we aren't at the end of the Database file.
if (cnt.nextRowAvailable() == false) {
- throw new SQLNoResultException(format(Level.WARNING,
"excp.no_more_results", m_sql, getFile().getName()), m_sql, getFile());
+ throw new SQLNoResultException(format(Level.WARNING,
"excp.no_more_results", sql, getFile().getName()), sql, getFile());
}
- //m_record = getDatabase().readNextRowAsObjects();
return nextRecordMatchingConditions();
}
@@ -508,8 +507,8 @@ public class DBFRecordBasedResultSet ext
DBFConnection cnt =
(DBFConnection)((DBFStatement)getStatement()).getConnection();
while(cnt.nextRowAvailable() && recordMatchesConditions == false) {
- m_record = cnt.readNextRowAsObjects();
- recordMatchesConditions = m_singleConditionOfWhereClause == null
|| m_singleConditionOfWhereClause.isVerified(this);
+ record = cnt.readNextRowAsObjects();
+ recordMatchesConditions = singleConditionOfWhereClause == null ||
singleConditionOfWhereClause.isVerified(this);
}
return recordMatchesConditions && cnt.nextRowAvailable(); // Beware of
the end of database !
@@ -530,7 +529,7 @@ public class DBFRecordBasedResultSet ext
@Override
public boolean wasNull() {
logStep("wasNull");
- return m_wasNull;
+ return wasNull;
}
/**
@@ -546,8 +545,8 @@ public class DBFRecordBasedResultSet ext
private <T extends Number> T getNumeric(String columnLabel,
Function<String, T> parse) throws SQLConnectionClosedException,
SQLNoSuchFieldException, SQLNotNumericException {
assertNotClosed();
- try(DBFBuiltInMemoryResultSetForColumnsListing rs =
(DBFBuiltInMemoryResultSetForColumnsListing)getFieldDesc(columnLabel, m_sql)) {
- String textValue = (String)m_record.get(columnLabel);
+ try(DBFBuiltInMemoryResultSetForColumnsListing rs =
(DBFBuiltInMemoryResultSetForColumnsListing)getFieldDesc(columnLabel, sql)) {
+ String textValue = (String)record.get(columnLabel);
if (textValue == null) {
return null;
@@ -559,8 +558,8 @@ public class DBFRecordBasedResultSet ext
return(value);
}
catch(NumberFormatException e) {
- String message = format(Level.WARNING,
"excp.field_is_not_numeric", columnLabel, rs.getString("TYPE_NAME"), m_sql,
textValue);
- throw new SQLNotNumericException(message, m_sql, getFile(),
columnLabel, textValue);
+ String message = format(Level.WARNING,
"excp.field_is_not_numeric", columnLabel, rs.getString("TYPE_NAME"), sql,
textValue);
+ throw new SQLNotNumericException(message, sql, getFile(),
columnLabel, textValue);
}
}
}
@@ -570,6 +569,6 @@ public class DBFRecordBasedResultSet ext
*/
@Override
public String toString() {
- return format("toString", m_statement != null ? m_statement.toString()
: null, m_sql, isClosed() == false);
+ return format("toString", statement != null ? statement.toString() :
null, sql, isClosed() == false);
}
}
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLIllegalColumnIndexException.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLIllegalColumnIndexException.java?rev=1649998&r1=1649997&r2=1649998&view=diff
==============================================================================
---
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLIllegalColumnIndexException.java
[UTF-8] (original)
+++
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/SQLIllegalColumnIndexException.java
[UTF-8] Wed Jan 7 06:34:41 2015
@@ -12,26 +12,26 @@ public class SQLIllegalColumnIndexExcept
private static final long serialVersionUID = 7525295716068215255L;
/** The SQL Statement (if known). */
- private String m_sql;
+ private String sql;
/** The database file. */
- private File m_database;
+ private File database;
/** Column Index that is invalid. */
- private int m_columnIndex;
+ private int columnIndex;
/**
* Build the exception.
* @param message Exception message.
- * @param sql SQL Statement who encountered the trouble, if known.
- * @param database The database that was queried.
- * @param columnIndex The column index that is invalid.
+ * @param sqlStatement SQL Statement who encountered the trouble, if known.
+ * @param dbf The database that was queried.
+ * @param colIndex The column index that is invalid.
*/
- public SQLIllegalColumnIndexException(String message, String sql, File
database, int columnIndex) {
+ public SQLIllegalColumnIndexException(String message, String sqlStatement,
File dbf, int colIndex) {
super(message);
- m_sql = sql;
- m_database = database;
- m_columnIndex = columnIndex;
+ sql = sqlStatement;
+ database = dbf;
+ columnIndex = colIndex;
}
/**
@@ -39,7 +39,7 @@ public class SQLIllegalColumnIndexExcept
* @return SQL statement or null.
*/
public String getSQL() {
- return m_sql;
+ return sql;
}
/**
@@ -47,7 +47,7 @@ public class SQLIllegalColumnIndexExcept
* @return Column index.
*/
public int getColumnIndex() {
- return m_columnIndex;
+ return columnIndex;
}
/**
@@ -55,6 +55,6 @@ public class SQLIllegalColumnIndexExcept
* @return Database file.
*/
public File getDatabase() {
- return m_database;
+ return database;
}
}