Remove Implicit Type Parameters

This commit is contained in:
Josh Cummings
2025-01-07 13:41:45 -07:00
parent 9c978b7adc
commit 32081f5edd
69 changed files with 254 additions and 262 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,11 +29,11 @@ import java.util.Set;
*/
public final class ObjectSchema {
private final Set<AttributeSchema> must = new HashSet<AttributeSchema>();
private final Set<AttributeSchema> must = new HashSet<>();
private final Set<AttributeSchema> may = new HashSet<AttributeSchema>();
private final Set<AttributeSchema> may = new HashSet<>();
private final Set<String> objectClass = new HashSet<String>();
private final Set<String> objectClass = new HashSet<>();
public void addMust(AttributeSchema must) {
// if may attributes contain must attribute, remove from may and add to must

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -141,7 +141,7 @@ import org.springframework.ldap.odm.tools.SyntaxToJavaClass.ClassInfo;
throws NamingException, ClassNotFoundException {
// Super classes
Set<String> supList = new HashSet<String>();
Set<String> supList = new HashSet<>();
// For each of the given object classes
for (String objectClass : objectClasses) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -179,7 +179,7 @@ public final class SchemaToJava {
// Read list of LDAP syntaxes that are returned as byte[]
private static Set<String> readBinarySet(File binarySetFile) throws IOException {
Set<String> result = new HashSet<String>();
Set<String> result = new HashSet<>();
BufferedReader reader = null;
try {
@@ -209,7 +209,7 @@ public final class SchemaToJava {
// Read mappings of LDAP syntaxes to Java classes.
private static Map<String, String> readSyntaxMap(File syntaxMapFile) throws IOException {
Map<String, String> result = new HashMap<String, String>();
Map<String, String> result = new HashMap<>();
BufferedReader reader = null;
try {
@@ -247,7 +247,7 @@ public final class SchemaToJava {
Set<String> binarySet, Set<String> objectClasses) throws NamingException, ClassNotFoundException {
// Set up environment
Hashtable<String, String> env = new Hashtable<String, String>();
Hashtable<String, String> env = new Hashtable<>();
env.put(Context.PROVIDER_URL, url);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
if (user != null) {
@@ -279,7 +279,7 @@ public final class SchemaToJava {
freeMarkerConfiguration.setObjectWrapper(new DefaultObjectWrapper());
// Build the model for FreeMarker
Map<String, Object> model = new HashMap<String, Object>();
Map<String, Object> model = new HashMap<>();
model.put("package", packageName);
model.put("class", className);
model.put("schema", schema);
@@ -337,7 +337,7 @@ public final class SchemaToJava {
}
private static Set<String> parseObjectClassesFlag(String objectClassesFlag) {
Set<String> objectClasses = new HashSet<String>();
Set<String> objectClasses = new HashSet<>();
for (String objectClassFlag : objectClassesFlag.split(",")) {
if (objectClassFlag.length() > 0) {
@@ -412,7 +412,7 @@ public final class SchemaToJava {
// Look for the optional syntax to Java class mapping file
String syntaxMapFileName = cmd.getOptionValue(Flag.SYNTAX_MAP.getShort(), null);
SyntaxToJavaClass syntaxToJavaClass = new SyntaxToJavaClass(new HashMap<String, String>());
SyntaxToJavaClass syntaxToJavaClass = new SyntaxToJavaClass(new HashMap<>());
if (syntaxMapFileName != null) {
File syntaxMapFile = new File(syntaxMapFileName);
if (syntaxMapFile.canRead()) {
@@ -459,7 +459,7 @@ public final class SchemaToJava {
}
// Work out what imports we need
Set<SyntaxToJavaClass.ClassInfo> imports = new HashSet<SyntaxToJavaClass.ClassInfo>();
Set<SyntaxToJavaClass.ClassInfo> imports = new HashSet<>();
for (AttributeSchema attributeSchema : schema.getMay()) {
SyntaxToJavaClass.ClassInfo classInfo = syntaxToJavaClass.getClassInfo(attributeSchema.getSyntax());
if (classInfo != null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -220,7 +220,7 @@ public final class SchemaViewer {
String user = cmd.getOptionValue(Flag.USERNAME.getShort(), "");
String pass = cmd.getOptionValue(Flag.PASSWORD.getShort(), "");
Hashtable<String, String> env = new Hashtable<String, String>();
Hashtable<String, String> env = new Hashtable<>();
env.put(Context.PROVIDER_URL, url);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
if (user != null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import java.util.Map.Entry;
*/
/* package */ final class SyntaxToJavaClass {
private final Map<String, ClassInfo> mapSyntaxToClassInfo = new HashMap<String, ClassInfo>();
private final Map<String, ClassInfo> mapSyntaxToClassInfo = new HashMap<>();
SyntaxToJavaClass(Map<String, String> mapSyntaxToClass) {
for (Entry<String, String> syntaxAndClass : mapSyntaxToClass.entrySet()) {

View File

@@ -131,7 +131,7 @@ public class ArrayMarshaller<E> implements Marshaller<ArrayTree<E>> {
if ((data.length == 1) && (data[0] == 0)) {
E[] array = (E[]) new Object[] {};
ArrayTree<E> tree = new ArrayTree<E>(this.comparator, array);
ArrayTree<E> tree = new ArrayTree<>(this.comparator, array);
return tree;
}
@@ -160,7 +160,7 @@ public class ArrayMarshaller<E> implements Marshaller<ArrayTree<E>> {
}
}
ArrayTree<E> arrayTree = new ArrayTree<E>(this.comparator, nodes);
ArrayTree<E> arrayTree = new ArrayTree<>(this.comparator, nodes);
return arrayTree;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,19 +52,19 @@ public class ConverterFactoryTests {
@Test
public void testConverterFactory() throws Exception {
ConverterManagerFactoryBean converterManagerFactory = new ConverterManagerFactoryBean();
Set<ConverterManagerFactoryBean.ConverterConfig> configList = new HashSet<ConverterManagerFactoryBean.ConverterConfig>();
Set<ConverterManagerFactoryBean.ConverterConfig> configList = new HashSet<>();
for (ConverterConfigTestData config : converterConfigTestData) {
ConverterManagerFactoryBean.ConverterConfig converterConfig = new ConverterManagerFactoryBean.ConverterConfig();
converterConfig.setFromClasses(new HashSet<Class<?>>(Arrays.asList(config.fromClasses)));
converterConfig.setFromClasses(new HashSet<>(Arrays.asList(config.fromClasses)));
converterConfig.setSyntax(config.syntax);
converterConfig.setToClasses(new HashSet<Class<?>>(Arrays.asList(config.toClasses)));
converterConfig.setToClasses(new HashSet<>(Arrays.asList(config.toClasses)));
converterConfig.setConverter(nullConverter);
configList.add(converterConfig);
}
converterManagerFactory.setConverterConfig(configList);
final ConverterManager converterManager = (ConverterManager) converterManagerFactory.getObject();
new ExecuteRunnable<ConverterTestData>().runTests(new RunnableTests<ConverterTestData>() {
new ExecuteRunnable<ConverterTestData>().runTests(new RunnableTests<>() {
public void runTest(ConverterTestData testData) {
assertThat(testData.canConvert)
.isEqualTo(converterManager.canConvert(testData.fromClass, testData.syntax, testData.toClass));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -73,33 +73,33 @@ public final class ConverterManagerTests {
@Test
public void basicTypeConverion() throws Exception {
final ConverterTestData<?>[] primitiveTypeTests = new ConverterTestData<?>[] {
new ConverterTestData<Byte>("33", Byte.class, Byte.valueOf((byte) 33)),
new ConverterTestData<Byte>("-88", Byte.class, Byte.valueOf((byte) -88)),
new ConverterTestData<Short>("666", Short.class, Short.valueOf((short) 666)),
new ConverterTestData<Short>("-123", Short.class, Short.valueOf((short) -123)),
new ConverterTestData<Integer>("123", Integer.class, Integer.valueOf(123)),
new ConverterTestData<Integer>("-500", Integer.class, Integer.valueOf(-500)),
new ConverterTestData<Long>("123456", Long.class, Long.valueOf(123456)),
new ConverterTestData<Long>("-654321", Long.class, Long.valueOf(-654321)),
new ConverterTestData<Double>("2", Double.class, Double.valueOf(2)),
new ConverterTestData<Double>("-0.4", Double.class, Double.valueOf(-0.4)),
new ConverterTestData<Float>("666", Float.class, Float.valueOf(666)),
new ConverterTestData<Float>("-0.75", Float.class, Float.valueOf(-0.75F)),
new ConverterTestData<Boolean>("false", Boolean.class, Boolean.FALSE),
new ConverterTestData<Boolean>("TRUE", Boolean.class, Boolean.TRUE),
new ConverterTestData<String>("This is a string", String.class, "This is a string"),
new ConverterTestData<String>("This is another String", String.class, "This is another String"),
new ConverterTestData<String>((byte) 66, String.class, "66"),
new ConverterTestData<String>((int) 1234, String.class, "1234"),
new ConverterTestData<String>((int) -9876, String.class, "-9876"),
new ConverterTestData<URI>("https://google.com/", URI.class, new URI("https://google.com/")),
new ConverterTestData<URI>("https://apache.org/index.html", URI.class,
new ConverterTestData<>("33", Byte.class, Byte.valueOf((byte) 33)),
new ConverterTestData<>("-88", Byte.class, Byte.valueOf((byte) -88)),
new ConverterTestData<>("666", Short.class, Short.valueOf((short) 666)),
new ConverterTestData<>("-123", Short.class, Short.valueOf((short) -123)),
new ConverterTestData<>("123", Integer.class, Integer.valueOf(123)),
new ConverterTestData<>("-500", Integer.class, Integer.valueOf(-500)),
new ConverterTestData<>("123456", Long.class, Long.valueOf(123456)),
new ConverterTestData<>("-654321", Long.class, Long.valueOf(-654321)),
new ConverterTestData<>("2", Double.class, Double.valueOf(2)),
new ConverterTestData<>("-0.4", Double.class, Double.valueOf(-0.4)),
new ConverterTestData<>("666", Float.class, Float.valueOf(666)),
new ConverterTestData<>("-0.75", Float.class, Float.valueOf(-0.75F)),
new ConverterTestData<>("false", Boolean.class, Boolean.FALSE),
new ConverterTestData<>("TRUE", Boolean.class, Boolean.TRUE),
new ConverterTestData<>("This is a string", String.class, "This is a string"),
new ConverterTestData<>("This is another String", String.class, "This is another String"),
new ConverterTestData<>((byte) 66, String.class, "66"),
new ConverterTestData<>((int) 1234, String.class, "1234"),
new ConverterTestData<>((int) -9876, String.class, "-9876"),
new ConverterTestData<>("https://google.com/", URI.class, new URI("https://google.com/")),
new ConverterTestData<>("https://apache.org/index.html", URI.class,
new URI("https://apache.org/index.html")),
new ConverterTestData<String>(new URI("https://google.com/"), String.class, "https://google.com/"),
new ConverterTestData<String>(new URI("https://apache.org/index.html"), String.class,
new ConverterTestData<>(new URI("https://google.com/"), String.class, "https://google.com/"),
new ConverterTestData<>(new URI("https://apache.org/index.html"), String.class,
"https://apache.org/index.html") };
new ExecuteRunnable<ConverterTestData<?>>().runTests(new RunnableTests<ConverterTestData<?>>() {
new ExecuteRunnable<ConverterTestData<?>>().runTests(new RunnableTests<>() {
public void runTest(ConverterTestData<?> testData) {
assertThat(testData.expectedValue).isEqualTo(ConverterManagerTests.this.converterManager
.convert(testData.sourceData, "", testData.destClass));
@@ -118,20 +118,20 @@ public final class ConverterManagerTests {
this.converterManager.addConverter(Integer.class, "3", Integer.class, cubedConverter);
final ConverterTestData<?>[] syntaxTests = new ConverterTestData<?>[] {
new ConverterTestData<Integer>("3", "", Integer.class, Integer.valueOf(3)),
new ConverterTestData<Integer>("4", "", Integer.class, Integer.valueOf(4)),
new ConverterTestData<Integer>(5, "", Integer.class, Integer.valueOf(5)),
new ConverterTestData<Integer>(6, "", Integer.class, Integer.valueOf(6)),
new ConverterTestData<Integer>("3", "1", Integer.class, Integer.valueOf(9)),
new ConverterTestData<Integer>("4", "1", Integer.class, Integer.valueOf(16)),
new ConverterTestData<Integer>(5, "1", Integer.class, Integer.valueOf(25)),
new ConverterTestData<Integer>(6, "1", Integer.class, Integer.valueOf(36)),
new ConverterTestData<Integer>("3", "2", Integer.class, Integer.valueOf(27)),
new ConverterTestData<Integer>("4", "2", Integer.class, Integer.valueOf(64)),
new ConverterTestData<Integer>(5, "3", Integer.class, Integer.valueOf(125)),
new ConverterTestData<Integer>(6, "3", Integer.class, Integer.valueOf(216)), };
new ConverterTestData<>("3", "", Integer.class, Integer.valueOf(3)),
new ConverterTestData<>("4", "", Integer.class, Integer.valueOf(4)),
new ConverterTestData<>(5, "", Integer.class, Integer.valueOf(5)),
new ConverterTestData<>(6, "", Integer.class, Integer.valueOf(6)),
new ConverterTestData<>("3", "1", Integer.class, Integer.valueOf(9)),
new ConverterTestData<>("4", "1", Integer.class, Integer.valueOf(16)),
new ConverterTestData<>(5, "1", Integer.class, Integer.valueOf(25)),
new ConverterTestData<>(6, "1", Integer.class, Integer.valueOf(36)),
new ConverterTestData<>("3", "2", Integer.class, Integer.valueOf(27)),
new ConverterTestData<>("4", "2", Integer.class, Integer.valueOf(64)),
new ConverterTestData<>(5, "3", Integer.class, Integer.valueOf(125)),
new ConverterTestData<>(6, "3", Integer.class, Integer.valueOf(216)), };
new ExecuteRunnable<ConverterTestData<?>>().runTests(new RunnableTests<ConverterTestData<?>>() {
new ExecuteRunnable<ConverterTestData<?>>().runTests(new RunnableTests<>() {
public void runTest(ConverterTestData<?> testData) {
assertThat(testData.expectedValue).isEqualTo(ConverterManagerTests.this.converterManager
.convert(testData.sourceData, testData.syntax, testData.destClass));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -185,7 +185,7 @@ public final class LdapTests {
LdapTestUtils.cleanAndSetup(this.contextSource, baseName, new ClassPathResource("testdata.ldif"));
// Create our OdmManager
Set<Class<?>> managedClasses = new HashSet<Class<?>>();
Set<Class<?>> managedClasses = new HashSet<>();
managedClasses.add(Person.class);
managedClasses.add(PlainPerson.class);
managedClasses.add(OrganizationalUnit.class);
@@ -243,7 +243,7 @@ public final class LdapTests {
// Read various entries from the sample data set and check they are what we'd expect.
@Test
public void read() throws Exception {
new ExecuteRunnable<Person>().runTests(new RunnableTests<Person>() {
new ExecuteRunnable<Person>().runTests(new RunnableTests<>() {
public void runTest(Person testData) {
Name dn = testData.getDn();
LOG.debug(String.format("reading - %1$s", dn));
@@ -269,14 +269,14 @@ public final class LdapTests {
// we'd expect.
@Test
public void search() throws Exception {
new ExecuteRunnable<SearchTestData>().runTests(new RunnableTests<SearchTestData>() {
new ExecuteRunnable<SearchTestData>().runTests(new RunnableTests<>() {
public void runTest(SearchTestData testData) {
String search = testData.search;
LOG.debug(String.format("searching - %1$s", search));
List<Person> results = LdapTests.this.odmManager.search(Person.class, baseName, testData.search,
testData.searchScope);
LOG.debug(String.format("found - %1$s", results));
assertThat(new HashSet<Person>(Arrays.asList(testData.people))).isEqualTo(new HashSet<Person>(results));
assertThat(new HashSet<>(Arrays.asList(testData.people))).isEqualTo(new HashSet<>(results));
}
}, this.searchTestData);
}
@@ -311,8 +311,7 @@ public final class LdapTests {
List<OrganizationalUnit> allOus = this.odmManager.findAll(OrganizationalUnit.class, baseName,
this.searchControls);
LOG.debug(String.format("Found - %1$s", allOus));
assertThat(new HashSet<OrganizationalUnit>(Arrays.asList(ouTestData)))
.isEqualTo(new HashSet<OrganizationalUnit>(allOus));
assertThat(new HashSet<>(Arrays.asList(ouTestData))).isEqualTo(new HashSet<>(allOus));
OrganizationalUnit testOu = ouTestData[OrganizationalName.ASSISTANTS.getIndex()];
LOG.debug(String.format("Reading - %1$s", testOu.getDn()));
@@ -328,7 +327,7 @@ public final class LdapTests {
LOG.debug("finding all people");
List<Person> allPeople = this.odmManager.findAll(Person.class, baseName, this.searchControls);
LOG.debug(String.format("found %1$s", allPeople));
assertThat(new HashSet<Person>(Arrays.asList(this.personTestData))).isEqualTo(new HashSet<Person>(allPeople));
assertThat(new HashSet<>(Arrays.asList(this.personTestData))).isEqualTo(new HashSet<>(allPeople));
}
@Test
@@ -394,7 +393,7 @@ public final class LdapTests {
this.odmManager.create(person);
}
LOG.debug("Created all, reading back");
new ExecuteRunnable<Person>().runTests(new RunnableTests<Person>() {
new ExecuteRunnable<Person>().runTests(new RunnableTests<>() {
public void runTest(Person testData) {
Name dn = testData.getDn();
LOG.debug(String.format("reading - %1$s", dn));
@@ -434,7 +433,7 @@ public final class LdapTests {
}
List<Person> allPeople = this.odmManager.findAll(Person.class, baseName, this.searchControls);
assertThat(new HashSet<Person>(Arrays.asList(this.whatsLeft))).isEqualTo(new HashSet<Person>(allPeople));
assertThat(new HashSet<>(Arrays.asList(this.whatsLeft))).isEqualTo(new HashSet<>(allPeople));
}
// Trying to read a non-existant entry should be flagged as an error

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ public final class OrganizationalUnit {
private Name dn;
@Attribute(name = "objectClass", syntax = "1.3.6.1.4.1.1466.115.121.1.38")
private List<String> objectClass = new ArrayList<String>();
private List<String> objectClass = new ArrayList<>();
@Attribute(name = "ou", syntax = "1.3.6.1.4.1.1466.115.121.1.15")
private String ou;
@@ -132,7 +132,7 @@ public final class OrganizationalUnit {
}
}
else if (this.objectClass.size() != other.objectClass.size()
|| !(new HashSet<String>(this.objectClass)).equals(new HashSet<String>(other.objectClass))) {
|| !(new HashSet<>(this.objectClass)).equals(new HashSet<>(other.objectClass))) {
return false;
}
if (this.ou == null) {
@@ -160,7 +160,7 @@ public final class OrganizationalUnit {
int result = 1;
result = prime * result + ((this.description == null) ? 0 : this.description.hashCode());
result = prime * result + ((this.dn == null) ? 0 : this.dn.hashCode());
result = prime * result + ((this.objectClass == null) ? 0 : new HashSet<String>(this.objectClass).hashCode());
result = prime * result + ((this.objectClass == null) ? 0 : new HashSet<>(this.objectClass).hashCode());
result = prime * result + ((this.ou == null) ? 0 : this.ou.hashCode());
result = prime * result + ((this.street == null) ? 0 : this.street.hashCode());
return result;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ public final class Person {
this.desc = desc;
this.telephoneNumber = telephoneNumber;
this.jpegPhoto = jpegPhoto;
this.objectClasses = new ArrayList<String>();
this.objectClasses = new ArrayList<>();
this.objectClasses.add("inetOrgPerson");
this.objectClasses.add("organizationalPerson");
this.objectClasses.add("person");
@@ -60,7 +60,7 @@ public final class Person {
private String someRandomField = null;
@Transient
private List<String> someRandomList = new ArrayList<String>();
private List<String> someRandomList = new ArrayList<>();
@Attribute(name = "objectClass")
private List<String> objectClasses;
@@ -163,7 +163,7 @@ public final class Person {
}
}
else if (this.desc.size() != other.desc.size()
|| !(new HashSet<String>(this.desc)).equals(new HashSet<String>(other.desc))) {
|| !(new HashSet<>(this.desc)).equals(new HashSet<>(other.desc))) {
return false;
}
if (this.dn == null) {
@@ -183,7 +183,7 @@ public final class Person {
}
}
else if (this.objectClasses.size() != other.objectClasses.size()
|| !(new HashSet<String>(this.objectClasses)).equals(new HashSet<String>(other.objectClasses))) {
|| !(new HashSet<>(this.objectClasses)).equals(new HashSet<>(other.objectClasses))) {
return false;
}
if (this.someRandomField == null) {
@@ -221,11 +221,10 @@ public final class Person {
final int prime = 31;
int result = 1;
result = prime * result + ((this.cn == null) ? 0 : this.cn.hashCode());
result = prime * result + ((this.desc == null) ? 0 : new HashSet<String>(this.desc).hashCode());
result = prime * result + ((this.desc == null) ? 0 : new HashSet<>(this.desc).hashCode());
result = prime * result + ((this.dn == null) ? 0 : this.dn.hashCode());
result = prime * result + Arrays.hashCode(this.jpegPhoto);
result = prime * result
+ ((this.objectClasses == null) ? 0 : new HashSet<String>(this.objectClasses).hashCode());
result = prime * result + ((this.objectClasses == null) ? 0 : new HashSet<>(this.objectClasses).hashCode());
result = prime * result + ((this.someRandomField == null) ? 0 : this.someRandomField.hashCode());
result = prime * result + ((this.someRandomList == null) ? 0 : this.someRandomList.hashCode());
result = prime * result + ((this.surname == null) ? 0 : this.surname.hashCode());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ public final class PlainPerson {
public PlainPerson(Name dn, String commonName, String surname) {
this.dn = dn;
this.surname = surname;
this.objectClasses = new ArrayList<String>();
this.objectClasses = new ArrayList<>();
this.objectClasses.add("top");
this.objectClasses.add("person");
this.cn = commonName;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@ public final class SchemaViewerTests {
try {
System.setErr(new PrintStream(output));
List<String> commandFlags = new ArrayList<String>(Arrays.asList(commonFlags));
List<String> commandFlags = new ArrayList<>(Arrays.asList(commonFlags));
commandFlags.addAll(Arrays.asList(flags));
SchemaViewer.main(commandFlags.toArray(new String[0]));
@@ -114,7 +114,7 @@ public final class SchemaViewerTests {
// ensure we get representative test coverage
@Test
public void testSchemaViewer() throws Exception {
new ExecuteRunnable<TestData>().runTests(new RunnableTests<TestData>() {
new ExecuteRunnable<TestData>().runTests(new RunnableTests<>() {
public void runTest(TestData testData) {
String result = runSchemaViewer(testData.flag, testData.value);
assertThat(testData.result).isEqualTo(result);