CPD Results
The following document contains the results of PMD's CPD 7.7.0.
Duplications
| File |
Project |
Line |
| org/bremersee/geojson/GeoJsonObjectMapperModule.java |
GeoJSON for JTS Topology Suite |
125 |
| org/bremersee/ldaptive/LdaptiveObjectMapperModule.java |
Spring Integration Ldaptive |
54 |
String version = GeoJsonObjectMapperModule.class.getPackage().getImplementationVersion();
if (version != null) {
try {
int i = version.indexOf('-');
if (i < 0) {
snapshotInfo = null;
} else {
snapshotInfo = version.substring(i + 1);
String[] a = version.substring(0, i).split(Pattern.quote("."));
major = Integer.parseInt(a[0]);
minor = Integer.parseInt(a[1]);
patchLevel = Integer.parseInt(a[2]);
}
} catch (RuntimeException e) {
major = defaultMajor;
minor = defaultMinor;
snapshotInfo = defaultSnapshotInfo;
}
}
return new Version(major, minor, patchLevel, snapshotInfo, "org.bremersee", |
| File |
Project |
Line |
| org/bremersee/comparator/spring/boot/SortOrderAutoConfiguration.java |
Comparator Spring Boot Autoconfigure |
57 |
| org/bremersee/comparator/spring/boot/SortOrderWebAutoConfiguration.java |
Comparator Spring Boot Autoconfigure |
58 |
| org/bremersee/comparator/spring/boot/SortOrderWebFluxAutoConfiguration.java |
Comparator Spring Boot Autoconfigure |
57 |
public SortOrderAutoConfiguration(SortOrderConverterProperties properties) {
SortOrderTextSeparators defaults = SortOrderTextSeparators.defaults();
this.separators = SortOrderTextSeparators.builder()
.argumentSeparator(Optional.ofNullable(properties.getArgumentSeparator())
.filter(StringUtils::hasText)
.orElse(defaults.getArgumentSeparator()))
.chainSeparator(Optional.ofNullable(properties.getChainSeparator())
.filter(StringUtils::hasText)
.orElse(defaults.getChainSeparator()))
.build();
}
/**
* Init.
*/
@EventListener(ApplicationReadyEvent.class)
public void init() {
log.info("""
*********************************************************************************
* {}
*********************************************************************************""",
ClassUtils.getUserClass(getClass()).getSimpleName());
}
/**
* Creates sort order converter.
*
* @return the sort order converter
*/
@ConditionalOnMissingBean |
| File |
Project |
Line |
| org/bremersee/spring/boot/autoconfigure/ldaptive/LdaptiveConnectionProperties.java |
Spring Integration Boot Autoconfiguration |
49 |
| org/bremersee/ldaptive/LdaptiveProperties.java |
Spring Integration Ldaptive |
68 |
private boolean immutable;
/**
* URL of the LDAP server(s) separated by space. For example
* {@code ldaps://ldap1.example.org:636 ldaps://ldap2.example.org:636}.
*/
private String ldapUrl;
/**
* Duration of time that connects will block.
*/
private Duration connectTimeout = Duration.ofMinutes(1);
/**
* Duration of time to wait for startTLS responses.
*/
private Duration startTlsTimeout = Duration.ofMinutes(1);
/**
* Duration of time to wait for responses.
*/
private Duration responseTimeout = Duration.ofMinutes(1);
/**
* Duration of time that operations will block on reconnects, should generally be longer than
* connect timeout.
*/
private Duration reconnectTimeout = Duration.ofMinutes(2);
/**
* Whether to automatically reconnect to the server when a connection is lost. Default is true.
*/
private boolean autoReconnect = true;
/**
* The reconnect strategy.
*/
private ReconnectStrategy reconnectStrategy = ReconnectStrategy.ONE_RECONNECT_ATTEMPT;
/**
* Whether pending operations should be replayed after a reconnect. Default is true.
*/
private boolean autoReplay = true;
/**
* The ssl configuration.
*/
private SslProperties sslConfig = new SslProperties();
/**
* Connect to LDAP using startTLS.
*/
private boolean useStartTls;
/**
* DN to bind as before performing operations.
*/
private String bindDn;
/**
* Credential for the bind DN.
*/
private String bindCredentials;
/**
* Perform a fast bind, if no credentials are present.
*/
private boolean fastBind = false;
/**
* The connection strategy.
*/
private ConnectionStrategy connectionStrategy = ConnectionStrategy.ACTIVE_PASSIVE;
/**
* The connection validator.
*/
private ConnectionValidatorProperties connectionValidator = new ConnectionValidatorProperties();
/**
* Specifies whether the connection should be pooled or not. Default is {@code false}.
*/
private boolean pooled = false;
/**
* The connection pool configuration.
*/
private ConnectionPoolProperties connectionPool = new ConnectionPoolProperties();
/**
* Instantiates new ldaptive connection properties.
*/
public LdaptiveConnectionProperties() { |
| File |
Project |
Line |
| org/bremersee/spring/boot/autoconfigure/ldaptive/LdaptiveConnectionProperties.java |
Spring Integration Boot Autoconfiguration |
313 |
| org/bremersee/ldaptive/LdaptiveProperties.java |
Spring Integration Ldaptive |
513 |
}
/**
* The search filter properties.
*/
@Data
public static class SearchFilterProperties {
/**
* The search filter (like {@code (&(objectClass=inetOrgPerson)(uid=administrator))}).
*/
private String filter;
/**
* Instantiates new search filter properties.
*/
public SearchFilterProperties() {
super();
}
}
}
}
/**
* The connection pool properties.
*/
@Data
public static class ConnectionPoolProperties {
/**
* Duration to wait for an available connection.
*/
private Duration blockWaitTime = Duration.ofMinutes(1);
/**
* Minimum pool size.
*/
private int minPoolSize = 3;
/**
* Maximum pool size.
*/
private int maxPoolSize = 10;
/**
* Whether to connect to the ldap on connection creation.
*/
private boolean connectOnCreate = true;
/**
* Whether initialize should throw if pooling configuration requirements are not met.
*/
private boolean failFastInitialize = true;
/**
* Whether the ldap object should be validated when returned to the pool.
*/
private boolean validateOnCheckIn = false;
/**
* Whether the ldap object should be validated when given from the pool.
*/
private boolean validateOnCheckOut = false;
/**
* Whether the pool should be validated periodically.
*/
private boolean validatePeriodically = false;
/**
* The validator for the connections in the pool.
*/
private ConnectionValidatorProperties validator = new ConnectionValidatorProperties();
/**
* Prune period.
*/
private Duration prunePeriod = Duration.ofMinutes(5);
/**
* Idle time.
*/
private Duration idleTime = Duration.ofMinutes(10);
/**
* Instantiates new connection pool properties.
*/
public ConnectionPoolProperties() {
super();
}
} |
| File |
Project |
Line |
| org/bremersee/spring/boot/autoconfigure/security/authentication/AuthenticationProperties.java |
Spring Integration Boot Autoconfiguration |
190 |
| org/bremersee/spring/security/ldaptive/authentication/LdaptiveAuthenticationProperties.java |
Spring Integration Security Ldaptive |
201 |
public Map<String, String> toRoleMappings() {
return Stream.ofNullable(getRoleMapping())
.flatMap(Collection::stream)
.collect(Collectors.toMap(
RoleMapping::getSource,
RoleMapping::getTarget,
(first, second) -> first,
LinkedHashMap::new));
}
/**
* To role string replacements map.
*
* @return the map
*/
public Map<String, String> toRoleStringReplacements() {
return Stream.ofNullable(getRoleStringReplacements())
.flatMap(Collection::stream)
.collect(Collectors.toMap(
StringReplacement::getRegex,
StringReplacement::getReplacement,
(first, second) -> first,
LinkedHashMap::new));
} |