Skip to content

Commit

Permalink
Fixed javadoc warnings (#1570)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilgreenbird authored Apr 28, 2021
1 parent 1b30742 commit 0f3e0a1
Show file tree
Hide file tree
Showing 47 changed files with 930 additions and 258 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.0</version>
<configuration>
<failOnError>true</failOnError>
<excludePackageNames>mssql.googlecode.*:mssql.security.provider.MD4</excludePackageNames>
<excludePackageNames>mssql.*</excludePackageNames>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* to keep a lock in the class through a connection open a placeholder class is used to get the failover info in one
* shot. This class should never directly expose its members.
*/

final class FailoverInfo {
private String failoverPartner;
private int portNumber;
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/com/microsoft/sqlserver/jdbc/Geography.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@


/**
* Geography datatype represents data in a round-earth coordinate system.
* This class will stay in this current package for backwards compatibility.
* Geography datatype represents data in a round-earth coordinate system. This class will stay in this current package
* for backwards compatibility.
*/

public class Geography extends SQLServerSpatialDatatype {

protected Geography() {}
Geography() {}

/**
* Private constructor used for creating a Geography object from WKT and Spatial Reference Identifier.
Expand All @@ -28,7 +27,7 @@ protected Geography() {}
* @throws SQLServerException
* if an exception occurs
*/
protected Geography(String wkt, int srid) throws SQLServerException {
Geography(String wkt, int srid) throws SQLServerException {
if (null == wkt || wkt.length() <= 0) {
throwIllegalWKT();
}
Expand Down Expand Up @@ -91,10 +90,10 @@ public static Geography STGeomFromText(String wkt, int srid) throws SQLServerExc
* Constructor for a Geography instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB)
* representation.
*
* Note: This method currently uses internal SQL Server format (CLR) to create a Geography instance,
* but in the future this will be changed to accept WKB data instead, as the SQL Server counterpart of this
* method (STGeomFromWKB) uses WKB.
* For existing users who are already using this method, consider switching to deserialize(byte) instead.
* Note: This method currently uses internal SQL Server format (CLR) to create a Geography instance, but in the
* future this will be changed to accept WKB data instead, as the SQL Server counterpart of this method
* (STGeomFromWKB) uses WKB. For existing users who are already using this method, consider switching to
* deserialize(byte) instead.
*
* @param wkb
* Well-Known Binary (WKB) provided by the user.
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/com/microsoft/sqlserver/jdbc/Geometry.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@


/**
* Geometry datatype represents data in a Euclidean (flat) coordinate system.
* This class will stay in this current package for backwards compatibility.
* Geometry datatype represents data in a Euclidean (flat) coordinate system. This class will stay in this current
* package for backwards compatibility.
*/

public class Geometry extends SQLServerSpatialDatatype {

/**
* Creates a Geometry object
*/
protected Geometry() {}

/**
Expand Down Expand Up @@ -91,10 +94,10 @@ public static Geometry STGeomFromText(String wkt, int srid) throws SQLServerExce
* Constructor for a Geometry instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB)
* representation.
*
* Note: This method currently uses internal SQL Server format (CLR) to create a Geometry instance,
* but in the future this will be changed to accept WKB data instead, as the SQL Server counterpart of this
* method (STGeomFromWKB) uses WKB.
* For existing users who are already using this method, consider switching to deserialize(byte) instead.
* Note: This method currently uses internal SQL Server format (CLR) to create a Geometry instance, but in the
* future this will be changed to accept WKB data instead, as the SQL Server counterpart of this method
* (STGeomFromWKB) uses WKB. For existing users who are already using this method, consider switching to
* deserialize(byte) instead.
*
* @param wkb
* Well-Known Binary (WKB) provided by the user.
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ private UTC() {}
}


/**
* TDS Channel
*/
final class TDSChannel implements Serializable {
/**
* Always update serialVersionUID when prompted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,28 @@
* Provides an interface to create an Enclave Session
*
*/
public interface ISQLServerEnclaveProvider {
interface ISQLServerEnclaveProvider {
/**
* sp_describe_parameter_encryption stored procedure with 2 params
*/
static final String SDPE1 = "EXEC sp_describe_parameter_encryption ?,?";

/**
* sp_describe_parameter_encryption stored procedure with 3 params
*/
static final String SDPE2 = "EXEC sp_describe_parameter_encryption ?,?,?";

/**
* Get the Enclave package
*
* @param userSQL
* user sql
* @param enclaveCEKs
* enclave CEKs
* @return the enclave package
* @throws SQLServerException
* if error
*/
default byte[] getEnclavePackage(String userSQL, ArrayList<byte[]> enclaveCEKs) throws SQLServerException {
EnclaveSession enclaveSession = getEnclaveSession();
if (null != enclaveSession) {
Expand Down Expand Up @@ -82,6 +100,23 @@ default byte[] getEnclavePackage(String userSQL, ArrayList<byte[]> enclaveCEKs)
return null;
}

/**
* Execute sp_describe_parameter_encryption for AEv2
*
* @param stmt
* statement
* @param userSql
* user sql
* @param preparedTypeDefinitions
* prepared type definitions
* @param req
* request
* @return result set
* @throws SQLException
* if error
* @throws IOException
* if IO exception
*/
default ResultSet executeSDPEv2(PreparedStatement stmt, String userSql, String preparedTypeDefinitions,
BaseAttestationRequest req) throws SQLException, IOException {
((SQLServerPreparedStatement) stmt).isInternalEncryptionQuery = true;
Expand All @@ -95,6 +130,19 @@ default ResultSet executeSDPEv2(PreparedStatement stmt, String userSql, String p
return ((SQLServerPreparedStatement) stmt).executeQueryInternal();
}

/**
* Execute sp_describe_parameter_encryption
*
* @param stmt
* stmt
* @param userSql
* user sql
* @param preparedTypeDefinitions
* prepared type definitions
* @return result set
* @throws SQLException
* if error
*/
default ResultSet executeSDPEv1(PreparedStatement stmt, String userSql,
String preparedTypeDefinitions) throws SQLException {
((SQLServerPreparedStatement) stmt).isInternalEncryptionQuery = true;
Expand All @@ -107,6 +155,28 @@ default ResultSet executeSDPEv1(PreparedStatement stmt, String userSql,
return ((SQLServerPreparedStatement) stmt).executeQueryInternal();
}

/**
* Process result from sp_describe_parameter_encryption
*
* @param userSql
* user sql
* @param preparedTypeDefinitions
* prepared type definitions
* @param params
* params
* @param parameterNames
* param names
* @param connection
* connection
* @param stmt
* statement
* @param rs
* result set
* @param enclaveRequestedCEKs
* enclave requested CEKs
* @throws SQLException
* if error
*/
default void processSDPEv1(String userSql, String preparedTypeDefinitions, Parameter[] params,
ArrayList<String> parameterNames, SQLServerConnection connection, PreparedStatement stmt, ResultSet rs,
ArrayList<byte[]> enclaveRequestedCEKs) throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Specifies the spatial data types values
*/
public enum InternalSpatialDatatype {
enum InternalSpatialDatatype {
POINT((byte) 1, "POINT"),
LINESTRING((byte) 2, "LINESTRING"),
POLYGON((byte) 3, "POLYGON"),
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,31 @@ public final class SQLServerBlob extends SQLServerLob implements java.sql.Blob,
// Unique id generator for each instance (use for logging).
private static final AtomicInteger BASE_ID = new AtomicInteger(0);

// The value of the BLOB that this Blob object represents.
// This value is never null unless/until the free() method is called.
/**
* The value of the BLOB that this Blob object represents. This value is never null unless/until the free() method
* is called.
*/
private byte[] value;

private transient SQLServerConnection con;

/** check if LOB has been freed */
private boolean isClosed = false;

// Active streams which must be closed when the Blob is closed
//
// Initial size of the array is based on an assumption that a Blob object is
// typically used either for input or output, and then only once. The array
// size
// grows automatically if multiple streams are used.
/**
* Active streams which must be closed when the Blob is closed
*
* Initial size of the array is based on an assumption that a Blob object is typically used either for input or
* output, and then only once. The array size grows automatically if multiple streams are used.
*/
ArrayList<Closeable> activeStreams = new ArrayList<>(1);

/** trace id */
private final String traceID;

/**
* Returns string representation of object
*/
public final String toString() {
return traceID;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class SQLServerBulkBatchInsertRecord extends SQLServerBulkRecord {
ArrayList<String> valueList, String encoding) throws SQLServerException {
initLoggerResources();
if (loggerExternal.isLoggable(java.util.logging.Level.FINER)) {
loggerExternal.entering(loggerPackageName, loggerClassName,
new Object[] {batchParam, encoding});
loggerExternal.entering(loggerPackageName, loggerClassName, new Object[] {batchParam, encoding});
}

if (null == batchParam) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,38 @@ public class SQLServerBulkCSVFileRecord extends SQLServerBulkRecord implements j
* Update serialVersionUID when making changes to this file
*/
private static final long serialVersionUID = 1546487135640225989L;
/*

/**
* Resources associated with reading in the file
*/
/** file reader */
private BufferedReader fileReader;

/** input stream reader */
private InputStreamReader sr;

/** file input stream */
private FileInputStream fis;

/*
/**
* Current line of data to parse.
*/
private String currentLine = null;

/*
/**
* Delimiter to parse lines with.
*/
private final String delimiter;

/**
* Escape delimiters
*/
private boolean escapeDelimiters;

// Regex to ignore delimiter when the field is enclosed in quotes.
/**
* Regex to ignore delimiter when the field is enclosed in quotes.
*
*/
private static final String escapeSplitPattern = "(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)";

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ private class ColumnMapping implements Serializable {
*/
private SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting = SQLServerStatementColumnEncryptionSetting.UseConnectionSetting;

/**
* Destination table metadata
*/
private ResultSet destinationTableMetadata;

/**
Expand Down Expand Up @@ -251,6 +254,9 @@ class BulkColumnMetaData {
*/
private int srcColumnCount;

/**
* Shared timer
*/
private ScheduledFuture<?> timeout;

/**
Expand Down Expand Up @@ -3660,12 +3666,11 @@ private boolean writeBatchData(TDSWriter tdsWriter, TDSCommand command,
}
}

protected void setStmtColumnEncriptionSetting(
SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting) {
void setStmtColumnEncriptionSetting(SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting) {
this.stmtColumnEncriptionSetting = stmtColumnEncriptionSetting;
}

protected void setDestinationTableMetadata(SQLServerResultSet rs) {
void setDestinationTableMetadata(SQLServerResultSet rs) {
destinationTableMetadata = rs;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public class SQLServerBulkCopyOptions implements Serializable {
*/
private boolean useInternalTransaction;

/**
* Flag to determine whether encrypted value modifications are allwoed
*/
private boolean allowEncryptedValueModifications;

/**
Expand Down
Loading

0 comments on commit 0f3e0a1

Please sign in to comment.