Skip to content

Commit e277087

Browse files
committed
Replace explicit types with <>
1 parent 2e87201 commit e277087

36 files changed

Lines changed: 81 additions & 81 deletions

src/main/java/com/microsoft/sqlserver/jdbc/AE.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ byte[] getCekMdVersion() {
8888
cekId = 0;
8989
cekVersion = 0;
9090
cekMdVersion = null;
91-
columnEncryptionKeyValues = new ArrayList<EncryptionKeyInfo>();
91+
columnEncryptionKeyValues = new ArrayList<>();
9292
}
9393

9494
int getSize() {

src/main/java/com/microsoft/sqlserver/jdbc/DataTypes.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ private GetterConversion(SSType.Category from,
382382
this.to = to;
383383
}
384384

385-
private static final EnumMap<SSType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<SSType.Category, EnumSet<JDBCType.Category>>(
385+
private static final EnumMap<SSType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<>(
386386
SSType.Category.class);
387387

388388
static {
@@ -776,7 +776,7 @@ private SetterConversionAE(JavaType from,
776776
this.to = to;
777777
}
778778

779-
private static final EnumMap<JavaType, EnumSet<JDBCType>> setterConversionAEMap = new EnumMap<JavaType, EnumSet<JDBCType>>(JavaType.class);
779+
private static final EnumMap<JavaType, EnumSet<JDBCType>> setterConversionAEMap = new EnumMap<>(JavaType.class);
780780

781781
static {
782782
for (JavaType javaType : JavaType.values())
@@ -1086,7 +1086,7 @@ private SetterConversion(JDBCType.Category from,
10861086
this.to = to;
10871087
}
10881088

1089-
private static final EnumMap<JDBCType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<JDBCType.Category, EnumSet<JDBCType.Category>>(
1089+
private static final EnumMap<JDBCType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<>(
10901090
JDBCType.Category.class);
10911091

10921092
static {
@@ -1305,7 +1305,7 @@ private UpdaterConversion(JDBCType.Category from,
13051305
this.to = to;
13061306
}
13071307

1308-
private static final EnumMap<JDBCType.Category, EnumSet<SSType.Category>> conversionMap = new EnumMap<JDBCType.Category, EnumSet<SSType.Category>>(
1308+
private static final EnumMap<JDBCType.Category, EnumSet<SSType.Category>> conversionMap = new EnumMap<>(
13091309
JDBCType.Category.class);
13101310

13111311
static {
@@ -1616,7 +1616,7 @@ private NormalizationAE(JDBCType from,
16161616
this.to = to;
16171617
}
16181618

1619-
private static final EnumMap<JDBCType, EnumSet<SSType>> normalizationMapAE = new EnumMap<JDBCType, EnumSet<SSType>>(JDBCType.class);
1619+
private static final EnumMap<JDBCType, EnumSet<SSType>> normalizationMapAE = new EnumMap<>(JDBCType.class);
16201620

16211621
static {
16221622
for (JDBCType jdbcType : JDBCType.values())

src/main/java/com/microsoft/sqlserver/jdbc/FailOverMapSingleton.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
final class FailoverMapSingleton {
1515
private static int INITIALHASHMAPSIZE = 5;
16-
private static HashMap<String, FailoverInfo> failoverMap = new HashMap<String, FailoverInfo>(INITIALHASHMAPSIZE);
16+
private static HashMap<String, FailoverInfo> failoverMap = new HashMap<>(INITIALHASHMAPSIZE);
1717

1818
private FailoverMapSingleton() {
1919
/* hide the constructor to stop the instantiation of this class. */}

src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,8 +2316,8 @@ else if (!useTnir) {
23162316
findSocketUsingJavaNIO(inetAddrs, portNumber, timeoutInMilliSeconds);
23172317
}
23182318
else {
2319-
LinkedList<Inet4Address> inet4Addrs = new LinkedList<Inet4Address>();
2320-
LinkedList<Inet6Address> inet6Addrs = new LinkedList<Inet6Address>();
2319+
LinkedList<Inet4Address> inet4Addrs = new LinkedList<>();
2320+
LinkedList<Inet6Address> inet6Addrs = new LinkedList<>();
23212321

23222322
for (InetAddress inetAddr : inetAddrs) {
23232323
if (inetAddr instanceof Inet4Address) {
@@ -2445,7 +2445,7 @@ private void findSocketUsingJavaNIO(InetAddress[] inetAddrs,
24452445
assert inetAddrs.length != 0 : "Number of inetAddresses should not be zero in this function";
24462446

24472447
Selector selector = null;
2448-
LinkedList<SocketChannel> socketChannels = new LinkedList<SocketChannel>();
2448+
LinkedList<SocketChannel> socketChannels = new LinkedList<>();
24492449
SocketChannel selectedChannel = null;
24502450

24512451
try {
@@ -2624,8 +2624,8 @@ private void findSocketUsingThreading(LinkedList<Inet6Address> inetAddrs,
26242624

26252625
assert inetAddrs.isEmpty() == false : "Number of inetAddresses should not be zero in this function";
26262626

2627-
LinkedList<Socket> sockets = new LinkedList<Socket>();
2628-
LinkedList<SocketConnector> socketConnectors = new LinkedList<SocketConnector>();
2627+
LinkedList<Socket> sockets = new LinkedList<>();
2628+
LinkedList<SocketConnector> socketConnectors = new LinkedList<>();
26292629

26302630
try {
26312631

@@ -5143,7 +5143,7 @@ void writeTvpOrderUnique(TVP value) throws SQLServerException {
51435143

51445144
Map<Integer, SQLServerMetaData> columnMetadata = value.getColumnMetadata();
51455145
Iterator<Entry<Integer, SQLServerMetaData>> columnsIterator = columnMetadata.entrySet().iterator();
5146-
LinkedList<TdsOrderUnique> columnList = new LinkedList<TdsOrderUnique>();
5146+
LinkedList<TdsOrderUnique> columnList = new LinkedList<>();
51475147

51485148
while (columnsIterator.hasNext()) {
51495149
byte flags = 0;

src/main/java/com/microsoft/sqlserver/jdbc/JaasConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public class JaasConfiguration extends Configuration {
2323

2424
private static AppConfigurationEntry[] generateDefaultConfiguration() {
2525
if (Util.isIBM()) {
26-
Map<String, String> confDetailsWithoutPassword = new HashMap<String, String>();
26+
Map<String, String> confDetailsWithoutPassword = new HashMap<>();
2727
confDetailsWithoutPassword.put("useDefaultCcache", "true");
28-
Map<String, String> confDetailsWithPassword = new HashMap<String, String>();
28+
Map<String, String> confDetailsWithPassword = new HashMap<>();
2929
// We generated a two configurations fallback that is suitable for password and password-less authentication
3030
// See https://www.ibm.com/support/knowledgecenter/SSYKE2_8.0.0/com.ibm.java.security.component.80.doc/security-component/jgssDocs/jaas_login_user.html
3131
final String ibmLoginModule = "com.ibm.security.auth.module.Krb5LoginModule";
@@ -34,7 +34,7 @@ private static AppConfigurationEntry[] generateDefaultConfiguration() {
3434
new AppConfigurationEntry(ibmLoginModule, AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, confDetailsWithPassword)};
3535
}
3636
else {
37-
Map<String, String> confDetails = new HashMap<String, String>();
37+
Map<String, String> confDetails = new HashMap<>();
3838
confDetails.put("useTicketCache", "true");
3939
return new AppConfigurationEntry[] {new AppConfigurationEntry("com.sun.security.auth.module.Krb5LoginModule",
4040
AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, confDetails)};

src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,11 @@ private Encoding encodingFromSortId() throws UnsupportedEncodingException {
530530
static {
531531
// Populate the windows locale and sort order indices
532532

533-
localeIndex = new HashMap<Integer, WindowsLocale>();
533+
localeIndex = new HashMap<>();
534534
for (WindowsLocale locale : EnumSet.allOf(WindowsLocale.class))
535535
localeIndex.put(locale.langID, locale);
536536

537-
sortOrderIndex = new HashMap<Integer, SortOrder>();
537+
sortOrderIndex = new HashMap<>();
538538
for (SortOrder sortOrder : EnumSet.allOf(SortOrder.class))
539539
sortOrderIndex.put(sortOrder.sortId, sortOrder);
540540
}

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Factory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class SQLServerAeadAes256CbcHmac256Factory extends SQLServerEncryptionAlgorithmFactory {
2222
// In future we can have more
2323
private byte algorithmVersion = 0x1;
24-
private ConcurrentHashMap<String, SQLServerAeadAes256CbcHmac256Algorithm> encryptionAlgorithms = new ConcurrentHashMap<String, SQLServerAeadAes256CbcHmac256Algorithm>();
24+
private ConcurrentHashMap<String, SQLServerAeadAes256CbcHmac256Algorithm> encryptionAlgorithms = new ConcurrentHashMap<>();
2525

2626
@Override
2727
SQLServerEncryptionAlgorithm create(SQLServerSymmetricKey columnEncryptionKey,

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public final class SQLServerBlob implements java.sql.Blob, java.io.Serializable
4040
// Initial size of the array is based on an assumption that a Blob object is
4141
// typically used either for input or output, and then only once. The array size
4242
// grows automatically if multiple streams are used.
43-
ArrayList<Closeable> activeStreams = new ArrayList<Closeable>(1);
43+
ArrayList<Closeable> activeStreams = new ArrayList<>(1);
4444

4545
static private final Logger logger = Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerBlob");
4646

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ else if (null == delimiter) {
159159
catch (Exception e) {
160160
throw new SQLServerException(null, e.getMessage(), null, 0, false);
161161
}
162-
columnMetadata = new HashMap<Integer, SQLServerBulkCSVFileRecord.ColumnMetadata>();
162+
columnMetadata = new HashMap<>();
163163

164164
loggerExternal.exiting(loggerClassName, "SQLServerBulkCSVFileRecord");
165165
}
@@ -216,7 +216,7 @@ else if (null == delimiter) {
216216
catch (Exception e) {
217217
throw new SQLServerException(null, e.getMessage(), null, 0, false);
218218
}
219-
columnMetadata = new HashMap<Integer, SQLServerBulkCSVFileRecord.ColumnMetadata>();
219+
columnMetadata = new HashMap<>();
220220

221221
loggerExternal.exiting(loggerClassName, "SQLServerBulkCSVFileRecord");
222222
}

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ public void writeToServer(ISQLServerBulkRecord sourceData) throws SQLServerExcep
675675
* Initializes the defaults for member variables that require it.
676676
*/
677677
private void initializeDefaults() {
678-
columnMappings = new LinkedList<SQLServerBulkCopy.ColumnMapping>();
678+
columnMappings = new LinkedList<>();
679679
destinationTableName = null;
680680
sourceBulkRecord = null;
681681
sourceResultSet = null;
@@ -1471,7 +1471,7 @@ private String getDestTypeFromSrcType(int srcColIndx,
14711471

14721472
private String createInsertBulkCommand(TDSWriter tdsWriter) throws SQLServerException {
14731473
StringBuilder bulkCmd = new StringBuilder();
1474-
List<String> bulkOptions = new ArrayList<String>();
1474+
List<String> bulkOptions = new ArrayList<>();
14751475
String endColumn = " , ";
14761476
bulkCmd.append("INSERT BULK " + destinationTableName + " (");
14771477

@@ -1747,7 +1747,7 @@ private void getDestinationMetadata() throws SQLServerException {
17471747
.executeQueryInternal("SET FMTONLY ON SELECT * FROM " + destinationTableName + " SET FMTONLY OFF ");
17481748

17491749
destColumnCount = rs.getMetaData().getColumnCount();
1750-
destColumnMetadata = new HashMap<Integer, BulkColumnMetaData>();
1750+
destColumnMetadata = new HashMap<>();
17511751
destCekTable = rs.getCekTable();
17521752

17531753
if (!connection.getServerSupportsColumnEncryption()) {
@@ -1793,7 +1793,7 @@ private void getDestinationMetadata() throws SQLServerException {
17931793
* source metadata from the same place for both ResultSet and File.
17941794
*/
17951795
private void getSourceMetadata() throws SQLServerException {
1796-
srcColumnMetadata = new HashMap<Integer, BulkColumnMetaData>();
1796+
srcColumnMetadata = new HashMap<>();
17971797
int currentColumn;
17981798
if (null != sourceResultSet) {
17991799
try {

0 commit comments

Comments
 (0)