Skip to content

Commit

Permalink
Step maven-pmd-plugin version to support java17 (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommystendahl authored Sep 28, 2023
1 parent 96db00e commit 5469db8
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static ConnectionResource fromName(String name)
{
String[] parts = StringUtils.split(name, '/');

if (!parts[0].equals(ROOT_NAME) || parts.length > 1)
if (!ROOT_NAME.equals(parts[0]) || parts.length > 1)
{
throw new IllegalArgumentException(String.format("%s is not a valid connection resource name", name));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ else if (normalizedInput.startsWith(REVOKE_PREFIX))
{
return WhitelistOperation.REVOKE;
}
else if (normalizedInput.equals(DROP_LEGACY_KEY_PATTERN))
else if (DROP_LEGACY_KEY_PATTERN.equals(normalizedInput))
{
return WhitelistOperation.DROP_LEGACY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private boolean containsBlob(AbstractType<?> type)
{
if (type.asCQL3Type() instanceof CQL3Type.Native)
{
return type.asCQL3Type() == CQL3Type.Native.BLOB;
return type.asCQL3Type().equals(CQL3Type.Native.BLOB);
}
if (type instanceof CollectionType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ public boolean isWhitelisted(AuditEntry logEntry)
}
catch (UnavailableException e)
{
LOG.debug("Audit entry for {} not whitelisted as filter backend is unavailable", logEntry.getUser(), e);
if(LOG.isDebugEnabled())
{
LOG.debug("Audit entry for {} not whitelisted as filter backend is unavailable", logEntry.getUser(), e);
}
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ void discoverFiles()

for (File discoveredFile : discoveredFiles)
{
LOG.debug("Discovered {}", discoveredFile.getPath());
if(LOG.isDebugEnabled())
{
LOG.debug("Discovered {}", discoveredFile.getPath());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ private void reset()
@Override
public synchronized void onAcquired(int cycle, File file)
{
LOG.debug("Chronicle acquired [{}] {} at {} bytes", cycle, file.getPath(), file.length());
if(LOG.isDebugEnabled())
{
LOG.debug("Chronicle acquired [{}] {} at {} bytes", cycle, file.getPath(), file.length());
}

if (bootstrapper.isBootstrapping())
{
Expand All @@ -62,7 +65,10 @@ public synchronized void onAcquired(int cycle, File file)
@Override
public void onReleased(int cycle, File file)
{
LOG.debug("Chronicle released [{}] {} at {} bytes", cycle, file.getPath(), file.length());
if(LOG.isDebugEnabled())
{
LOG.debug("Chronicle released [{}] {} at {} bytes", cycle, file.getPath(), file.length());
}

releasedFileQueue.offer(file);
maybeRotate();
Expand All @@ -89,10 +95,16 @@ private boolean tryDeleteOldestFile()
return false;
}

LOG.debug("Deleting Chronicle file {} at {} bytes", toDelete.getPath(), toDelete.getPath().length());
if(LOG.isDebugEnabled())
{
LOG.debug("Deleting Chronicle file {} at {} bytes", toDelete.getPath(), toDelete.getPath().length());
}
if (!toDelete.delete())
{
LOG.error("Failed to delete Chronicle file {}", toDelete.getPath());
if(LOG.isErrorEnabled())
{
LOG.error("Failed to delete Chronicle file {}", toDelete.getPath());
}
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ private static Function<AuditEntry, Object> getFormattedTimestamp(DateTimeFormat
@Override
public void log(AuditEntry logEntry)
{
auditLogger.info(formatter.getLogTemplate(), formatter.getArgumentsForEntry(logEntry));
if(auditLogger.isInfoEnabled())
{
auditLogger.info(formatter.getLogTemplate(), formatter.getArgumentsForEntry(logEntry));
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<org.apache.maven.plugins.maven-gpg-plugin.version>1.6</org.apache.maven.plugins.maven-gpg-plugin.version>
<org.jacoco.jacoco-maven-plugin.version>0.8.6</org.jacoco.jacoco-maven-plugin.version>
<org.pitest.pitest-maven.version>1.6.2</org.pitest.pitest-maven.version>
<org.apache.maven.plugins-maven-pmd-plugin.version>3.14.0</org.apache.maven.plugins-maven-pmd-plugin.version>
<org.apache.maven.plugins-maven-pmd-plugin.version>3.15.0</org.apache.maven.plugins-maven-pmd-plugin.version>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit 5469db8

Please sign in to comment.